Jigsaw Samurai

For fans of Killer Sudoku, Samurai Sudoku and other variants

Jigsaw Samurai

Postby Hajime » Thu Feb 21, 2019 9:23 am

My first Jigsaw puzzle, a very symmetrical Samurai with 4 SudokuJS(B) and one SudokuX.
There are 2 kinds of Jigsaw: a JS without the nine 3x3 boxes and a JSB with the nine 3x3 boxes.
Both puzzles are moderate because you need methods like naked/hidden pairs/triples and box - line reduction or pointing pairs.
And also jigsaw-region - line reduction :shock:

JS:
Image

JS in code (a JigSaw needs 2 lines per Sudoku):
Code: Select all
#5//B4,JS/N4,JS/H16,X/B28,JS/N28,JS
...46.1...9..37..1........31...9..7.91.6......8.......2...........7......73......
AABBBBBCCDAABBBBCEDAACCCCCEDAFFFCEEEDAAFFFGGEDDDHFFFGEDHHHHHGGEDHIIIIGGEHHIIIIIGG
..1.84...4..35..9.7.........8..9...3.....3.87.......1.........4.....8.........72.
CCBBBBBAAECBBBBAADECCCCCAADEEECFFFADEGGFFFAADEGFFFHDDDEGGHHHHHDEGGIIIIHDGGIIIIIHH
...3.6......4.1................9.................4................1.4......8.9...
.12.........3.....9.........6.......38.7.....8...5..3.........9.5..32..8...94.1..
HHIIIIIGGDHIIIIGGEDHHHHHGGEDDDHFFFGEDAAFFFGGEDAFFFCEEEDAACCCCCEDAABBBBCEAABBBBBCC
......62......2...........4.......3......8.69.6..3...21........5..49..1...8.53...
GGIIIIIHHEGGIIIIHDEGGHHHHHDEGFFFHDDDEGGFFFAADEEECFFFADECCCCCAADECBBBBAADCCBBBBBAA


Bigger picture
https://www.dropbox.com/s/wk9u0csqx2a2e3y/JS_mod.png?dl=0
Bigger picture with pencil marks
https://www.dropbox.com/s/10bngn4sfrlzmzv/JS_mod_PM.png?dl=0

JSB:
Image

JSB in code:
Code: Select all
 
#5//B4,JSB/N4,JSB/H16,X/B28,JSB/N28,JSB
.5.4.....2..9...3...7..59..43...........3...5..5........3.......7...........7....
AABBBBBCCDAABBBBCEDAACCCCCEDAFFFCEEEDAAFFFGGEDDDHFFFGEDHHHHHGGEDHIIIIGGEHHIIIIIGG
.....3.1..8...7..9..62..8.........426...2..........1........7.........2.....5....
CCBBBBBAAECBBBBAADECCCCCAADEEECFFFADEGGFFFAADEGFFFHDDDEGGHHHHHDEGGIIIIHDGGIIIIIHH
...3.6......4.2.....................1.......6.....................2.4......8.9...
....1.....1.........9........6..........3...849.........4..39..9..5...7..6.1.....
HHIIIIIGGDHIIIIGGEDHHHHHGGEDDDHFFFGEDAAFFFGGEDAFFFCEEEDAACCCCCEDAABBBBCEAABBBBBCC
....5...........5.......8........2..2...3...........31..79..4...4...5..8.....4.1.
GGIIIIIHHEGGIIIIHDEGGHHHHHDEGFFFHDDDEGGFFFAADEEECFFFADECCCCCAADECBBBBAADCCBBBBBAA

Bigger picture
https://www.dropbox.com/s/a4wy1lb5ihqcb23/JSB_mod.png?dl=0
Bigger picture with pencil marks
https://www.dropbox.com/s/w5qjralyeoy0ntv/JSB_mod_PM.png?dl=0

Created with SiSeSuSo V7, to be released soon.

Edit2: url's redirected to dropbox
Last edited by Hajime on Wed Jan 27, 2021 1:03 pm, edited 3 times in total.
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Mathimagics » Thu Feb 21, 2019 10:50 am

Hi Hajime!

Those inline-image url's are bad, you need to strip the redirection stuff from the url's. You might be able to see them, but we can't!.

  • https://sites.google.com/site/sisesuso/examples/jigsaw/JS_mod_300.png?attredirects=0
should be
  • https://sites.google.com/site/sisesuso/examples/jigsaw/JS_mod_300.png
Eg:
Image: Show
Image


Quote this post and you will see what I mean.

Nice job, in any case! Except those diagonals are back!! 8-)
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Hajime » Thu Feb 21, 2019 11:13 am

Mathimagics wrote:Those inline-image url's are bad

Indeed I don't see any difference. So I stripped the redirection. Thanks.
Mathimagics wrote:... Except those diagonals are back!! 8-)

I was in doubt to use the diagonal lines again or use thick cell borders.
Use of interior cell colors would interfere with the jigsaw piece colors.
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Mathimagics » Thu Feb 21, 2019 11:36 am

That worked, they are visible now! 8-)

The diagonal lines will have to do, I can see that.

Diagonals pose particular problems for purely pastel pictorial puzzle portrayal … ;)

Perhaps a more subtle reminder would suffice. Just grey-shade the 5 cells in the middle box of the middle grid. That's enough of a reminder, methinks ...
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Mathimagics » Thu Feb 21, 2019 6:06 pm

How I might render your second puzzle (JSB) in a printer-friendly form. I've used the idea suggested above for indicating diagonals just using the central box.

Puzzle image: Show
SamuraiJB-001.png
SamuraiJB-001.png (33.23 KiB) Viewed 1749 times
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Hajime » Fri Feb 22, 2019 8:38 am

Nice job !
Like the Germans say: "In der Beschränkung zeigt sich der Meister"
Using only 1 shade of grey (or 2)
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Mathimagics » Fri Feb 22, 2019 9:51 am

Hajime wrote:In der Beschränkung zeigt sich der Meister

Thank you. That's an elegant phrase, but it is too kind by half! :oops:


I will soon be able to verify your puzzles, which will be useful, I think … all the tools and components are at hand, just a matter of hammering them all together … :?
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Mathimagics » Sat Feb 23, 2019 8:00 am

.
Hello Hajime!

You say on your webpage that your solver "does not solve [ some ] complicated Sudoku's". But it does have a "Backtracking" capability.

Can I deduce from this that your multi-grid solver process looks at individual 9x9 grid's, partially solving each in turn, getting feedback of eliminations/solved cells via the overlapped corners, and repeating this until all grids are solved (Cigar! 8-) ) or there is no more feedback available (No cigar! :cry: ) ?

Thus, while a backtracking capability means you can notionally solve any individual 9x9 puzzle, this is not so for sets of overlapped puzzles.

Assuming that all this is true, then your JBS example above provides an excellent demonstration of this, since my initial version of a Samurai solver uses the same method. But where your solver has a generous set of ST's (Solving Techniques), mine does not (singles only). Your solver solves the puzzle, mine does not. Simple as that.

There are two ways for me to progress, both require new solver constructions:

  • implement more ST's. This may seem obvious, but it really means I have to build a separate solver. My common-use solver is based on [b]dobrichev[b]'s fsss2, and gets amazing speed for 9x9 puzzles by using a highly optimised singles-only model. Any attempt to introduce other ST's is like jerking on the hand-brake, it costs more to identify the additional eliminations than to ignore them, a lot more! This might not be a real issue here, since we are typically not trying to solve minimal puzzles. At least, not right now!
  • Since I have no desire to support generalised gattai arrangements, only 5-grid Samurai, another approach would be to use a holistic solver model, one that treats the puzzle as a single grid, with 5 overlapping sub-grids. The complete puzzle is a 21 x 21 grid, and this is quite manageable. But this would not be feasible for any more exotic gattai layout, eg "Clueless Explosion" would perhaps require something like a Cray!

Perhaps I will pursue both of these options … but for now the easier one is the 2nd option … we can make a DLX solver that can deal with the Samurai (even in mixed variant mode), and that would be, in theory, at least, a universal solver …


Oh, yes, and consequently:
mathimagics wrote:I will soon be able to verify your puzzles, which will be useful, I think …

Wrong, again … but perhaps in a day or two!
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Hajime » Sat Feb 23, 2019 5:47 pm

Mathimagics, all your assumptions are true. So that sigar is mine, although I don't smoke. The solver tries to find a solution with all checked (checkboxes) methods, including backtrack as a last resort. Even Ruud's Daddy of all Gattai. No problem, it takes only an 5 minutes or so. I still implement more methods to avoid backtrack. Also more types like jigsaw (next week) and 'greater than' may take some months.
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Mathimagics » Sat Feb 23, 2019 7:15 pm

Thanks Hajime!

Some miscellaneous observations:

  • The cigars are strictly metaphorical. I actually do smoke, but I cannot abide the smell of cigar smoke! Yecch. The "cigar" reference is actually a nod to the legendary American comedian WC Fields:
    WC Fields wrote:I never smoked a cigar in my life until I was 9

    I fell into the habit long ago, of reporting test results not as "Success" or "Failure", but rather as "Cigar!" and (more often) "No cigar!"
  • Another favourite of mine is "Hello Eric!". This is used to indicate that some debug/test code has reached a particular point. This reference is also quite obscure, and anyone who can figure out its origins will also be awarded a virtual cigar, and my undying admiration!
  • Speaking of admiration, one can only admire your ambitions for the Great Gattai Solver/Generator. Futoshiki clues? Classy! Give the man a cigar. (PS: I think Futoshiki, or "Inequality" are better terms than "Greater than")
  • do those expected times of weeks/months refer to "time to implement" or "time to solve"? 8-)

Meanwhile, keep up the good work (in pastels!) 8-)
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Mathimagics » Sun Feb 24, 2019 6:01 pm

.
Ok, "option 2", the "Holistic DLX Samurai Solver" (HDSS) is up and running!

I can now confirm that Hajime's JSB puzzle above has a unique solution. Hopefully he will confirm that it is indeed correct:

JSB solution: Show
Code: Select all
  9 5 6 4 2 3 8 1 7       7 5 2 9 8 3 4 1 6
  2 8 4 9 1 7 5 3 6       4 8 1 5 6 7 2 3 9
  3 1 7 6 8 5 9 4 2       3 9 6 2 4 1 8 5 7
  4 3 8 5 6 2 1 7 9       1 7 8 3 9 6 5 4 2
  1 6 2 7 3 9 4 8 5       6 4 5 1 2 8 9 7 3
  7 9 5 8 4 1 2 6 3       9 2 3 4 7 5 1 6 8
  8 2 3 1 9 6 7 5 4 3 8 6 2 1 9 6 3 4 7 8 5
  6 7 1 2 5 4 3 9 8 4 1 2 5 6 7 8 1 9 3 2 4
  5 4 9 3 7 8 6 2 1 9 5 7 8 3 4 7 5 2 6 9 1
              8 7 5 6 9 1 3 4 2           
              1 4 3 7 2 8 9 5 6           
              9 6 2 5 4 3 1 7 8           
  6 4 3 9 1 5 2 8 7 1 6 5 4 9 3 6 5 8 1 2 7
  2 1 7 4 6 8 5 3 9 2 7 4 6 8 1 2 4 7 9 5 3
  8 5 9 3 7 2 4 1 6 8 3 9 7 2 5 3 1 9 8 4 6
  7 3 6 8 5 9 1 2 4       1 3 8 5 9 6 2 7 4
  1 2 5 7 3 4 6 9 8       2 7 6 4 3 1 5 8 9
  4 9 8 6 2 1 7 5 3       9 5 4 8 7 2 6 3 1
  5 7 4 2 8 3 9 6 1       8 1 7 9 2 3 4 6 5
  9 8 1 5 4 6 3 7 2       3 4 2 1 6 5 7 9 8
  3 6 2 1 9 7 8 4 5       5 6 9 7 8 4 3 1 2
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Hajime » Mon Feb 25, 2019 10:34 am

Mathimagics wrote:.
Hopefully he will confirm that it is indeed correct:

JSB solution: Show
Code: Select all
  9 5 6 4 2 3 8 1 7       7 5 2 9 8 3 4 1 6
  2 8 4 9 1 7 5 3 6       4 8 1 5 6 7 2 3 9
  3 1 7 6 8 5 9 4 2       3 9 6 2 4 1 8 5 7
  4 3 8 5 6 2 1 7 9       1 7 8 3 9 6 5 4 2
  1 6 2 7 3 9 4 8 5       6 4 5 1 2 8 9 7 3
  7 9 5 8 4 1 2 6 3       9 2 3 4 7 5 1 6 8
  8 2 3 1 9 6 7 5 4 3 8 6 2 1 9 6 3 4 7 8 5
  6 7 1 2 5 4 3 9 8 4 1 2 5 6 7 8 1 9 3 2 4
  5 4 9 3 7 8 6 2 1 9 5 7 8 3 4 7 5 2 6 9 1
              8 7 5 6 9 1 3 4 2           
              1 4 3 7 2 8 9 5 6           
              9 6 2 5 4 3 1 7 8           
  6 4 3 9 1 5 2 8 7 1 6 5 4 9 3 6 5 8 1 2 7
  2 1 7 4 6 8 5 3 9 2 7 4 6 8 1 2 4 7 9 5 3
  8 5 9 3 7 2 4 1 6 8 3 9 7 2 5 3 1 9 8 4 6
  7 3 6 8 5 9 1 2 4       1 3 8 5 9 6 2 7 4
  1 2 5 7 3 4 6 9 8       2 7 6 4 3 1 5 8 9
  4 9 8 6 2 1 7 5 3       9 5 4 8 7 2 6 3 1
  5 7 4 2 8 3 9 6 1       8 1 7 9 2 3 4 6 5
  9 8 1 5 4 6 3 7 2       3 4 2 1 6 5 7 9 8
  3 6 2 1 9 7 8 4 5       5 6 9 7 8 4 3 1 2

This is indeed the right solution.
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Hajime » Mon Feb 25, 2019 10:49 am

Mathimagics wrote:How I might render your second puzzle (JSB) in a printer-friendly form. I've used the idea suggested above for indicating diagonals just using the central box.


I try to create (program) the puzzle layout as you suggested in my solver and the cell, box or jigsaw-piece per Sudoku is going well.
But the border-outside of a whole Sudoku give me some troubles:
The middle SudokuX has outside borders but not if this border is inside another Sudoku.
Also not painting the X diagonals when these cells are in another Sudoku is annoying.
Working, working....
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Re: Jigsaw Samurai

Postby Mathimagics » Mon Feb 25, 2019 11:43 am

.
I actually changed my rendering to shade the complete diagonals.

ScreenShot: Show
SamGen-002.png
SamGen-002.png (161.64 KiB) Viewed 1676 times


My "PaintGrid" function renders only one puzzle at a time, ie I call it 5 times, and it just uses different (top, left) margin settings to paint the grid in the right place.

It draws a border round each one, so to paint the 5 puzzles, I paint the central puzzle (Grid #3) first, then the corner puszzles (#1, #2, #4, #5). If these corner grids are Jigsaw's then the unwanted border simply disappears! Problem solved ...

PaintGrid now shades diagonal cells whenever the puzzle being drawn is itself X-mode, OR the cell is an overlapped cell, and the overlapped puzzle (Grid #3) is X-mode.

This rendering system works fine for VB6, and should work in VBA, assuming the PictureBox Control is the same for both.
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: Jigsaw Samurai

Postby Hajime » Mon Feb 25, 2019 1:21 pm

Hidden Text: Show
Image

Yes, the order of enumerating Sudoku's did the trick.
In V7 you will be able to pick any color you like 8-)
In the above example:
3x3 boxes have no border and interior in grey
SudokuX has no borders and purple cells
jigsaw pieces have no interior color and borders around
User avatar
Hajime
 
Posts: 1385
Joined: 20 April 2018
Location: Fryslân

Next

Return to Sudoku variants

cron