Class BranchAndBoundThreads

java.lang.Object
topics.branchandbound.util.threads.BranchAndBoundThreads
Direct Known Subclasses:
RectanglesPlacementThreads

public class BranchAndBoundThreads 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 static HeapThreads ds
    • bestNode

      protected static Node bestNode
    • rootNode

      protected static Node rootNode
    • pruneLimit

      protected static int pruneLimit
  • Constructor Details

    • BranchAndBoundThreads

      public BranchAndBoundThreads()
      Constructor for BrancAndBount objects
  • Method Details

    • branchAndBound

      public void branchAndBound(Node rootNode, int numberOfThreads)
      Manages all the process, from the beginning to the end
      Parameters:
      rootNode - Starting state of the problem
      numberOfThreads - Number of threads used
    • 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