BOARD
Rotate and place all blocks to fill the board with no gaps
All blocks fitted onto the board with zero gaps!
An interlocking layout with no continuous split line across the board!
2D Strip/Bin Packing is a classic NP-hard combinatorial optimization problem where parts must be cut from plate material with zero void.
WaSHI linearizes coordinate positioning, rotation disjunctions, and pairwise non-overlap conditions via Big-M Mixed-Integer Linear Programming (MILP), solved to optimality with HiGHS:
// Non-overlap condition for parts (i, j) x[i] + w[i] <= x[j] + M * (1 - delta[i][j][0]) x[j] + w[j] <= x[i] + M * (1 - delta[i][j][1]) y[i] + h[i] <= y[j] + M * (1 - delta[i][j][2]) y[j] + h[j] <= y[i] + M * (1 - delta[i][j][3]) delta[i][j][0] + delta[i][j][1] + delta[i][j][2] + delta[i][j][3] >= 1