Class RectanglesPlacement
java.lang.Object
topics.branchandbound.utils.BranchAndBound
topics.branchandbound.rectangles.RectanglesPlacement
Optimal Placement of Rectangles
This class solves a 2D bin packing variant where a given set of rectangular pieces must be placed on an N × N grid. The objective is to minimize the bounding box area of the placed pieces. It utilizes a Branch and Bound algorithm to systematically evaluate positions and orientations while pruning sub-optimal configurations.
*Complexity
- Time Complexity:
O((2 × N²)P)- Where N is the board dimension and P is the number of pieces. For each piece, the algorithm explores all grid cells in two orientations. Bounding heuristics heavily prune this theoretical worst-case. - Space Complexity:
O(N²)per state node - Required for storing the 2D matrix representing the board configuration.
- Author:
- vicegd
-
Field Summary
Fields inherited from class BranchAndBound
bestNode, globalUpperBound, nodeHeap, rootNode -
Constructor Summary
ConstructorsConstructorDescriptionRectanglesPlacement(int boardSize, List<Piece> pieces) Initializes the problem solver and establishes the execution tree root. -
Method Summary
Methods inherited from class BranchAndBound
branchAndBound, getBestNode, getRootNode, printSolutionTrace
-
Constructor Details
-
RectanglesPlacement
-