OZONE Asylum
Forums
DHTML/Javascript
Genetic Sudoku solver
This page's ID:
28035
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Ok, I've made one. It works, and is able to solve any sudoku genetically. It came up with this: [quote] ---------------------. |5 3 4 |6 7 8 |9 1 2 |6 7 2 |1 9 5 |3 4 8 |1 9 8 |3 4 2 |5 6 7 ---------------------. |8 5 9 |7 6 1 |4 2 3 |4 2 6 |8 5 3 |7 9 1 |7 1 3 |9 2 4 |8 5 6 ---------------------. |9 6 1 |5 3 7 |2 8 4 |2 8 7 |4 1 9 |6 3 5 |3 4 5 |2 8 6 |1 7 9 [/quote] As the solution for this: http://fr.wikipedia.org/wiki/Image:Sudoku-by-L2G-20050714.gif However, as discussed previously with 2D, while this evolves flawlessly towards the solution in all cases, it took it 150000+ generations to find the result. Eg. half of the night :( I can refine it of course, but again, it's a matter of balance: say the algorithm engages in a wrong "evolutionary path", it has to turn back for a few steps, so it *needs* regression which makes it slower (every now and then it jumps back in evolution). Still, for easy sudokus, the GA approach is not worth it, there are empirical algorithms that get the job done quick. But I wonder about really hard Sudokus.. Are there grids that couldn't be soilved using classic programmatic ways? Ah, and one sure benefit of GA over classic methods: have your GA solve an "empty" gris (all random numbers, none fixed), and you got a niftey Sudoku generator. <off to tweak this a little before implementing a SOAP interface for automod>
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »