Small Polyomino Packing Michael Brand Discrete Maths Research
Small Polyomino Packing Michael Brand Discrete Maths Research Group talk 31 Jul 2017
Bit of background
Terminology Domino Polyomino § As per Tetris rules, polyominoes can only lie on integral grid positions. They can be rotated by 90° multiples. § If mirror flips are allowed: two-sided, else one-sided. All results quoted apply to either. 3
Some known results § With which polyominoes can you tile the plane? – (Berger 1966) Whether a set of polyominoes tiles the plane (with or without rotation) is undecidable. – (Gambini, Vuillon 2007) Decision algorithm for single polyominoes, but only for tiling by translations. [Improvement over (Beauquier, Nivat 1991). ] – (Blondin Massé, Brlek, Garon, Labbé 2011) Infinite families that can tile the plane by translations in more than one way. 4
Some known results (cntd) § With which polyominoes can you tile a given finite shape? – Berger’s (1966) result implies that tiling a finite shape is NPcomplete if tiles can remain unused. [Based on a result by Garey, Johnson, Papadimitriou, published in (Garey, Johnson 1979). ] – (Moore, Robson 2001) NP-completeness even if all polyominoes must be used, given shape is non-simple (has holes). Proof uses only polyominoes of a single type. – (Horiyama, Ito, Nakatsuka, Suzuki, Uehara 2012) Even if using only trominoes, whether I-shaped or L-shaped. Also #P-complete and ASP-complete. – For dominoes, the problem is equivalent to matching, so polytime. 5
Some known results (cntd) § With which polyominoes can you tile a rectangle? – (Kempe 2003, unpublished) Weakly NP-complete, using n polyominoes of size exponential in n. – (Baxter 2000, unpublished) using n polyominoes of size polynomial in n. § Also preceding (Moore, Robson 2001). – (Demaine, Demaine 2007) using n polyominoes of size polylogarithmic in n. – If using only sub-logarithmic polyominoes, this is a “sparse” problem. (Mahaney 1982) proves sparse problems cannot be NPcomplete unless P=NP. – Leaving a gap between logarithmic and polylogarithmic. 6
The small polyomino packing problem
Theorem 1: Small Polyomino Packing § Let P 1, P 2, … be the sequence of all one-sided polyominoes, sorted in such a way that |Pi|<|Pj| implies i<j, where |Pi| indicates the area of Pi. (This order is not unique. ) § It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a rectangle of dimensions w×h. § The condition for strong NP-hardness is that w and h are bounded by a polynomial in n. § We can assume that the sum of all |Pi| equals wh without this changing the difficulty of the problem. 8
Proof: § We reduce from the NP-complete 3 -partition problem: – Given a multi-set of positive integers x 1, …, x 3 m, partition the multiset into triplets, each of which has the same sum. – The sum itself is – and we can freely assume that all xi are smaller than it. 9
A first attempt at reduction § {1, 1, 1, 2, 2, 3} → § Problem #1: This sets the number of polyominoes to be polynomial in m (which is OK) but |Pi| to be polynomial in the xi (which is not OK). 10
Why? § The problem has to be described in a number of bits polynomial in m. So, |Pi| must be O(log m)=O(log n). § To prove this, we want to show , where Ct is the number of polyominoes of area t. – For the LHS, we can show an exponential family of such polyominoes. (Examples will be given on next slides. ) – For the RHS, the best known bound is 4. 649551 t (Klarner, Rivest 1973), but proving 81 t is easy by describing each polyomino’s perimeter via a simplified Freeman chain code (Maloň, Freeman 1961). 11
Workaround #1 12
Problem #2: § {1, 1, 1, 2, 2, 3} → 13
Problem #2: § {1, 1, 1, 2, 2, 3} → § Workaround #2: Add to each xi a Δ, such that 4(min(xi)+Δ)>Σ+3Δ. § Can always be done while inflating the description size only polynomially. 14
Problem #3: § {1, 1, 1, 2, 2, 3} → § Workaround #3: Choose a Δ>h. § Can still always be done while inflating only polynomially. § Q. E. D. (Up to minor points, which we’ll ignore here. ) 15
Corollary 1. 1: Small Polyomino Square Packing § It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a square. § Proof: 16
Comparing the results § Theorem 1: It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a rectangle of dimensions w×h. § Corollary 1. 1: It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a square. 17
Comparing the results § Theorem 1: It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a rectangle of dimensions w×h. § Corollary 1. 1: It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a square. § Corollary 1. 2: It is (strongly) NP-hard to determine whether a 1, …, an copies of P 1, …, Pn, respectively, can be packed into a rectangle. 18
Proof ha § The trick is to enlarge ha, hb and hc and make them all equal. (They are still O(1). ) § This makes the set of position of all pieces in the final construction known. § And that, in turn, allows to add “hooks” going horizontally. hb hc 19
Proof § The trick is to enlarge ha, hb and hc and make them all equal. (They are still O(1). ) § This makes the set of position of all pieces in the final construction known. § And that, in turn, allows to add “hooks” going horizontally. 20
The final construction § {1, 1, 1, 2, 2, 3} → § Q. E. D. 21
Other, similar results: Sparse Polyomino Packing § Describe polyominoes in ways other than their positions in the P sequence, such as – Bounding box and bitmap – Freeman chain code encoding § These variations are also strongly NP-hard. 22
Future research: the simplest problem of all § Pallet Loading Problem (PLP): How many a×b rectangular polyominoes fit inside an A×B rectangle? ? 23
Future research: the simplest problem of all § Pallet Loading Problem (PLP): How many a×b rectangular polyominoes fit inside an A×B rectangle? 24
Thank you! Questions?
- Slides: 25