Solved

This page shows the progression of “solved” rules sets – with a focus on particularly difficult rule sets.

5 Color Grids

Isolated Rectangles

viewer link

Even Distribution:  Row, Column, Block of 5 row by 7 column cells

Adjacency Restrictions:  Corner, all colors

The corner adjacency restriction results in two main features:  each block of color can span multiple rows or multiple columns, but not both (as such, they are rectangular), and each block is surrounded by blocks of other colors.  

Although the rule set wasn’t that hard for my program to manage, I found the images visually impressive and for a couple days my program generated only grids following these rules.  The 37,000 grids still take up more than 70% of the grids in my database, as such is a pretty big variety at the extremes: 

horizontal

vertical

small blocks

big blocks

Isolated Rectangles with 5 Individual Color Rules

viewer link

Even Distribution:  Row, Column, Block of 5 row by 7 column cells

Adjacency Restrictions:  Corner, all colors.  Vertical (blocks are horizontal) – 3 colors, Horizontal – 2 colors.  

The first rule set that my program took over a day to generate a single grid.  Sadly, it only takes about a minute to create a grid following these rules now.  

4 Color Grids

Isolated Rectangles

viewer link

Even Distribution: Row, Column, 4Rx9C block

Adjacency Restrictions:  Corners, all colors

For some reason I didn’t think it was possible to follow these rules with just 4 colors, but my program proved me wrong.  In terms of difficulty, this is a massive step backwards from the last 5 color rule set, but it was the starting point for the rest of the 4 color sets.  

Outside the Box

viewer link

Even Distribution: Row, Column, 4Rx9C block

Adjacency Restrictions:  green:  horizontal, corner.  dark blue:  vertical, corner.  yellow, turquoise:  island

The “island” rule keeps the isolated part of the corner rule, but without the rectangle part of it.

Since the island rule is less restrictive than the corner rule, my program has much less difficulty with it.  Still, my program generated only 7 of these grids in the first 3 days (it is now about 3 times slower than the last 5 color set at about 20/hour). 

The Cheater

viewer link

Even Distribution:  Row, 2 Columns, 4Rx8C block, Central Rectangles (see viewer for example)

Adjacency Restrictions:  Corners, all colors.  Horizontal:  yellow, purple.  Vertical:  dark blue, azure

Note that the grid size is 16×32 as opposed to 16×36.  This wasn’t the cheat – this is because the central rectangle rule can’t cover the whole grid at 16×36 (I can still use it, but the left and right two columns will belong to 1 less distribution group than the rest of the grid).  

While playing around with rule sets, I discovered that changing the column distribution from a single column to two columns made a massive difference in processing speed (over 100 times the speed).  It took me a while to figure out why:  the single row and single column distribution rules make it so that each cell has a unique set of distribution groups.  The 2 column rule effectively gives each cell a mirror – whatever is valid (distribution-wise) in one cell is valid in the other.  

This discovery allowed me to test rule sets that I didn’t think were possible before, with this particular rule set quickly becoming my favorite (visually).  

It also led me to search for ways to make the program faster, because I wanted to get the same type of result but without the compromise.  

The Lesser Evil

viewer link

Even Distribution:  Row, Single column, 4Rx9C block

Adjacency Restrictions:  Corners, Horizontal (2 colors), Vertical (2 colors).  

The adjacency rules are the same, but the central rectangle distribution group was dropped in exchange for going back to a single column rule.  

Despite the fewer distribution groups, this is actually much harder than the previous grid, and was a major step towards the finale.  

I was so excited that my program generated one of these (after days of trying) that I took the following (edited) screenshot: 

It took 242,000 seconds of CPU time (67 hours on 1 thread) to generate 1 grid – and would have taken a lot longer had I not made the program a lot smarter since the time that it started. 

ID: Despite my enthusiasm, Set ID 2197 was the ultimate goal.  Math geeks might point out that with 0 grids generated, the time should be “infinity” and not 350,000 seconds, but I wanted to see how long the program had tried to create a grid, even if it hadn’t succeeded yet.

I Cheated (Kind of ) to De-Cheat The Cheater

viewer link

Rules:  Same as the Cheater without the cheat

Now that I have bored both myself and any potential reader, I finally get to the entire point of this page.  

Four days ago, while I was writing the Grid Generation page, I went from thinking that this rule set was really, really hard, to impossible.  

This was mainly a result of looking closely at grids generated with “The Cheater” rules, and noticing how unevenly distributed the vertical lines were in individual columns (often with 8 of one color in one column, and 0 in the column next to it).  

It took a major breakthrough in processing speed, significantly improved tracking of failures (including saving attempts that came “close” to finishing the grid), and a mechanism to retry failures afterwards to prove myself wrong.  

After these improvements and running my program overnight, I found that my program managed to fill 505 out of the 512 cells according to the rules before it failed. 

And while I still had to write the mechanism to retry failed attempts, about 15 minutes after I did, the grid above was generated.  

The below image shows the four sets of distribution rules that the grid adheres to: 

Back to Color Grids