Hi David and thanks for your comment! You raise a good point with the formula simplification. This would be perfectly fine if all I wanted to solve was a 9x9 puzzle. However, the solution above is aimed to solve all NxN sizes. This is precisely the reason why I chose my constraint to generate an ascending list of sequential numbers, based on the field 'n_sqrt'. You could also solve a 36x36 Sudoku puzzle by simply constraining n_sqrt == 6. Then all the constraints will provide you with a legal Sudoku solution for a field of that size. I think given the complexity of what I am trying to express with my constraints, IntelliGen is actually really efficient and good in understanding and solving the constraint model. If you have machine with lots of RAM to spare, then you could even try to solve 625x625 puzzles :-) Cheers,Daniel
↧