Class WorkerThread

java.lang.Object
java.lang.Thread
topics.branchandbound.utils.threads.WorkerThread
All Implemented Interfaces:
Runnable

public class WorkerThread extends Thread

Concurrent Worker Thread

Represents an independent execution context within the multithreaded Branch and Bound algorithmic framework. Each worker actively competes to extract the most promising mathematical states from a shared priority queue, expands them, and evaluates the resulting topological branches.

The thread coordinates with its peers by referencing and updating a global upper bound constraint. If a worker discovers a superior optimal solution, it claims a global lock to update the benchmark, immediately accelerating the pruning operations of all other active threads.

*

Complexity

  • Time Complexity: O(1) per state extraction and evaluation block. The aggregate lifecycle time depends entirely on the size of the unpruned state space distributed across the thread pool.
  • Space Complexity: O(1) auxiliary space per thread. The worker operates strictly on references to the globally managed heap and does not construct isolated data structures beyond transient local variables.
Author:
vicegd
See Also:
  • Constructor Details

    • WorkerThread

      public WorkerThread()
  • Method Details

    • run

      public void run()
      Executes the continuous extraction and evaluation loop until the shared state space tree is exhausted or completely pruned.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread