Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Yet Another Dancing Links Solver/Generator (with graphs!)

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku
View previous topic :: View next topic  
Author Message
jmelloy

Joined: 21 Apr 2008
Posts: 2
:

Items
PostPosted: Mon Apr 21, 2008 7:11 pm    Post subject: Yet Another Dancing Links Solver/Generator (with graphs!) Reply with quote

I've written a generic dancing links solver in Python, and have an example solving of both 8 queens and Sudoku. The sudoku portion also generates a Sudoku, but takes longer than it could (about 3 seconds).

I caught a wild hair this weekend, and wrote a script to demonstrate how a dancing links solver branches and fails.

Here's a link to my graph (the spam-prevention on this website is frighteningly efficacious):

cavernum dot net slash dlsudoku

The nodes are clickable and will show the board at any state.

There's also a link to my svn repository with the (horrifically un-documented) source. It will work with any sudoku, and uses graphviz to create the graphs.

As you look at the graph, you can see the choices it makes, and the squares that have multiple options. The (3,4) 5 notation means "Choose 5 at position (3,4)".

For the not faint of heart, here's the graph for the easter monster:
cavernum dot net slash dlsudoku slash easter dot html

Interestingly enough, when dancing links is solving the easter monster, it makes two choices as its first two moves. After exhausting possibilities for those two branches, it doesn't branch at all after that.

If you need a better explanation of what you're seeing, let me know.
Back to top
View user's profile Send private message
Adak

Joined: 27 Feb 2008
Posts: 87
:

Items
PostPosted: Tue Apr 22, 2008 8:14 pm    Post subject: Reply with quote

Congratulations on your program, JM. I haven't had a chance to visit your site yet, but certainly will soon.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Programming sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron