Class BranchAndBound
java.lang.Object
topics.branchandbound.util.BranchAndBound
- Direct Known Subclasses:
AgentsTasks, EightPuzzle, RectanglesPlacement
Main class to solve problems using the Branch and Bound technique
We need to extend it for any specific problem
- Author:
- vicegd
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbranchAndBound(Node rootNode) 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 int pruneLimit
-
-
Constructor Details
-
BranchAndBound
public BranchAndBound()Constructor for BrancAndBount objects
-
-
Method Details
-
branchAndBound
Manages all the process, from the beginning to the end- Parameters:
rootNode- Starting state of the problem
-
getRootNode
-
getBestNode
-
printSolutionTrace
public void printSolutionTrace()Prints the solution from the root node to the best node
-