# Grid $k$-coloring without monochromatic rectangles

Update: The obstruction set (i.e. the NxM "barrier" between colorable and uncolorable grid sizes) for all monochromatic-rectangle-free 4-colorings is now known.

Anyone feel up to trying 5-colorings? ;)

The following question arises out of Ramsey Theory.

Consider a $k$-coloring of the $n$-by-$m$ grid graph. A monochromatic rectangle exists whenever four cells with the same color are arranged as the corners of some rectangle. For example, $(0,0), (0,1), (1,1),$ and $(1,0)$ form a monochromatic rectangle if they have the same color. Similarly, $(2,2), (2,6), (3,6),$ and $(3,2)$ form a monochromatic rectangle, if colored with the same color.

Question: Does there exist a $4$-coloring of the $17$-by-$17$ grid graph that does not contain a monochromatic rectangle? If so, provide the explicit coloring.

Some known facts:

• $16$-by-$17$ is $4$-colorable without a monochromatic rectangle, but the known coloring scheme does not appear to extend to the $17$-by-$17$ case. (I'm omitting the known $16$-by-$17$ coloring because it would very likely be a red herring for deciding $17$-by-$17$.)
• $18$-by-$19$ is NOT $4$-colorable without a monochromatic rectangle.
• $17$-by-$18$ and $18$-by-$18$ are also unknown cases; an answer to these would be interesting as well.

Disclaimer: Bill Gasarch has a $289 (USD) bounty on a positive answer to this question; you can reach him through his blog. A note on etiquette: I'll make sure he knows the source of any correct answer (should one arise). He brought it up again during a rump session at Barriers II, and I find it interesting, so I'm forwarding the question here (without his knowledge; though I highly doubt he would mind). - Just want to add some references/pointers: apart from the blog posts[1,2], the updates at the bit-player blog[3,4] are detailed and insightful. There has been substantial discussion on all of these posts. [1]: blog.computationalcomplexity.org/2009/11/… [2]: blog.computationalcomplexity.org/2009/12/… [3]: bit-player.org/2009/the-17x17-challenge [4]: bit-player.org/2009/17-x-17-a-nonprogress-report Note: No markdown formatting in comments? How can I make pretty links? – Neeldhara Aug 31 '10 at 14:01 Those are some great links. Thanks Neeldhara! :) – Daniel Apon Aug 31 '10 at 14:47 Likewise, thanks for posting this here - I followed the developments on this for some time, and this should rekindle interest in the problem! – Neeldhara Sep 1 '10 at 5:37 @Moron: Yes, you only need to consider those rectangles whose sides are parallel to the axes. BTW, there is also a complexity-theory angle to this: Bill has speculated that given a partial k-coloring of an m by n grid, determining whether the coloring can be completed in a rectangle-free manner is NP-complete. – Kurt Sep 2 '10 at 21:07 The automorphism group of the problem is large:$2\times 4! \times(17!)^2=6.1\times 10^{30}$solution-preserving symmetries, counting the row-column swap, permutations of the colors, permutations of the rows, and permutations of the columns. Is it known how many distinct rectangle-free subsets there are of size$71,72,73,...$? – mjqxxxx Mar 23 '11 at 3:11 ## 6 Answers Some of you are probably aware of this, but the 17 x 17 coloring problem has been solved by Bernd Steinbach and Christian Posthoff. See Gasarch's blog post here. - Also the 18x18 grid is 4-colorable without monochromatic rectangles ... now, the only "missing tile" is the 21x12 grid – Marzio De Biasi Feb 8 '12 at 14:55 This is not really an answer to the question, but I've encoded the 17x17 4-coloring problem as a 4-CNF (in the standard DIMACS format for SAT-solvers) and uploaded it here. If anyone has access to a good SAT solver (and a supercomputer!) maybe we can make some progress. Note: in my encoding, if gridpoint$(i,j)$is assigned color$c \in \{0,1,2,3\}$, then the variable$(17i+j+289c+1)$takes the value$1$, and$0$otherwise. - Awesome. (I do indeed have access to a supercomputer.) Next step's running numbers to estimate this thing's runtime on the specific machine. Who knows if this is in the ballpark of reasonable, but it's a different approach I'd been looking at. Now, time to go find that recent question on SAT-solvers so I can read up... :) – Daniel Apon Sep 27 '10 at 13:52 Turns out the problem I was thinking of was on #SAT, so I've started a new question on SAT solvers at cstheory.stackexchange.com/questions/1719/… – Daniel Apon Sep 27 '10 at 14:35 Great - let me know how it goes! – Lev Reyzin Sep 27 '10 at 21:28 @Lev, just a random update: it appears the runtime of the 17x17, even using the best possible supercomputer and a really fast SAT solver, is still astronomical. Plus side: it appears within the realm of reason to attack this with a supercomputer in a targeted way, i.e. find the exact partial 1-colorings that will work (already done by hand by Beth Kupkin at Rutgers), then find the exact partial 2-colorings that will work from that, etc. Down side: there's no "quick solution"; it'll have to be a long-term project with multiple stages of supercomputer execution – Daniel Apon Nov 16 '10 at 11:44 @Joe, however! Here is a "leaderboard" of the current best approximate colorings: Leaderboard -- It appears simulated annealing works quite well for finding approximate colorings. – Daniel Apon Mar 23 '11 at 19:31 This is not a real answer, either. Certainly the problem here is the presence of an astronomical number of symmetries, which fool even the best SAT solvers on the best supercomputers. Such symmetries map solutions to solutions and non-solutions to non-solutions: in this case probably there is an immense number of almost-solutions (i.e. assignments satisfying all but a small amount of clauses), each of which can be obtained by any other applying a proper symmetry. Hence the solver wastes an enormous amount of time trying each of these almost-solutions, while in a certain sense they are all the same. Exploiting symmetries (see this paper) should be an avenue to explore in order to attack this hard 17x17 instance and make some progress on it. I wonder if anyone already tried to do so. - Hey, that's pretty sweet! :) Hadn't seen it before. – Daniel Apon Mar 23 '11 at 19:42 @Daniel: You're welcome! ;-) Hope it helps. – Giorgio Camerani Mar 23 '11 at 21:19 I used Aloul's "Shatter" program on multiple encodings of the 17x17 problem and put some CPU weeks into a few different SAT solvers and had no luck. The paper Walter referenced is actually the first of maybe a dozen or something he's written on the subject, so there might be something in there that'll do the job, but it's no low hanging fruit. – Jay Kominek Apr 8 '11 at 6:44 Again, not a real answer, but anyway, here are some thoughts on adopting graph colouring algorithms for this problem. Let us say that a set$I$of grid positions is an independent set if set$I$does not contain all four corners of some rectangle. Define a maximal independent set in the obvious way. Now the following are equivalent claims: 1.$n$-by-$m$grid can be coloured with$k$colours. 2.$n$-by-$m$grid can be covered with$k$independent sets. 3.$n$-by-$m$grid can be covered with$k$maximal independent sets. Now, the interesting thing is that covering with independent sets can be done in time$\log k\ \text{poly}(nm)2^{nm}$using fast covering product algorithm (Björklund et al. 2007). This is certainly is an improvement over trivial$k^{mn}$algorithm, though$2^{289}$seems still unsurmountable. If the family of all (maximal) independent set has sufficiently nice structure, it might also be possible to fine-tune the covering product algorithm. - How is claim 3 equivalent to claim 2? The maximal independent set for 17x17 is of size 74, by the way, as shown in Elizabeth Kupin's paper (pdf). There is only one such set, not counting permutations of the rows and columns as distinct. – Null Set May 22 '11 at 20:47 I mean maximal in the sense that no proper superset is independent, as it is customary in computer science. Maximum is the word usually used when meaning "of largest possible size". – Janne Korhonen May 22 '11 at 21:15 In that case, the set of maximal independent sets contains all the row/column permutations of the unique size 74 set, and no size 73 independent sets, because they are all subsets of the size 74 set. I'm not sure what it has from sizes 67 to 72. – Null Set May 22 '11 at 21:31 The 21x12 grid is 4-colorable without monochromatic rectangles, as well !!! - This is Bill Bouris. Hi, Dan. I'm working on a program that searches for a suitable 17x17 matrix which exhibits no-4-coloring according to Ramsey's Theory. I use a positional matrix depicting all connections between points and fix the main diagonal and allow the top row of the matrix to run through all of the possible 16choose8 combinations; I capture only the matrices that pass regarding the following criteria... no-XRRR, no-RXRR, no-RRXR, no-RRRX, no-XBBB, no-BXBB, etc., then I sweep through the matrix using the next weakest criteria... no-XBRR, noBXRR, no-BBXR, no-BBRX, no-XRBB, no-RXBB, etc. for a total of 32 sweeps until the computer fills in the coloring automatically. I've noticed that there's a possible candidate per every 400 matrices out of a total 12780, and it takes .95 hours to find the candidate or 1 per every 8.644 seconds. It's coming along, but I don't have much time to program it... as I work full-time. We should work together... I could use the$289.00!

-
Bill Gasarch should only be paying out $128. – William Bouris May 23 '11 at 0:49 sorry about that... 272/2 or$136 –  William Bouris May 23 '11 at 1:10
This is not an answer to the question. best as a comment. –  Suresh Venkat May 23 '11 at 6:57