## Pandiagonal Latin Squares

Programs which generate, solve, and analyze Sudoku puzzles

### Re: Pandiagonal Latin Squares

Mathimagics wrote:I have updated the list above for N=7.

Only 1 of them is rated hard:
Code: Select all
`.............4........5....17.2.....6............ ED=7.7/7.7/2.9`

The others (most) are rated ED=2.9, two are ED=3.0.

Besides those I posted a few days ago, I also generated a few more with other (medium!) ratings:
Code: Select all
`........6..1......7.............5...3...........4 ED=4.0/4.0/2.9 <- Hidden Triplet...4................2...5.3...........6......1... ED=4.2/4.2/2.9 <- XY-Wing.1..........5.............6......4.3....7........ ED=4.4/2.0/2.0 <- XYZ-Wing....5.2.............1.4........6.............3... ED=4.4/4.4/2.9 <- XYZ-Wing.......7......3............1..2...........4.5.... ED=6.2/2.3/2.3 <- APE`

Here are some ED=7.x from another batch run:
PanDiagonal LS, N=7: Show
Code: Select all
`4753..............................1........2..... ED=7.7/7.7/2.91...........................5......23...6.4...... ED=7.7/7.7/2.9......5........1..4...............3.6...7........ ED=7.7/7.7/2.9......64...7.2......5......1..................... ED=7.7/7.7/2.9...........4.......1.....5..........23......7.... ED=7.7/7.7/2.9....2...........4.....6.......5...............37. ED=7.7/7.7/2.9....2.....7.......4.............1.5...........3.. ED=7.7/7.7/2.9............4....6.5.............2..........71... ED=7.5/7.5/2.9....7.3..............1......6.............2...4.. ED=7.5/7.5/2.9..............1....4..........52....63........... ED=7.5/7.5/2.9.........5.2....71.6............3................ ED=7.5/7.5/2.9..1.2................................5.....6.34.. ED=7.5/7.5/2.9.........3......4...1.......5...2.6.............. ED=7.5/7.5/2.9.........2...........1...4.7.6...3............... ED=7.5/7.5/2.9...............5..6.........4.....3.1...2........ ED=7.5/7.5/2.9.........3......75.......................14....2. ED=7.5/7.5/2.9............7................14..25..6........... ED=7.1/7.1/2.93.............6....4........5..1.....2........... ED=7.1/7.1/2.9...........................4....751.........6...2 ED=7.1/7.1/2.9...7..1.........52......6.............4.......... ED=7.1/7.1/2.9....4......71.....3................56............ ED=7.1/7.1/2.9.........3.....65..2................7...4........ ED=7.1/7.1/2.9..3..7........1.2.............6......4........... ED=7.1/7.1/2.9.....4........5....3.......6.....2.............1. ED=7.1/7.1/2.9.........3..7...2....1........5......4........... ED=7.1/7.1/2.9.........2.............4.3.5.........1.7......... ED=7.1/7.1/2.9...6.1.............2.......................7..43. ED=7.1/7.1/2.92.......6....41.3...........7.................... ED=7.1/7.1/2.9.2.......4.................5.....16......7....... ED=7.1/7.1/2.9`

I've not generated any higher than ED=7.7.
1to9only

Posts: 3415
Joined: 04 April 2018

### Re: Pandiagonal Latin Squares

Mathimagics wrote:I have updated the list above for N=7.
N=11 will take longer, I have to use DLX as I only built the matching-pattern solver for N=13. Finding minimal puzzles hammers the solver ... and N=11 is where it starts to hurt ...
Ok, they are in place now ...

Hi Mathimagics,
Thanks

The hardest I found in the 7x7 list is in Z3:
Code: Select all
`.............4........5....17.2.....6............`

Code: Select all
`Resolution state after Singles:12356   12347   34567   2345    12346   1367    357     12356   237     13567   1236    235     1357    4       36      12347   1346    1234567 13457   235     23567   2346    5       3467    347     2367    23467   1       7       134     2       1356    13456   3456    356     12345   6       1357    137     23457   123457  23      1345    1237    345     234567  1367    12346   23567   181 candidates, 1563 csp-links and 1563 links. Density = 9.59%`

To be noticed: the high density (much higher than in Sudoku), implying a high branching factor.

The first steps are interesting as they show several kinds of whips[1] (but no dn):
Code: Select all
`whip[1]: a4n4{r7c3 .} ==> r7c4 ≠ 4, r1c3 ≠ 4, r1c2 ≠ 4whip[1]: r1n4{c5 .} ==> r4c1 ≠ 4whip[1]: c1n4{r7 .} ==> r3c4 ≠ 4, r3c5 ≠ 4whip[1]: a3n4{r6c1 .} ==> r4c3 ≠ 4, r6c6 ≠ 4whip[1]: r4n4{c6 .} ==> r5c5 ≠ 4whip[1]: c5n4{r6 .} ==> r7c6 ≠ 4whip[1]: a6n7{r6c4 .} ==> r6c6 ≠ 7whip[1]: a1n7{r7c7 .} ==> r7c4 ≠ 7whip[1]: a6n1{r6c4 .} ==> r6c6 ≠ 1whip[1]: c6n1{r7 .} ==> r1c5 ≠ 1whip[1]: c7n6{r5 .} ==> r5c5 ≠ 6whip[1]: c5n6{r7 .} ==> r4c1 ≠ 6whip[1]: c7n2{r3 .} ==> r3c4 ≠ 2whip[1]: c4n2{r7 .} ==> r1c5 ≠ 2Resolution state after Singles and whips[1]:12356 1237  3567  2345  346   1367  357   12356 237   13567 1236  235   1357  4     36    12347 1346  13567 1357  235   23567 23    5     367   347   2367  23467 1     7     134   2     1356  135   3456  356   12345 6     1357  137   23457 235   23    1345  1237  345   2356  1367  1236  23567 163 candidates.`

The rest is standard bivalue-chains, z-chains, t-whips and whips: Show
z-chain[2]: r1n1{c1 c6} - a5n1{r2c6 .} ==> r7c2 ≠ 1
whip[1]: c2n1{r5 .} ==> r3c4 ≠ 1
whip[1]: c4n1{r6 .} ==> r2c1 ≠ 1
z-chain[2]: r1n2{c2 c4} - a5n2{r7c4 .} ==> r2c1 ≠ 2
whip[1]: c1n2{r6 .} ==> r6c6 ≠ 2
whip[1]: c6n2{r7 .} ==> r7c2 ≠ 2
z-chain[2]: d1n7{r4c5 r6c3} - c6n7{r2 .} ==> r1c2 ≠ 7
whip[1]: r1n7{c7 .} ==> r4c3 ≠ 7
whip[1]: r4n7{c6 .} ==> r3c5 ≠ 7
z-chain[2]: r4n6{c6 c5} - a6n6{r7c5 .} ==> r1c3 ≠ 6
whip[1]: c3n6{r4 .} ==> r3c4 ≠ 6
whip[1]: c4n6{r7 .} ==> r7c6 ≠ 6
z-chain[2]: a6n3{r3c1 r7c5} - a4n3{r7c3 .} ==> r3c4 ≠ 3
t-whip[2]: a6n3{r7c5 r1c6} - a4n3{r1c4 .} ==> r7c4 ≠ 3
z-chain[3]: r4c3{n3 n6} - c6n6{r1 r5} - c6n4{r5 .} ==> r4c6 ≠ 3
whip[2]: r4n3{c5 c3} - a4n3{r7c3 .} ==> r1c1 ≠ 3
z-chain[3]: r4c3{n3 n6} - d2n6{r4c6 r3c7} - r3c1{n6 .} ==> r2c1 ≠ 3
z-chain[3]: r4c3{n3 n6} - c6n6{r4 r5} - r3c1{n6 .} ==> r1c6 ≠ 3
whip[1]: a6n3{r7c5 .} ==> r6c5 ≠ 3
z-chain[2]: d3n3{r5c6 r3c1} - a4n3{r3c6 .} ==> r2c3 ≠ 3
t-whip[2]: a6n3{r6c4 r7c5} - a4n3{r7c3 .} ==> r3c7 ≠ 3
t-whip[2]: d2n3{r7c3 r1c2} - d3n3{r5c6 .} ==> r7c5 ≠ 3
whip[1]: a6n3{r6c4 .} ==> r6c1 ≠ 3
z-chain[2]: a6n3{r6c4 r3c1} - r4n3{c1 .} ==> r5c4 ≠ 3
z-chain[2]: d1n3{r7c2 r6c3} - c1n3{r4 .} ==> r3c5 ≠ 3
z-chain[2]: d7n3{r7c1 r2c6} - r5n3{c6 .} ==> r7c7 ≠ 3
z-chain[2]: c7n3{r5 r6} - c1n3{r7 .} ==> r3c2 ≠ 3
z-chain[2]: a7n3{r4c3 r7c6} - r3n3{c6 .} ==> r1c3 ≠ 3
biv-chain[3]: r4c1{n2 n3} - a6n3{r3c1 r6c4} - r6c7{n3 n2} ==> r3c7 ≠ 2, r4c5 ≠ 2, r6c1 ≠ 2
whip[1]: r6n2{c7 .} ==> r7c6 ≠ 2
whip[1]: r7n2{c7 .} ==> r2c2 ≠ 2
whip[1]: r2n2{c5 .} ==> r1c4 ≠ 2
biv-chain[2]: a7n2{r6c5 r3c2} - a7n4{r3c2 r6c5} ==> r6c5 ≠ 5, r6c5 ≠ 7
whip[1]: c5n7{r7 .} ==> r2c3 ≠ 7, r7c2 ≠ 7
stte

As for the 11x11, they are not even in T&E(1) and therefore unsolvable by a manual player. It seems to be hard to find interesting puzzles.
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

1to9only wrote:Besides those I posted a few days ago, I also generated a few more with other (medium!) ratings:
[...]
Here are some ED=7.x from another batch run

All solved in W2 (except 1 in W3). Interesting Naked or Hidden Pairs for some, in diagonals or anti-diagonals.
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

For Serg,

In case you missed my post on the previous page, the number of ED 13x13 pandiagonal latin squares is only 10.

The automorphism group size table is:

Code: Select all
`    |A|     EDG    ------------        2       1      6       1     26       1     52       1     78       2    156       2   2028       1   8112       1  -------------                  10  NDG   = 12386         = Sum ( EDG * |A| / 16224)`

NDG is the number of different grids, |A| the number of automorphisms, and 16224 is the number of VPT's.

Mathimagics
2017 Supporter

Posts: 1829
Joined: 27 May 2015
Location: Canberra

### Re: Pandiagonal Latin Squares

I wonder if there is a 12 in every ED grid ...
and what is the ED / whip count of the hardest !! ?
coloin

Posts: 2087
Joined: 05 May 2005

### Re: Pandiagonal Latin Squares

I've modified the SE generator to randomly pick one of the 8 (N=11) or 10 (N=13) ED grids, and create a PanDiagonal puzzle thereof.
For 11x11 Pandiagonal, I can temporarily offer this (it has a single solution, but it is not minimal):
Code: Select all
`.8.3......2.............9.........1......B..........3.............4..........................A.7......1.5...........2.... ED=7.9/2.9/2.9`

SE (thus the generator) written in Java is painfully slow validating these puzzles.
I'll post the minimal puzzle later - currently an ED=8.1/2.9/2.9, SE is still churning away...
1to9only

Posts: 3415
Joined: 04 April 2018

### Re: Pandiagonal Latin Squares

1to9only wrote:I've modified the SE generator to randomly pick one of the 8 (N=11) or 10 (N=13) ED grids, and create a PanDiagonal puzzle thereof.
For 11x11 Pandiagonal, I can temporarily offer this (it has a single solution, but it is not minimal):
Code: Select all
`.8.3......2.............9.........1......B..........3.............4..........................A.7......1.5...........2.... ED=7.9/2.9/2.9`

This is in W2.
Total solving time by CSP-Rules: 6.55s. Unfortunately, for larger and harder puzzles, due to the high branching factor of Pandiags, it can take much longer (4 mins for the 13x13 puzzle in W4 I mentioned before.)

1to9only wrote:SE (thus the generator) written in Java is painfully slow validating these puzzles.
I'll post the minimal puzzle later - currently an ED=8.1/2.9/2.9, SE is still churning away...

Can you keep the intermediate puzzles? I'm interested in a 8.1 or higher. For a solver, minimality is not really relevant.
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

coloin wrote:I wonder if there is a 12 in every ED grid ...
and what is the ED / whip count of the hardest !! ?

I can compute the W rating. But the hardest in which list?
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

coloin wrote:I wonder if there is a 12 in every ED grid ...
and what is the ED / whip count of the hardest !! ?

I have found a 12-clue puzzle for every ED grid:

12C: Show
Code: Select all
`.......................................................C..................7.......4........9...........A.1......6.....8...............B.3.......5........2...................................................1..A8........5.........D..6........3......9..................4.....................................................2........7.......B.........A........9B..........8.........................7C2..................4.................................5....3....................1..............................6...........C......................D...........1..4...................2......................3..............7.............A......................B.................5..89.........................D.....8.....1...........2..........................................C67...........4....................A.......B....3.5....................................................1......................5...........2.....D............4...8...................................3..6............AB.......................C.......7............C...............................................56...A..............................3.......B.........4........9....1................8......2..............7.....................9A.....8........4....................B....................1......3................2..D...........C......................5.7...........................1.....78.............................................9..............D...........................5............A.......C............6.........3..B.....4...................1.....7.................4................5.........2........................................B............3....8...C.....A................6..9............................`

Not sure how to answer the second part of the question ... Denis indicated that even for N=11, the 10-clue puzzles I gave above couldn't be rated, and these N=13 puzzles are even harder
Last edited by Mathimagics on Thu Jun 10, 2021 1:22 pm, edited 1 time in total.

Mathimagics
2017 Supporter

Posts: 1829
Joined: 27 May 2015
Location: Canberra

### Re: Pandiagonal Latin Squares

Mathimagics wrote:
coloin wrote:I wonder if there is a 12 in every ED grid ...
and what is the ED / whip count of the hardest !! ?

I have found a 12-clue puzzle for every ED grid:
[...][/hidden]
Not sure how to answer the second part of the question ... Denis indicated that even for N=11, the 10-clue puzzles I gave above couldn't be rated, and these N=13 puzzles are even harder

Oh, that list! As they are not in T&E(1), the W rating is easy to compute: infinite.
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

denis_berthier wrote:As they are not in T&E(1), the W rating is easy to compute: infinite.

Ok, I'll try and find some harder ones, then

Mathimagics
2017 Supporter

Posts: 1829
Joined: 27 May 2015
Location: Canberra

### Re: Pandiagonal Latin Squares

Mathimagics wrote:
denis_berthier wrote:As they are not in T&E(1), the W rating is easy to compute: infinite.

Ok, I'll try and find some harder ones, then

Good idea.

As you can somehow compute the SER, I think the right values for something not too easy but still solvable by a human would be between 8 and 9.
denis_berthier
2010 Supporter

Posts: 2767
Joined: 19 June 2007
Location: Paris

### Re: Pandiagonal Latin Squares

Hi, Mathimagics!
Mathimagics wrote:... the number of ED 13x13 pandiagonal latin squares is only 10.

The automorphism group size table is:

Code: Select all
`    |A|     EDG    ------------        2       1      6       1     26       1     52       1     78       2    156       2   2028       1   8112       1  -------------                  10  NDG   = 12386         = Sum ( EDG * |A| / 16224)`

NDG is the number of different grids, |A| the number of automorphisms, and 16224 is the number of VPT's.

I saw your post, thanks! I need some time to crosscheck your results.

Serg
Last edited by Serg on Fri Jun 11, 2021 2:53 pm, edited 1 time in total.
Serg
2018 Supporter

Posts: 768
Joined: 01 June 2010
Location: Ukraine

### Re: Pandiagonal Latin Squares

1to9only wrote:For 11x11 Pandiagonal, I can temporarily offer this (it has a single solution, but it is not minimal):
Code: Select all
`.8.3......2.............9.........1......B..........3.............4..........................A.7......1.5...........2.... ED=7.9/2.9/2.9`

PanDiagonal Latin Squares, N=11:
Code: Select all
`.8.3......2.............9.........1......B.........53..5...A......4.............7............A.7..1...1.5...........2....  18 ED=2.9/1.5/1.5.8.3......2.............9.........1......B..........3..5...A......4.............7............A.7..1...1.5...........2....  17 ED=2.9/1.5/1.5.8.3......2.............9.........1......B..........3......A......4.............7............A.7..1...1.5...........2....  16 ED=2.9/2.9/2.9.8.3......2.............9.........1......B..........3......A......4.............7............A.7......1.5...........2....  15 ED=2.9/2.9/2.9.8.3......2.............9.........1......B..........3......A......4..........................A.7......1.5...........2....  14 ED=7.7/2.9/2.9.8.3......2.............9.........1......B..........3.............4..........................A.7......1.5...........2....  13 ED=7.9/2.9/2.9 <- posted.8.3......2.............9.........1......B..........3.............4..........................A.7........5...........2....  12 ED=8.1/2.9/2.9`

I've stopped the program after ED=8.1.

PanDiagonal Latin Squares, N=13:
Code: Select all
`..3.......B..6....................67....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3........4....  29 ED=2.9/1.5/1.5..3.......B..6....................67....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  28 ED=7.1/1.5/1.5..3.......B..6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  27 ED=7.7/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  26 ED=7.8/1.5/1.5`

The 25 clues grids are harder:
Code: Select all
`.............6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.7/1.5/1.5..3................................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.4/1.5/1.5..3..........6..........................4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.7/1.5/1.5..3..........6.....................7...................B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.0/1.5/1.5..3..........6.....................7....4...........................3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.7/1.5/1.5..3..........6.....................7....4..............B...................A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=8.1/1.5/1.5..3..........6.....................7....4..............B............3..........6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.3/1.5/1.5..3..........6.....................7....4..............B............3......A.......A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.7/1.5/1.5..3..........6.....................7....4..............B............3......A...6..........4.....2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=8.4/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A............2.........4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=8.3/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4...............4.6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.6/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2...........6........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.1/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4..........7...BCD.2..5..D12....7........8..B....3.............  25 ED=9.4/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6............BCD.2..5..D12....7........8..B....3.............  25 ED=8.3/8.0/2.9..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7....CD.2..5..D12....7........8..B....3.............  25 ED=9.9/7.6/2.9..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...B.D.2..5..D12....7........8..B....3.............  25 unrated..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BC..2..5..D12....7........8..B....3.............  25 ED=9.1/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD....5..D12....7........8..B....3.............  25 ED=9.3/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2.....D12....7........8..B....3.............  25 unrated..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5...12....7........8..B....3.............  25 ED=9.0/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D.2....7........8..B....3.............  25 unrated..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D1.....7........8..B....3.............  25 ED=9.0/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12.............8..B....3.............  25 ED=9.1/1.5/1.5..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7...........B....3.............  25 unrated..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8.......3.............  25 unrated..3..........6.....................7....4..............B............3......A...6...A......4.....2.........4.6........7...BCD.2..5..D12....7........8..B..................  25 ED=9.2/1.5/1.5`

The first unrated grid crashed the program with an 'out of memory' error! The other unrated grids were stopped after about 5-10 minutes of processing!
No processing of 24 clues done.
1to9only

Posts: 3415
Joined: 04 April 2018

### An Elegant 12C

.
I found this (PD13) 12-clue puzzle, which has 7 empty rows, 7 empty columns, 7 empty right-diagonals and 7 empty left-digonals.

So only 24 of the 52 houses are hit - it could well be even harder (computationally) than the others. Sadly nobody is in a position to make that assessment!

Code: Select all
` . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D 6 . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . 2 . . . . 5 4 . . 9 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 . C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B . . A .`
Last edited by Mathimagics on Fri Jun 11, 2021 6:45 pm, edited 1 time in total.

Mathimagics
2017 Supporter

Posts: 1829
Joined: 27 May 2015
Location: Canberra

PreviousNext