Class BranchAndBoundThreads
java.lang.Object
topics.branchandbound.util.threads.BranchAndBoundThreads
- Direct Known Subclasses:
RectanglesPlacementThreads
Main class to solve problems using the Branch and Bound technique
We need to extend it for any specific problem
- Author:
- vicegd
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Nodeprotected static HeapThreadsprotected static intprotected static Node -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbranchAndBound(Node rootNode, int numberOfThreads) Manages all the process, from the beginning to the endGets the best nodeGets the root nodevoidPrints the solution from the root node to the best node
-
Field Details
-
ds
-
bestNode
-
rootNode
-
pruneLimit
protected static int pruneLimit
-
-
Constructor Details
-
BranchAndBoundThreads
public BranchAndBoundThreads()Constructor for BrancAndBount objects
-
-
Method Details
-
branchAndBound
Manages all the process, from the beginning to the end- Parameters:
rootNode- Starting state of the problemnumberOfThreads- Number of threads used
-
getRootNode
-
getBestNode
-
printSolutionTrace
public void printSolutionTrace()Prints the solution from the root node to the best node
-