Class BranchAndBound

java.lang.Object
topics.branchandbound.util.BranchAndBound
Direct Known Subclasses:
AgentsTasks, EightPuzzle, RectanglesPlacement

public abstract class BranchAndBound extends Object
Main class to solve problems using the Branch and Bound technique We need to extend it for any specific problem
Author:
vicegd
  • Field Details

    • ds

      protected Heap ds
    • bestNode

      protected Node bestNode
    • rootNode

      protected Node rootNode
    • pruneLimit

      protected int pruneLimit
  • Constructor Details

    • BranchAndBound

      public BranchAndBound()
      Constructor for BrancAndBount objects
  • Method Details

    • branchAndBound

      public void branchAndBound(Node rootNode)
      Manages all the process, from the beginning to the end
      Parameters:
      rootNode - Starting state of the problem
    • getRootNode

      public Node getRootNode()
      Gets the root node
      Returns:
      The root node
    • getBestNode

      public Node getBestNode()
      Gets the best node
      Returns:
      The best node
    • printSolutionTrace

      public void printSolutionTrace()
      Prints the solution from the root node to the best node