HoDoKu

Programs which generate, solve, and analyze Sudoku puzzles

HoDoKu

Postby hobiwan » Thu Jan 15, 2009 5:25 am

I realize of course that releasing a solver around here means carrying owls to Athens but I have spent some time now with mine and if somebody want's to play, here it is.

It is called HoDoKu, written in Java/Swing (JRE 1.6 or greater) and should therefore run on any OS that is supported by Java (tested on Windows and Linux - Ubuntu/GTK+LAF). It is available in English and German, is licensed under the GPL, and can be downloaded from http://hodoku.sourceforge.net.

Supported solving techniques:
    Singles
    Locked Candidates
    Subsets
    Fish (basic/franken/mutant unfinned/finned/sashimi with endo fins and cannibalism)
    Wings (XY, XYZ, W)
    Uniqueness (Type 1-6, Hidden/Avoidable Rectangle, BUG+1)
    Coloring (Simple/Multiple Colors)
    2-String-Kite, Skyscraper, Empty Rectangle, Sue de Coq
    Chains (Remote Pair, X-Chain, XY-Chain; Nice Loops/AIC and Forcing Chain/Net with group nodes and ALS)
    ALS (XZ, XY, ALS-Chains)
    Templates
    Brute Force (thank's to gsf for letting me use his code)
(and yes tarek, the solver is fully configurable:D ). The solver currently solves sudokus up to SE 9.3 (more or less...).

The main goal however lies not in solving the sudoku but in analyzing it (meaning: playing around with different solution paths). It is possible to manage multiple solution paths simultaneously for one sudoku via an easy to use GUI. For every solution path the puzzle can be brought to a certain state by double clicking a step of the solution. It is possible to list all available steps for a given state and to modify the solution path accordingly. The sudoku including all solution paths can be saved to disk.

HoDoKu has a lot of configuration options, configurations can be saved to disk too. Import/export via the clipboard supports most formats seen in the forums.

The generator produces random sudokus in one of five difficulty levels. The levels can be freely configured. The puzzles are symmetrical, but not minimal, minlex canonicalization is not supported.

Any input is most appreciated.

[edit: added link to project home page]
Last edited by hobiwan on Thu Jan 22, 2009 6:06 pm, edited 1 time in total.
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Re: HoDoKu

Postby tarek » Thu Jan 15, 2009 11:01 am

hobiwan wrote:(and yes tarek, the solver is fully configurable:D ). The solver currently solves sudokus up to SE 9.3 (more or less...).
:D

Congratulations on such a great effort & Thanks for making it available.

tarek
User avatar
tarek
 
Posts: 2624
Joined: 05 January 2006

Postby hobiwan » Thu Jan 15, 2009 7:57 pm

Since I havent gotten time to write a manual till now a few pointers how to use some of the advanced features of HoDoKu:
    After generating/loading the sudoku choose "View|Solution path"
    Resize the window to your liking
    Double click a step in the Solution window: The sudoku gets solved till immediately before that step and the step is highlighted
To change a solution:
    Click with right mouse button on the first step you want to change
    Choose "Delete from here" from the popup menu
    The sudoku is solved till that step, the step (and all that follow) is replaced by "Incomplete solution"
    Switch to "All possible steps"
    Configure Fish and Forcing Chain/Net search and click "Find all steps"
    Clicking a step highlights it on the grid
    Choose a step and click "Add to solution" (the step is added above "Incomplete" but not executed)
    Go back to "Solution path" and double click "Incomplete solution"
    The sudoku is solved according to the current solver configuration
    Repeat as needed

You can of course add more than one step before solving the rest, but you are responsible for the correct use of the tools. Normally that means that you have to click "Execute" after adding a step and then to click "Find all steps" again to choose the next step. You can add more steps without executing and finding again. The eliminations will all be valid, but the highlighting could be incomplete (candidates already eliminated by the other steps will not be shown).

Work with more than one solution:

Right clicking the tab below the solution path allows you to create new solutions (the active solution will be copied), to rename existing solutions or to delete solutions. Each solution maintains its own state so switching between solutions changes the solving state of the sudoku.

Known bug:

When deleting a solution background colors for steps can become incorrect (will be corrected for release 1.0).

Work around:

Save the sudoku to disk and load it again.
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby hobiwan » Thu Jan 22, 2009 10:07 pm

The project home page is now up:

http://hodoku.sourceforge.net
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby cardinal » Fri Jan 23, 2009 3:05 pm

c'mon, it is nice to have your own solver, (provided that you love enough the game:!: ) because you can do anything with it(you can customize whatever you want:D )

for example, i would like to upload mine on a java machine enabled phone, if such a thing exist:)
cardinal
 
Posts: 9
Joined: 04 October 2008

Postby hobiwan » Sat Jan 24, 2009 12:47 am

cardinal wrote:c'mon, it is nice to have your own solver

Of course it is, thats why I wrote (and still write) one. But sometimes it is also fun to compare...

cardinal wrote:for example, i would like to upload mine on a java machine enabled phone, if such a thing exist:)

Java should be standard on newer cell phones, but you have to code with the Java Micro Edition, not the Java Standard Edition. Changes are necessary mostly for IO (user interface and files - dont really exist).
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby wintder » Sat Jan 24, 2009 6:44 am

Just tried it today. Very, very nice!

As it shipped the not-full screen was too tall and I had trouble getting it re-sized. I'd suggest it be less tall, in the shipping state.

Since that is my only complaint this is an unusually well done release, I do realize.

Edited to add: It does not "remember" last size that wasn't full screen.
This is now a noticeable annoyance, the sub-window being too tall.
wintder
 
Posts: 297
Joined: 24 April 2007

Postby hobiwan » Sun Jan 25, 2009 7:47 am

wintder wrote:Just tried it today. Very, very nice!

Thanks:D

wintder wrote:As it shipped the not-full screen was too tall and I had trouble getting it re-sized...

Sorry, my fault. I like large monitors and I keep forgetting that not everyone does. It should fit a 1024x768 resolution.

Resizing: the upper right corner should be visible in any case, so resizing should be possible. I will try to add a "save last state" feature, but this will probably take me some time.
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby afedon » Thu Jan 29, 2009 11:24 am

This is a really good program

It will be very helpful to train my
team players for the
Venezuelan College Professors National Tournament

Thanks a lot,

Antonio Fedón, PhD
Professor Emeritus
College of Engineering
Universidad de Carabobo
Valencia, Venezuela
afedon
 
Posts: 1
Joined: 08 August 2006

Postby hobiwan » Thu Jan 29, 2009 6:39 pm

HoDoKu v1.0 has been released.

Besides some minor bug fixes it contains a few new features:
    Command line options for batch processing are now fully documented
    Search for puzzles containing certain steps has been enhanced
    Window state is saved at program exit
    Batch processing with Windows exe file now shows a console window
    '0' instead of '.' in clipboard export possible
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby hobiwan » Fri Jan 30, 2009 10:06 pm

afedon wrote:It will be very helpful to train my
team players for the
Venezuelan College Professors National Tournament

Good luck to you all!
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby wintder » Tue Feb 03, 2009 12:59 am

hobiwan wrote:HoDoKu v1.0 has been released.

Besides some minor bug fixes it contains a few new features:
    Command line options for batch processing are now fully documented
    Search for puzzles containing certain steps has been enhanced
    Window state is saved at program exit
    Batch processing with Windows exe file now shows a console window
    '0' instead of '.' in clipboard export possible


Thanks for the updates, I am very much enjoying using this!
wintder
 
Posts: 297
Joined: 24 April 2007

Postby wintder » Fri Feb 06, 2009 12:29 am

In the position below when I look for all solutions this finned/sashimi jellyfish is not listed, although its horizontal match is. Should they not both be listed?

Code: Select all
.---------------.----------------.--------------.
| 29  4789  24  | 4579  68   3   | 26  1    579 |
| 5   3789  23  | 79    68   1   | 26  379  4   |
| 1   3479  6   | 459   579  2   | 8   379  57  |
:---------------+----------------+--------------:
| 6   1     8   | 2     579  579 | 4   59   3   |
| 29  359   235 | 1     4    6   | 79  57   8   |
| 4   59    7   | 3     59   8   | 1   6    2   |
:---------------+----------------+--------------:
| 3   45    9   | 6     2    457 | 57  8    1   |
| 8   6     45  | 579   1    457 | 3   2    79  |
| 7   2     1   | 8     3    59  | 59  4    6   |
'---------------'----------------'--------------'

.---------------.----------------.--------------.
|*29  4789  24  | 4579  68   3   | 26  1    57-9|
| 5   3789  23  | 79    68   1   | 26 #379  4   |
| 1   3479  6   | 459   579  2   | 8  #379  57  |
:---------------+----------------+--------------:
| 6   1     8   | 2     579 #579 | 4  #59   3   |
|*29  359   235 | 1     4    6   |*79  57   8   |
| 4   59    7   | 3     59   8   | 1   6    2   |
:---------------+----------------+--------------:
| 3   45    9   | 6     2    457 | 57  8    1   |
| 8   6     45  | 579   1    457 | 3   2    79  |
| 7   2     1   | 8     3   #59  |*59  4    6   |
'---------------'----------------'--------------'


Thanks!
wintder
 
Posts: 297
Joined: 24 April 2007

Postby hobiwan » Fri Feb 06, 2009 9:22 pm

wintder wrote:In the position below when I look for all solutions this finned/sashimi jellyfish is not listed, although its horizontal match is. Should they not both be listed?


I get:

Code: Select all
.----------------.------------------.-----------------.
| 29   4789  24  |  4579   68   3   | 26   1     57-9 |
| 5   *3789  23  | *79     68   1   | 26  #379   4    |
| 1   *3479  6   | *459   *579  2   | 8   #379   57   |
:----------------+------------------+-----------------:
| 6    1     8   |  2      579  579 | 4    59    3    |
| 29   359   235 |  1      4    6   | 79   57    8    |
| 4   *59    7   |  3     *59   8   | 1    6     2    |
:----------------+------------------+-----------------:
| 3    45    9   |  6      2    457 | 57   8     1    |
| 8    6     45  | *579    1    457 | 3    2    *79   |
| 7    2     1   |  8      3    59  | 59   4     6    |
'----------------'------------------'-----------------'

Finned Jellyfish: 9 r2368 c2459 fr2c8 fr3c8 => r1c9<>9

and
Code: Select all
.----------------.-----------------.-----------------.
| *29  4789  24  | 4579  68    3   |  26   1    57-9 |
|  5   3789  23  | 79    68    1   |  26  #379  4    |
|  1   3479  6   | 459   579   2   |  8   #379  57   |
:----------------+-----------------+-----------------:
|  6   1     8   | 2     579  *579 |  4   *59   3    |
| *29  359   235 | 1     4     6   | *79   57   8    |
|  4   59    7   | 3     59    8   |  1    6    2    |
:----------------+-----------------+-----------------:
|  3   45    9   | 6     2     457 |  57   8    1    |
|  8   6     45  | 579   1     457 |  3    2    79   |
|  7   2     1   | 8     3    *59  | *59   4    6    |
'----------------'-----------------'-----------------'

Sashimi Jellyfish: 9 c1678 r1459 fr2c8 fr3c8 => r1c9<>9

although the second one is buried down amongst the (unnecessary) finned and franken fish that yield the same elimination. Obviously there is something wrong with the sorting, I will look into it.

Thanks for the info!
hobiwan
2012 Supporter
 
Posts: 321
Joined: 16 January 2008
Location: Klagenfurt

Postby wintder » Fri Feb 06, 2009 9:46 pm

Hi again!

In this markup the ER isn't listed as a "possible".

Code: Select all
.--------------.---------------.--------------.
| 7   28   89  | 236   5    4  | 39   1    68 |
| 19  6    3   | 8     7    19 | 4    2    5  |
| 5   128  4   | 1236  136  69 | 7    39   68 |
:--------------+---------------+--------------:
| 2   7    56  | 4     36   58 | 389  369  1  |
| 4   13   156 | 9     2    58 | 38   36   7  |
| 69  38   89  | 136   136  7  | 5    4    2  |
:--------------+---------------+--------------:
| 8   5    2   | 16    4    3  | 16   7    9  |
| 3   9    16  | 7     8    2  | 16   5    4  |
| 16  4    7   | 5     9    16 | 2    8    3  |
'--------------'---------------'--------------'


Code: Select all
.--------------.---------------.--------------.
| 7   28   89  | 236   5    4  | 39   1    68 |
| 19  6    3   | 8     7    19 | 4    2    5  |
| 5   128  4   | 1236  136  69 | 7    39   68 |
:--------------+---------------+--------------:
| 2   7    56  | 4     36   58 | 389  369  1  |
| 4   13   156 | 9     2    58 | 38   36   7  |
|*69  38   89  | 13-6  136  7  | 5    4    2  |
:--------------+---------------+--------------:
| 8   5    2   |#16    4    3  | 16   7    9  |
| 3   9    16  | 7     8    2  | 16   5    4  |
|*16  4    7   | 5     9   #16 | 2    8    3  |
'--------------'---------------'--------------'


Thanks!
wintder
 
Posts: 297
Joined: 24 April 2007

Next

Return to Software