Class WorkerThread
java.lang.Object
java.lang.Thread
topics.branchandbound.utils.threads.WorkerThread
- All Implemented Interfaces:
Runnable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Executes the continuous extraction and evaluation loop until the shared state space tree is exhausted or completely pruned.Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, toString, yield
-
Constructor Details
-
WorkerThread
public WorkerThread()
-
-
Method Details
-
run
-