For example, consider a 11×11 grid, and choose from the following building blocks:
Five different polyominos |
Fail to cover complete grid |
xi,j,k={1if we place polyomino k at location (i,j)0otherwise
I used as rule that the left-upper corner of each polynomino is its anchor. I.e. in the picture above we have x1,1,4=1, x2,1,2=1, x1,3,5=1 etc.
To formulate a non-overlap constraint I populated a set coveri,j,k,i′,j′, with elements that exist if cell (i′,j′) is covered when we place polyomino k in cell (i,j). To require each cell (i′,j′) is covered we can say:
∀i′,j′:∑i,j,k|coveri,j,k,i′,j′xi,j,k=1
This constraint is infeasible if we cannot cover each cell (i′,j′) exactly once. In order to make sure we can show a meaningful solution when we cannot cover each cell, we formulate the following optimization model:
max∑i,jyi,jyi′,j′=∑i,j,k|coveri,j,k,i′,j′xi,j,kxi,j,k∈{0,1}yi,j∈{0,1}
Here yi,j=1 indicates cell (i,j) is covered exactly once, and yi,j=0 says the cell is not covered.
With a little bit of effort we can produce the following:
61 x 61 board with 9 different polyominos |
References
- Polyomino, https://en.wikipedia.org/wiki/Polyomino
- 2D bin packing on a grid, https://stackoverflow.com/questions/47918792/2d-bin-packing-on-a-grid
This comment has been removed by the author.
ReplyDelete