SudokuSolver Forum

A forum for Sudoku enthusiasts to share puzzles, techniques and software
It is currently Sat Apr 27, 2024 6:13 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: JC Samurai #1
PostPosted: Sun Jun 01, 2008 4:35 pm 
Offline
Expert
Expert

Joined: Sun Apr 27, 2008 10:44 am
Posts: 102
Location: Belgium
I started to embed logical techniques into the generator in JSudoku.
Not yet fully implemented, but here are the very first results. Comments & suggestions are welcome.

Hard (requires X-Wing, but no harder technique)
Image
Code:
5137...........7.5.6.5....2....3.86.2.7..6.......9..7.4....2........9.....5......
..8..1...7...38.........41..9..2...42.6.....9.3.68..........9.....293.........86.
...6........9........3.........2..14..2...5..16..9.........9........4........5...
.23.........837.....9..........49.5.9.....3.71...6..2..34.........41...9...2..8..
......7.....4........7....5.8..3.......8..9.4.31.6....8....9.5.3.2...........1248

Solution:
+-------+-------+-------+-------+-------+-------+-------+
| 5 1 3 | 7 2 8 | 4 9 6 | | 4 2 8 | 5 6 1 | 3 9 7 |
| 8 4 2 | 9 6 1 | 7 3 5 | | 7 1 9 | 4 3 8 | 2 5 6 |
| 7 6 9 | 5 4 3 | 1 8 2 | | 6 5 3 | 9 7 2 | 4 1 8 |
+-------+-------+-------+-------+-------+-------+-------+
| 1 5 4 | 2 3 7 | 8 6 9 | | 1 9 7 | 3 2 5 | 6 8 4 |
| 2 9 7 | 8 1 6 | 5 4 3 | | 2 8 6 | 7 1 4 | 5 3 9 |
| 3 8 6 | 4 9 5 | 2 7 1 | | 5 3 4 | 6 8 9 | 1 7 2 |
+-------+-------+-------+-------+-------+-------+-------+
| 4 3 1 | 6 7 2 | 9 5 8 | 6 4 2 | 3 7 1 | 8 4 6 | 9 2 5 |
| 6 7 8 | 1 5 9 | 3 2 4 | 9 7 1 | 8 6 5 | 2 9 3 | 7 4 1 |
| 9 2 5 | 3 8 4 | 6 1 7 | 3 5 8 | 9 4 2 | 1 5 7 | 8 6 3 |
+-------+-------+-------+-------+-------+-------+-------+
| | | 8 3 9 | 5 2 7 | 6 1 4 | | |
| | | 7 4 2 | 1 8 6 | 5 3 9 | | |
| | | 1 6 5 | 4 9 3 | 2 8 7 | | |
+-------+-------+-------+-------+-------+-------+-------+
| 7 2 3 | 1 9 4 | 5 8 6 | 7 1 9 | 4 2 3 | 1 5 6 | 7 8 9 |
| 4 5 6 | 8 3 7 | 2 9 1 | 8 3 4 | 7 5 6 | 4 9 8 | 3 2 1 |
| 8 1 9 | 6 5 2 | 4 7 3 | 2 6 5 | 1 9 8 | 7 2 3 | 4 6 5 |
+-------+-------+-------+-------+-------+-------+-------+
| 3 6 2 | 7 4 9 | 1 5 8 | | 2 8 4 | 9 3 7 | 5 1 6 |
| 9 4 8 | 5 2 1 | 3 6 7 | | 6 7 5 | 8 1 2 | 9 3 4 |
| 1 7 5 | 3 6 8 | 9 2 4 | | 9 3 1 | 5 6 4 | 8 7 2 |
+-------+-------+-------+-------+-------+-------+-------+
| 5 3 4 | 9 8 6 | 7 1 2 | | 8 1 7 | 2 4 9 | 6 5 3 |
| 2 8 7 | 4 1 5 | 6 3 9 | | 3 4 2 | 6 8 5 | 1 9 7 |
| 6 9 1 | 2 7 3 | 8 4 5 | | 5 6 9 | 3 7 1 | 2 4 8 |
+-------+-------+-------+-------+-------+-------+-------+


Very easy (solves with hidden singles only, several possible singles at each step)
The idea is: it could be solved without pencil marks.
Image
Code:
.97..1........7.835....9.2...67..5.2..2.6..4.....8.1.773........5.1.8...6..3.....
...6..38.68.5......4.8....75.3..61...1..3.6..8.2.5...........96...7.8.3......9..2
.....................2.3....21...87....8.9....83...49....1.6.....................
6..4......2.1.7...78...........4.6.5..9.6..4...65..9.11....5.7......4.93.47..9...
.....6..5...2.8.6........147.3.8.....2..9.5..8.4..39...6.9....727.5........8..25.

Solution:
+-------+-------+-------+-------+-------+-------+-------+
| 8 9 7 | 2 3 1 | 6 5 4 | | 2 9 1 | 6 7 4 | 3 8 5 |
| 2 1 4 | 6 5 7 | 9 8 3 | | 6 8 7 | 5 9 3 | 2 1 4 |
| 5 6 3 | 8 4 9 | 7 2 1 | | 3 4 5 | 8 1 2 | 9 6 7 |
+-------+-------+-------+-------+-------+-------+-------+
| 9 8 6 | 7 1 4 | 5 3 2 | | 5 7 3 | 4 8 6 | 1 2 9 |
| 1 7 2 | 5 6 3 | 8 4 9 | | 4 1 9 | 2 3 7 | 6 5 8 |
| 3 4 5 | 9 8 2 | 1 6 7 | | 8 6 2 | 9 5 1 | 7 4 3 |
+-------+-------+-------+-------+-------+-------+-------+
| 7 3 8 | 4 9 6 | 2 1 5 | 9 6 4 | 7 3 8 | 1 2 5 | 4 9 6 |
| 4 5 9 | 1 2 8 | 3 7 6 | 5 1 8 | 9 2 4 | 7 6 8 | 5 3 1 |
| 6 2 1 | 3 7 5 | 4 9 8 | 2 7 3 | 1 5 6 | 3 4 9 | 8 7 2 |
+-------+-------+-------+-------+-------+-------+-------+
| | | 9 2 1 | 6 4 5 | 8 7 3 | | |
| | | 5 4 7 | 8 3 9 | 2 6 1 | | |
| | | 6 8 3 | 7 2 1 | 4 9 5 | | |
+-------+-------+-------+-------+-------+-------+-------+
| 6 1 3 | 4 9 8 | 7 5 2 | 1 8 6 | 3 4 9 | 7 1 6 | 8 2 5 |
| 9 2 5 | 1 3 7 | 8 6 4 | 3 9 2 | 5 1 7 | 2 4 8 | 3 6 9 |
| 7 8 4 | 2 5 6 | 1 3 9 | 4 5 7 | 6 8 2 | 3 5 9 | 7 1 4 |
+-------+-------+-------+-------+-------+-------+-------+
| 8 7 1 | 9 4 3 | 6 2 5 | | 7 9 3 | 1 8 5 | 6 4 2 |
| 2 5 9 | 8 6 1 | 3 4 7 | | 1 2 6 | 4 9 7 | 5 3 8 |
| 4 3 6 | 5 7 2 | 9 8 1 | | 8 5 4 | 6 2 3 | 9 7 1 |
+-------+-------+-------+-------+-------+-------+-------+
| 1 9 2 | 3 8 5 | 4 7 6 | | 4 6 5 | 9 3 2 | 1 8 7 |
| 5 6 8 | 7 1 4 | 2 9 3 | | 2 7 8 | 5 6 1 | 4 9 3 |
| 3 4 7 | 6 2 9 | 5 1 8 | | 9 3 1 | 8 7 4 | 2 5 6 |
+-------+-------+-------+-------+-------+-------+-------+

_________________
Jean-Christophe
"When you have eliminated the impossible, whatever remains, however improbable, must be the truth." Sherlock Holmes.


Top
 Profile  
Reply with quote  
 Post subject: Re: JC Samurai #1
PostPosted: Sun Jun 01, 2008 7:22 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Mon Apr 21, 2008 10:32 am
Posts: 868
Excellent work Jean-Christophe ;clapclap; :dance:

Hopefully I will soon get some relief from making and posting 3-12 puzzles per week.

Børge wrote:
I am working on an algorithm for generating valid code (9 givens) for all overlapping nonets. With valid code I mean code so it is possible to generate a legal Sudoku for all grids.
I have programmed the bare skeleton for the recursive walker and backtracker, but still need to put on some flesh.

The basic algorithm is:
  1. Sequentially do a grid at the time and generate valid code for all overlapping nonets, i.e. generate a random solution for the complete grid including existing givens in one or more overlapping nonets and then remove the code in all cells except those in overlapping nonets.
  2. If I have to redo the code for a nonet already having code, I signal all the grids having this nonet as a member and if necessary redo the code for theese grids (backtracking).
  3. After an overlapping nonet has been visited by its second member grid, the code in that nonet is locked, i.e. not more changeable.
This algorithm is not quite correct, but I have figured out a similar one that so far seems to work. I have generated a ROAG, several DOAG and a bunch of other puzzles with overlapping nonets. It is not as fast as I had hoped. A Samurai is virtually instantaneous, but a DOAG (144 overlapping grids) takes 30-60 seconds for generating valid code (9 givens) for all 144 overlapping nonets.

_________________
Quis custodiet ipsos custodes?
Normal: [D  Y-m-d,  G:i]     PM->email: [D, d M Y H:i:s]


Top
 Profile  
Reply with quote  
 Post subject: Re: JC Samurai #1
PostPosted: Sun Jun 01, 2008 8:09 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
Thank you, Jean-Christophe! I'm looking forward to trying these.

I'm curious, though--X-Wing is considered hard?


Top
 Profile  
Reply with quote  
 Post subject: Re: JC Samurai #1
PostPosted: Fri Jun 13, 2008 7:50 pm 
Offline
Expert
Expert

Joined: Sun Apr 27, 2008 10:44 am
Posts: 102
Location: Belgium
Here is another Samurai. Can be solved with a Skyscraper and Remote Pairs.

Attachment:
Samurai2.png
Samurai2.png [ 21.53 KiB | Viewed 9647 times ]

Code:
..7.1...3....65...8.3...6.1.6.2.....13.9...........539.....2...542..........36...
4...1.8.....45....8.6...3.4.....2.6......1.37291.........1...........186...97....
...8.3......................32...96....6.9.....9...4......9.......1.7............
3..9......5.......6.4..8....3....64..2......8....69...4...9..3...8.4...9....76.8.
.....8..1.......7....7..3.5.12....9.4......1....41.....4..7...69...5.7...3.92....


Solution:
+-------+-------+-------+-------+-------+-------+-------+
| 6 9 7 | 4 1 8 | 2 5 3 | | 4 5 2 | 6 1 3 | 8 7 9 |
| 4 2 1 | 3 6 5 | 7 9 8 | | 9 3 7 | 4 5 8 | 6 1 2 |
| 8 5 3 | 7 2 9 | 6 4 1 | | 8 1 6 | 7 2 9 | 3 5 4 |
+-------+-------+-------+-------+-------+-------+-------+
| 9 6 8 | 2 5 3 | 1 7 4 | | 3 7 8 | 5 4 2 | 9 6 1 |
| 1 3 5 | 9 7 4 | 8 6 2 | | 5 6 4 | 8 9 1 | 2 3 7 |
| 2 7 4 | 6 8 1 | 5 3 9 | | 2 9 1 | 3 6 7 | 5 4 8 |
+-------+-------+-------+-------+-------+-------+-------+
| 3 8 6 | 5 4 2 | 9 1 7 | 8 4 3 | 6 2 5 | 1 8 4 | 7 9 3 |
| 5 4 2 | 1 9 7 | 3 8 6 | 5 2 1 | 7 4 9 | 2 3 5 | 1 8 6 |
| 7 1 9 | 8 3 6 | 4 2 5 | 9 7 6 | 1 8 3 | 9 7 6 | 4 2 5 |
+-------+-------+-------+-------+-------+-------+-------+
| | | 1 3 2 | 7 5 4 | 9 6 8 | | |
| | | 7 4 8 | 6 1 9 | 5 3 2 | | |
| | | 6 5 9 | 3 8 2 | 4 1 7 | | |
+-------+-------+-------+-------+-------+-------+-------+
| 3 8 7 | 9 2 4 | 5 6 1 | 2 9 8 | 3 7 4 | 5 9 8 | 2 6 1 |
| 2 5 1 | 6 3 7 | 8 9 4 | 1 3 7 | 2 5 6 | 3 4 1 | 8 7 9 |
| 6 9 4 | 1 5 8 | 2 7 3 | 4 6 5 | 8 9 1 | 7 6 2 | 3 4 5 |
+-------+-------+-------+-------+-------+-------+-------+
| 1 3 9 | 5 8 2 | 6 4 7 | | 5 1 2 | 6 8 7 | 4 9 3 |
| 7 2 6 | 4 1 3 | 9 5 8 | | 4 8 9 | 2 3 5 | 6 1 7 |
| 8 4 5 | 7 6 9 | 3 1 2 | | 7 6 3 | 4 1 9 | 5 8 2 |
+-------+-------+-------+-------+-------+-------+-------+
| 4 7 2 | 8 9 5 | 1 3 6 | | 1 4 5 | 8 7 3 | 9 2 6 |
| 5 6 8 | 3 4 1 | 7 2 9 | | 9 2 8 | 1 5 6 | 7 3 4 |
| 9 1 3 | 2 7 6 | 4 8 5 | | 6 3 7 | 9 2 4 | 1 5 8 |
+-------+-------+-------+-------+-------+-------+-------+

_________________
Jean-Christophe
"When you have eliminated the impossible, whatever remains, however improbable, must be the truth." Sherlock Holmes.


Top
 Profile  
Reply with quote  
 Post subject: Re: JC Samurai #1
PostPosted: Fri Sep 05, 2008 7:18 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Apr 24, 2008 4:27 pm
Posts: 791
I finally completed the second one you posted above. Actual solving time wasn't all that much, but calendar time was enormous! I'll have to give the other two a try, as well, but I'm eager to try out tarek's Bank Holiday Kazaguruma set, also.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 33 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group