Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's interesting, last time this came around I started working though how to do it using a Sudoku style solver.

Step 1: If a solution exists it's going to have 4!(17!)^2 'mirror' images of the same solution. To avoid this problem we give each color a number and a specific ordering of the solution. Thus eliminating 4!(17!)^2 - 1 options.

Step 2: Based on the form that order takes we fill in the grid as much as possible. (Most of the top and side row).

Step 3: Start plugging in missing squares until you find contradictions. EX: If swapping a column gives a lower ordering it's not a valid solution.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: