LatinExplainer - to solve and rate 9x9 latin squares

Programs which generate, solve, and analyze Sudoku puzzles

LatinExplainer - to solve and rate 9x9 latin squares

Postby 1to9only » Wed Nov 20, 2019 10:08 am

LatinExplainer is my modifications to SudokuExplainer to solve 9x9 latin squares.
LE is SE without the 3x3 block constraint, the numbers 1-9 must appear exactly once in each row and column.
LatinExplainer can be downloaded from here.
Usage is same as for SE.
.
User avatar
1to9only
 
Posts: 4175
Joined: 04 April 2018

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby 1to9only » Wed Nov 20, 2019 10:11 am

Here are some 9x9 latin squares generated by LE:
Hidden Text: Show
Code: Select all
.8....5.4...7....814..32...2.6.54......6.79.....4.9.2639.....1...3.1..6.6.5....8. ED=9.4/1.5/1.5
3....5....9.1..7..82.....76...9..5.45...6.4...7...231...6.83.....5.4..914......29 ED=9.3/9.2/9.0
8..5..6..9...34..1..38..5..3.9....8..9...742...7.86..4....2..56..1.72.4..3.1..7.. ED=9.2/9.2/9.2
.86...5...91..4.25.1..4.......7...93..2...3.67..8.1...97...2.8.4...87.1.5..2..4.. ED=9.2/9.2/9.0
...6..89...7..1....4...6..97..3..94..7..8.1.342.....769....436...5.7...8.82...... ED=9.2/2.3/2.3
4...8...6.5694......73...9..9......1618..5..93...2.7.....6.1..58..1.32.......48.. ED=9.1/9.1/9.0
....24.......6.3.8.8......23.51.7.....3...61..9.64.87.5..3.....75.98......7..3.9. ED=9.1/1.5/1.5
6.7..4.1...8..9.5.9...286...4.7.23...6.2..8.....38.1.451..4...9..5.3......6.....7 ED=9.0/9.0/9.0
3.4...9.8...731.5...6..3...47.5..32.......51..972.....6.8.5...4....6.8.9....17... ED=9.0/9.0/6.6
..4163.5..9.7....6342.......1.27....4.8..2..95....8......4..81.8...35.6...5.2.... ED=9.0/2.3/2.3
....8.2...8.6.5....4623.7..92......1..43.6.2....7...38....6734.1.7....5.459.2.... ED=8.9/8.9/8.9
4......68..9.42.....2.3.....9....3..57...4.....12.9...735...8..8...1..57...7..584 ED=8.9/8.9/3.6
...8.7.2..783...94..3.1.4.6..6.5.1...2...8.3..5..63...9.1.....5......5.3....89... ED=8.9/2.0/2.0
1..6...48359.....17......24.3...78.6..3.16..984.52....9..1...3.....7.28..78.49... ED=8.8/8.8/8.8
.4123........7..9...2.183..5....16..8..92...5..9..6.78........7.1.5.3....3.6925.. ED=8.8/8.8/7.2
5....9.....94..7..7...61.5....526.....61.4.3..4...5....7..3.8..38......949....2.8 ED=8.8/1.5/1.5
.5..6...8.....16.2....13.2.6..78.4...61.35.....5....934..5.....74...9.5..7.3...14 ED=8.7/1.5/1.5
61...3.4..4....8..2...9.1.6...3..41....5.4..9.5.23....72...56..1.9....724.8..2..3 ED=8.6/8.6/7.2
...9....7...84.7.386...1.5...2135.....9...634....8.3...31.6....9....21.....5.8.9. ED=8.6/1.5/1.5
5..248.7.41......6..3...49...5..62.8...39.5.2.7.....1...65.73..9..6.3.25.....2... ED=8.5/8.5/8.5
6..91....4..52.1....3.4....5..8.62....72.4.5..89..7...........4..5.68.39.1.4...73 ED=8.5/8.5/8.3
2...6.5....467...3.3...1...1....6..9.497....6.63...9.....21....5.8.2..1....3...84 ED=8.5/1.5/1.5
.4..3.6......1456.9......47..91....88..2.673...57..1...2...8..923.........762..51 ED=8.4/8.4/8.4
.6....92..19...73...8...6.4...54...2...852..9....64.....23....1.761...9.39....1.. ED=8.4/8.4/3.0
....146.773.2..8...23.9...........3..5.7....8..5....4.1....8..4.96..57..4.23...9. ED=8.4/1.5/1.5
4..216..83.1.9.....6.5..9..87.4..........8.21..61.2..7....7.483.32...795.....5.4. ED=8.3/8.3/8.3
....278....97...84......1.23.78..4..4.........6.29.5..183....4..2...5613...3.6..7 ED=8.3/8.3/7.3
.56...2.192....8..28..95...3.1....7....45.3...7...8..2....6.5....71...9....6..43. ED=8.3/1.5/1.5
6........7853.4.....6..8..7..9.4.2..872.....3.9...6..2324.9.....4.5.718..3.86.5.. ED=7.6/1.5/1.5
28.45.....9.......1..7893...5.8...62....6...4.4..3..78..95.32....21..7...31...9.. ED=7.5/2.0/2.0
.58...7.1.7..43.2.48....9.52....1.....4.6.8..9..3...641...72.38...........61.95.2 ED=7.4/7.4/3.0
........1.6...973..984......84....2.1.287.....7.15.4.8...9..3.46.....5..7..582... ED=7.4/1.5/1.5
..4...7..3...72..1.2.735.........5765..981....3....24.2.9.....8..1549...743.56... ED=7.3/7.3/7.3
..7......1..8.5.....6.97...71.5....8841...9......6.425......3.2.3.24..6...9..41.3 ED=7.3/7.3/6.6
.6..15..3...1..24.....495.7..72...8.8.1..7..4.3....6.5...9....6.....69.....89..1. ED=7.3/2.3/2.3
7.....234.19.3.4.....8.1.......2.....685...2..76.18...4..7..1.35..9.6.7....3....2 ED=7.2/7.2/7.2
527..3.96..3....79......165.9...2...7.5....3.8..5....4...6.92..4.13......8....6.2 ED=7.2/7.2/7.1
.......1.1.....74..5.946....61..3....3......5.86.25...9..1..2.7.2.65..84......39. ED=7.2/1.5/1.5
.24...8.19.17..4...62..1..4....1.5.6.4....6.95.....23.....5..9..53..41..8..3.6... ED=7.1/7.1/7.1
.....81.4..1.....86..1.......4......7..5298.....2.69..92..7...51..967.5.29.635... ED=7.1/7.1/3.8
.6..9....9.23.47...7....516...85..2.7.8..2...8....34.....1....5.....8...65.....41 ED=7.1/1.5/1.5
....4.25.5.79.28.....3....1....5896........4.8.26....7.3.1.6..9.74..5....1..9..3. ED=7.0/2.3/2.3
...8.92....4.3...9...56...2.371.....9.3..1.685..6...4.....4.87546..2.98...8..7.1. ED=6.9/6.9/6.9
....3...16..1..95.9....51....4..8...38.4.2.6..2.6..74.2...5..79.38.....4.4..9.... ED=6.9/1.5/1.5
.41.9...8....4.2.36..71.4...9.8..5..2..5...6.5....6...7.9..3...8.3....5..3..8...4 ED=6.8/1.5/1.5
7.2.5....4...6.81..5.3..7.8...5....1....42.5..81....6.1..69..24..37.92..6.41....9 ED=6.7/6.7/3.0
..75.......9....5.43.6.......2..91......8..92..5.4..891..73.4...1...32....48..6.5 ED=6.7/1.5/1.5
.9....41...2.1....3.....5.61..6..73...6..7.21.8...9...6..3...727....485..49.7.... ED=6.6/6.6/6.6
....568.25...8...43.....7.8.4.6.9.....926....1....857..72...35..16....4.....15.3. ED=6.6/6.6/3.2
.....23.59......86.5.....9.8....146....9...52..7.....81.8.43....2.5.4....7.35.1.. ED=6.6/1.5/1.5
981.3...7.6.38.4...7...6.3..5...9.1.5.9.4....734.5..284.8......8.....7.6.23...... ED=6.0/1.5/1.5
...4...5..6.....79..73.5.8..9.5.87..451..6...63.7.......2..4...91..6.8..185...6.. ED=5.9/1.5/1.5
.3.6.8..75..81.......9..8..6.3..5.1..67.....8...74..93.21.56.4.3...216........... ED=5.8/1.5/1.5
.3169.........491...8....6.......7..4..725..35..21.4..6..3.8....768.2....1.....59 ED=5.7/1.5/1.5
........1...8..63.6..43.2...91....271.85..7.92....6.4..7.9.8.......298...5...7..8 ED=5.6/2.0/2.0
1....3...5...963..6947...2...54...6..461....2.....97.1..3.6..5..179..2.....6...7. ED=5.2/1.5/1.5
..96.....95...3.1.1...2.6..4.....85..78....45.15..2..6.8.5.67.93....14....7....9. ED=5.0/1.5/1.5
59....36....1.7.9.....5....7..9.54..8.3...5..9....4.82.342....6.476.3....76.91... ED=4.8/1.5/1.5
..9..4...1.6....8784..71........892.4...5.3.....52...6..526...32..3.6....18..9.5. ED=4.7/1.5/1.5
5..7..92.9.86...5......9.17..3.5.....54..1.6.4865........16...339..8.2......72... ED=4.6/2.3/2.3
.......1.7698....2.8.7.....8432.9....94..73.....14..58.37..........1.4.5....8.2.6 ED=4.5/1.5/1.5
.....4.18.9..572.....56.7.13.4..8.5...81...3.637..........21..58.67....2.....5... ED=4.0/1.5/1.5
......1...5..4....6.3..5.8.4...1...28..926....78.5.6...42..975...6..247.2..8.3..1 ED=3.8/3.8/3.8
...5.3..8..43..2.....6..91486.....7.28...5.6.91..3..82.2..19...5...47.....61...2. ED=3.8/3.8/3.0
....34.1..365....2...7.86.95..4..98.2........36......5..1.89.4...9...46..7.2.3... ED=3.8/3.4/3.4
.68.....1.....9245...472.5.48....7.69....31..5...4..97....3....79.6..3.48.576.... ED=3.6/3.6/3.6
....8.5.1..76.2.45.8..51....9.815.6..6.1..2.394.....38...7..6..6...7..9.2.9...... ED=3.6/3.6/3.0
..7.4...8.4.2....6..3..9..7..97.51..1...53.6.3...615.......69.3.1........28....4. ED=3.6/1.5/1.5
.934..7.....1...38.....7.464..9.....5......276...9...2...6.841.....821..716...5.4 ED=3.4/3.4/3.4
2.173...63.4.7.........6..94.....32.5..6.37......8291....9.5.....8.2..35.6..4.17. ED=3.4/3.4/3.0
.75......9.2.847...3........437...2.....9..5...72..13.5..6.9...6..8....3....68.49 ED=3.4/1.5/1.5
5..3.4..9.2.1..8....8...2....3...6..3..9.8..77...5.....6..2..74..9.4..154....756. ED=3.2/3.2/3.2
...8169.5......7..8..........156...49...37.2.124.........973.46...4...977.8..42.3 ED=3.2/3.2/3.0
91...47.........8...6.42..77.....4.3..85...9..3..5..14.9...72...5.1.8...2.4...6.. ED=3.2/2.3/2.3
....8.91.......6574...9..6.83..1....3.8..7...18....5...51...3.2...6.4..9.75.36.4. ED=3.0/3.0/3.0
.14..7...23..9...65..3......79...41.....2...9..7........1.582....2....758..23.54. ED=3.0/1.5/1.5
2....51..178...59..47.1...83..6......19..738.....68.2..25....7..94..2..7....8..4. ED=2.5/2.5/2.5
2....4..67.9........5....82...78.31..2.365...16..42..5..8....5..1.......94...61.. ED=2.5/1.5/1.5
......67.9.6...85....7..5...2....46.5..12...33....5....9...1..8..4.6..2713..92.4. ED=2.3/2.3/2.3
..7.34.6...6.8...4.183..6.5.....2...2...5.....5....8.34....9.1...3...5.6.9.1..24. ED=2.3/1.5/1.5
...2.....3..6..7.8..5.9..3...1..3.67.7.8..3.2.6..29...5...41.....7.859..2..1..6.. ED=2.0/2.0/2.0
...........4.1.5....5.8.91...8.51...64.32....7......52...7...68.7...41.....6.7.23 ED=2.0/1.5/1.5
...845..2....2..1....364.2....7...3....2.3.9.4.7...1...49.....5......9...91.8.5.4 ED=1.5/1.5/1.5
User avatar
1to9only
 
Posts: 4175
Joined: 04 April 2018

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby Mathimagics » Wed Nov 20, 2019 12:04 pm

Code: Select all
......67.9.6...85....7..5...2....46.5..12...33....5....9...1..8..4.6..2713..92.4. ED=2.3/2.3/2.3
...2.....3..6..7.8..5.9..3...1..3.67.7.8..3.2.6..29...5...41.....7.859..2..1..6.. ED=2.0/2.0/2.0
...845..2....2..1....364.2....7...3....2.3.9.4.7...1...49.....5......9...91.8.5.4 ED=1.5/1.5/1.5

My solver suggests that these three are all singles-only puzzles.
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby tarek » Wed Nov 20, 2019 12:59 pm

Hi 1to9only,

Well done on developing this helpful extension.

I'm still puzzled at your decision to work on Sudoku explainer in this way when you can do the same on the Sukaku explainer project specifically with 9x9 variants. This 9x9 variant is essentially sudoku minus blocks which would have been achieved from a drop down menu to switch between these 9x9 variants (similar to what Ruud has in SudoCue). This is something on the to-do list but with one person currently actively working on the project, finding time is difficult

I'll keep on using code that I'll find helpful from your work but to me it looks like duplicated work which could have been done in less time if things were done differently.

The LS variant like most 9x9 variants would have Sukaku as possible extension in addition to benefiting from the extra improvements on the code and Extra solving techniques the we have in Sukaku explainer.

Nevertheless, well done again

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

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby Mathimagics » Wed Nov 20, 2019 1:07 pm

tarek wrote:The LS variant like most 9x9 variants ...

Ah, I must insert a semantic quibble at this point.

Sudoku is really a variant of LS9, not the other way round!
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby tarek » Wed Nov 20, 2019 1:13 pm

Mathimagics wrote:
tarek wrote:The LS variant like most 9x9 variants ...

Sudoku is really a variant of LS9, not the other way round!
True, which is in itself a variant of Latin Sukaku Square :D
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby Mathimagics » Wed Nov 20, 2019 1:30 pm

No, I asked Euler himself about this (we have a connection) and he is appalled at the notion that a "normal clue" puzzle would be regarded as a variant of "Pencilmark" puzzles. "A variant is not necessarily the same as a subset!", he muttered darkly ... :?

I think you've upset him ... :lol:
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby tarek » Wed Nov 20, 2019 1:33 pm

Mathimagics wrote:No, I asked Euler himself about this (we have a connection) and he is appalled at the notion that a "normal clue" puzzle would be regarded as a variant of "Pencilmark" puzzles. "A variant is not necessarily the same as a subset!", he muttered darkly ... :?

I think you've upset him ... :lol:
Mathimagics wrote:
tarek wrote:Sudoku is really a variant of LS9, not the other way round!
You did that 1st :D
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby Mathimagics » Wed Nov 20, 2019 1:35 pm

BTW, I have a collection of ~7000 x 20-clue LS puzzles, but on inspection I find that they are all singles-only, so presumably are of little interest here.
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby 1to9only » Wed Nov 20, 2019 1:43 pm

tarek wrote:I'm still puzzled at your decision to work on Sudoku explainer in this way

I (and everyone must) use SE for the patterns game, so most of my hacks are to speed up SE for the patterns game, and all my projects use the same 'base' SE code which I'm quite familiar with. I don't think anyone uses SukakuExplainer for the patterns game, it has changed quite a lot recently, and I have not used it much lately - I struggled enough to make the 'blue' solved cells changes in SukakuExplainer to give up on the attempt. As noted, time is limited when there are so many SE variants nowadays!
.
User avatar
1to9only
 
Posts: 4175
Joined: 04 April 2018

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby tarek » Wed Nov 20, 2019 1:49 pm

1to9only wrote:
tarek wrote:I'm still puzzled at your decision to work on Sudoku explainer in this way

I (and everyone must) use SE for the patterns game, so most of my hacks are to speed up SE for the patterns game, and all my projects use the same 'base' SE code which I'm quite familiar with. I don't think anyone uses SukakuExplainer for the patterns game, it has changed quite a lot recently, and I have not used it much lately - I struggled enough to make the 'blue' solved cells changes in SukakuExplainer to give up on the attempt. As noted, time is limited when there are so many SE variants nowadays!
.

I have good news for you on both points. The "Bring back SE121" option will be in the next release as will be the blue solved cell change.

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

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby 1to9only » Wed Nov 20, 2019 1:52 pm

tarek wrote:I'm still puzzled at your decision to work on Sudoku explainer in this way when you can do the same on the Sukaku explainer project specifically with 9x9 variants.

I have not tried, but I think it will be more difficult (more time needed) to modify SukakuExplainer for it to solve latin squares.
.
User avatar
1to9only
 
Posts: 4175
Joined: 04 April 2018

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby tarek » Wed Nov 20, 2019 1:58 pm

1to9only wrote:
tarek wrote:I'm still puzzled at your decision to work on Sudoku explainer in this way when you can do the same on the Sukaku explainer project specifically with 9x9 variants.

I have not tried, but I think it will be more difficult (more time needed) to modify SukakuExplainer for it to solve latin squares.
.
I would be guessing if I tell you if that is true or not as I haven't attempted. It will be easier for me to investigate this by attempting having an LS option before venturing into adding other variants (If I can manage in the future to add DG and X then practically all of these extra groups can be added)
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby coloin » Fri Nov 22, 2019 11:57 am

Apologies ...comepletely off topic ......but maybe an interesting observation / :idea:

All 9*9 sudoku are latin squares ..... and more clues are required for latin squares

Valid 9*9 puzzles have one solution , but will usually have more than one latin square soluton [LSS]

Easy 9*9 puzzles maybe solved with singles will tend to have fewer LSS
Hard 9*9 puzzles will tend to have more LSS, and i wonder how significant this might be ? .... just a thought :?:
coloin
 
Posts: 2379
Joined: 05 May 2005
Location: Devon

Re: LatinExplainer - to solve and rate 9x9 latin squares

Postby Mathimagics » Fri Nov 22, 2019 2:47 pm

I looked at Mladen's 40C minimal(Sudoku) puzzle:
Code: Select all
123456789456789123798132564231675498584923617679841235367518942815294376942367851
1..4....9.5..8..2..981.2..4..1..5.9.58.92...7.798412.5.67518.4281.294.76......... # Sudoku, 40C, minimal

We can add 2 clues and the result is a valid LS puzzle:
Code: Select all
1..45...9.5..8..2..981.2..4.31..5.9.58.92...7.798412.5.67518.4281.294.76......... # LatinS, 42C, non-minimal
....X.......................X....................................................

This can be reduced, here is one way:
Code: Select all
...45...9.5..8..2...81....4.31..5...58.92...7..98412.5.67518.428..294.76......... # LatinS, 36C, minimal
X..................X...X..........X...........X.................X................

This of course is a valid Sudoku, but no longer minimal.

Are there puzzles that are both minimal Sudoku and minimal LS? :?:
User avatar
Mathimagics
2017 Supporter
 
Posts: 1926
Joined: 27 May 2015
Location: Canberra

Next

Return to Software