help on odd even sudoku variant

For fans of Killer Sudoku, Samurai Sudoku and other variants

help on odd even sudoku variant

Postby urhegyi » Mon Jul 05, 2021 12:26 pm

rectangle = even
triangle = odd
Image
After basics I need to resort to advanced steps or am I missing a step based on the configuration of odd/even cells?
Code: Select all
.-----------------.-----------------.-----------------.
| 6    1      2   | 35  4     35    | 7     9    8    |
| 3    78     478 | 9   28    268   | 1     46   5    |
| 9    48     5   | 17  17    68    | 46    2    3    |
:-----------------+-----------------+-----------------:
| 7    24     9   | 58  6     25    | 248   3    1    |
| 24   5      3   | 78  279   1     | 2689  468  246  |
| 1    68     68  | 4   239   239   | 5     7    29   |
:-----------------+-----------------+-----------------:
| 248  23679  46  | 13  1389  379   | 268   5    2469 |
| 25   239    1   | 6   359   48    | 239   48   7    |
| 458  3679   467 | 2   359   34789 | 3689  1    469  |
'-----------------'-----------------'-----------------'
urhegyi
 
Posts: 748
Joined: 13 April 2020

Re: help on odd even sudoku variant

Postby denis_berthier » Mon Jul 05, 2021 2:40 pm

.
The additional odd/even constraints are unary and can only restrict the domain of values of each rc-cell.
Considering that the PM already takes into account these domain restrictions, these contraints are no longer of any use.

A few simple bivalue-chains[3] solve the puzzle:
Code: Select all
biv-chain[3]: r3c7{n6 n4} - b1n4{r3c2 r2c3} - r7c3{n4 n6} ==> r7c7 ≠ 6
biv-chain[3]: r4c6{n2 n5} - r1c6{n5 n3} - b5n3{r6c6 r6c5} ==> r6c5 ≠ 2
naked-triplets-in-a-column: c5{r6 r8 r9}{n3 n9 n5} ==> r7c5 ≠ 9, r7c5 ≠ 3, r5c5 ≠ 9
hidden-single-in-a-row ==> r5c7 = 9
naked-single ==> r6c9 = 2
biv-chain[3]: r4c2{n2 n4} - r4c7{n4 n8} - r7c7{n8 n2} ==> r7c2 ≠ 2
biv-chain[3]: b3n4{r2c8 r3c7} - r4c7{n4 n8} - c8n8{r5 r8} ==> r8c8 ≠ 4
stte
denis_berthier
2010 Supporter
 
Posts: 4211
Joined: 19 June 2007
Location: Paris

Re: help on odd even sudoku variant

Postby urhegyi » Wed Jul 07, 2021 6:47 pm

I solved another one from the same site sudoku.today.
It was even harder and needed a lot of advanced steps like xy-wings, xyz-wings, xy-chains, w-wings...
Can anyone try this and confirm the difficulty to assure i'm not missing an essential step reducing the difficulty?
Image
urhegyi
 
Posts: 748
Joined: 13 April 2020

Re: help on odd even sudoku variant

Postby denis_berthier » Thu Jul 08, 2021 2:19 am

.
===> First step: write it as a sukaku-grid, where all the domain restrictions have been applied
(this is how you should propose such puzzles):

Code: Select all
   +-------------------------------+-------------------------------+-------------------------------+
   ! 13579     123456789 13579     ! 123456789 8         4         ! 2468      6         13579     !
   ! 123456789 123456789 123456789 ! 1         123456789 123456789 ! 123456789 123456789 3         !
   ! 13579     123456789 2468      ! 123456789 123456789 123456789 ! 2468      9         13579     !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 2         5         ! 123456789 2468      123456789 ! 3         123456789 123456789 !
   ! 123456789 7         8         ! 13579     123456789 2468      ! 123456789 123456789 123456789 !
   ! 4         123456789 3         ! 123456789 13579     5         ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 2468      123456789 2468      ! 8         123456789 123456789 ! 13579     123456789 13579     !
   ! 5         123456789 123456789 ! 123456789 4         9         ! 123456789 123456789 123456789 !
   ! 2468      9         13579     ! 6         123456789 123456789 ! 2468      123456789 2468      !
   +-------------------------------+-------------------------------+-------------------------------+



===> 2nd step: solve it as a normal Sudoku.
SudoRules gives a solution using only bivalue-chains[3] and a single z-chain[3] - which makes it a relatively easy puzzle.

Code: Select all
(solve-sukaku-grid
   +-------------------------------+-------------------------------+-------------------------------+
   ! 13579     123456789 13579     ! 123456789 8         4         ! 2468      6         13579     !
   ! 123456789 123456789 123456789 ! 1         123456789 123456789 ! 123456789 123456789 3         !
   ! 13579     123456789 2468      ! 123456789 123456789 123456789 ! 2468      9         13579     !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 123456789 2         5         ! 123456789 2468      123456789 ! 3         123456789 123456789 !
   ! 123456789 7         8         ! 13579     123456789 2468      ! 123456789 123456789 123456789 !
   ! 4         123456789 3         ! 123456789 13579     5         ! 123456789 123456789 123456789 !
   +-------------------------------+-------------------------------+-------------------------------+
   ! 2468      123456789 2468      ! 8         123456789 123456789 ! 13579     123456789 13579     !
   ! 5         123456789 123456789 ! 123456789 4         9         ! 123456789 123456789 123456789 !
   ! 2468      9         13579     ! 6         123456789 123456789 ! 2468      123456789 2468      !
   +-------------------------------+-------------------------------+-------------------------------+
)
***********************************************************************************************
***  SudoRules 20.1.s based on CSP-Rules 2.1.s, config = W+SFin
***  Using CLIPS 6.32-r801
***  Running on MacBookPro Retina Mid-2012 i7 2.7GHz, 16GB 1600MHz DDR3, MacOS 10.15.7
***  Download from: https://github.com/denis-berthier/CSP-Rules-V2.1
***********************************************************************************************

singles ==> r4c5 = 6, r5c6 = 2, r1c7 = 2, r4c6 = 8, r4c4 = 4
Code: Select all
Resolution state after Singles:
   +-------------------------+-------------------------+-------------------------+
   ! 1379    135     179     ! 3579    8       4       ! 2       6       157     !
   ! 26789   4568    24679   ! 1       2579    67      ! 4578    4578    3       !
   ! 137     134568  246     ! 2357    2357    367     ! 48      9       157     !
   +-------------------------+-------------------------+-------------------------+
   ! 19      2       5       ! 4       6       8       ! 3       17      179     !
   ! 169     7       8       ! 39      139     2       ! 14569   145     14569   !
   ! 4       16      3       ! 79      179     5       ! 16789   1278    126789  !
   +-------------------------+-------------------------+-------------------------+
   ! 26      1346    246     ! 8       12357   137     ! 1579    123457  1579    !
   ! 5       1368    1267    ! 237     4       9       ! 1678    12378   12678   !
   ! 28      9       17      ! 6       12357   137     ! 48      1234578 248     !
   +-------------------------+-------------------------+-------------------------+
203 candidates, 1229 csp-links and 1229 links. Density = 5.99%


whip[1]: c6n1{r9 .} ==> r9c5 ≠ 1, r7c5 ≠ 1
whip[1]: r9n4{c9 .} ==> r7c8 ≠ 4
whip[1]: r7n6{c3 .} ==> r8c3 ≠ 6, r8c2 ≠ 6
whip[1]: r4n7{c9 .} ==> r6c9 ≠ 7, r6c7 ≠ 7, r6c8 ≠ 7
whip[1]: c4n5{r3 .} ==> r3c5 ≠ 5, r2c5 ≠ 5
whip[1]: c1n3{r3 .} ==> r3c2 ≠ 3, r1c2 ≠ 3
whip[1]: c1n7{r3 .} ==> r2c3 ≠ 7, r1c3 ≠ 7
whip[1]: c3n9{r2 .} ==> r2c1 ≠ 9, r1c1 ≠ 9
whip[1]: b3n1{r3c9 .} ==> r8c9 ≠ 1, r4c9 ≠ 1, r5c9 ≠ 1, r6c9 ≠ 1, r7c9 ≠ 1

Code: Select all
Resolution state after Singles and whips[1]:
   +-------------------------+-------------------------+-------------------------+
   ! 137     15      19      ! 3579    8       4       ! 2       6       157     !
   ! 2678    4568    2469    ! 1       279     67      ! 4578    4578    3       !
   ! 137     14568   246     ! 2357    237     367     ! 48      9       157     !
   +-------------------------+-------------------------+-------------------------+
   ! 19      2       5       ! 4       6       8       ! 3       17      79      !
   ! 169     7       8       ! 39      139     2       ! 14569   145     4569    !
   ! 4       16      3       ! 79      179     5       ! 1689    128     2689    !
   +-------------------------+-------------------------+-------------------------+
   ! 26      1346    246     ! 8       2357    137     ! 1579    12357   579     !
   ! 5       138     127     ! 237     4       9       ! 1678    12378   2678    !
   ! 28      9       17      ! 6       2357    137     ! 48      1234578 248     !
   +-------------------------+-------------------------+-------------------------+


naked-pairs-in-a-column: c7{r3 r9}{n4 n8} ==> r8c7 ≠ 8, r6c7 ≠ 8, r5c7 ≠ 4, r2c7 ≠ 8, r2c7 ≠ 4
hidden-pairs-in-a-row: r6{n2 n8}{c8 c9} ==> r6c9 ≠ 9, r6c9 ≠ 6, r6c8 ≠ 1
hidden-pairs-in-a-block: b3{n4 n8}{r2c8 r3c7} ==> r2c8 ≠ 7, r2c8 ≠ 5
finned-x-wing-in-columns: n8{c7 c1}{r9 r3} ==> r3c2 ≠ 8
singles ==> r3c7 = 8, r2c8 = 4, r9c7 = 4, r5c9 = 4, r8c9 = 6
naked-pairs-in-a-row: r9{c1 c9}{n2 n8} ==> r9c8 ≠ 8, r9c8 ≠ 2, r9c5 ≠ 2
biv-chain[3]: r4n1{c8 c1} - b4n9{r4c1 r5c1} - r5n6{c1 c7} ==> r5c7 ≠ 1
biv-chain[3]: c4n5{r3 r1} - r1c2{n5 n1} - b3n1{r1c9 r3c9} ==> r3c9 ≠ 5
biv-chain[3]: r3c9{n1 n7} - r4c9{n7 n9} - r4c1{n9 n1} ==> r3c1 ≠ 1
biv-chain[3]: r3c1{n7 n3} - r1n3{c1 c4} - b2n5{r1c4 r3c4} ==> r3c4 ≠ 7
biv-chain[3]: r2c7{n7 n5} - c9n5{r1 r7} - b9n9{r7c9 r7c7} ==> r7c7 ≠ 7
z-chain[3]: r3c1{n7 n3} - r3c6{n3 n6} - r2c6{n6 .} ==> r3c5 ≠ 7
biv-chain[3]: c4n2{r8 r3} - r3c5{n2 n3} - b5n3{r5c5 r5c4} ==> r8c4 ≠ 3
hidden-pairs-in-a-row: r8{n3 n8}{c2 c8} ==> r8c8 ≠ 7, r8c8 ≠ 2, r8c8 ≠ 1, r8c2 ≠ 1
biv-chain[4]: r4n1{c8 c1} - b4n9{r4c1 r5c1} - r5n6{c1 c7} - b6n5{r5c7 r5c8} ==> r5c8 ≠ 1
singles ==> r5c8 = 5, r9c5 = 5
hidden-pairs-in-a-row: r7{n5 n9}{c7 c9} ==> r7c9 ≠ 7, r7c7 ≠ 1
biv-chain[3]: r5n1{c1 c5} - r5n3{c5 c4} - r1n3{c4 c1} ==> r1c1 ≠ 1
whip[1]: c1n1{r5 .} ==> r6c2 ≠ 1
singles ==> r6c2 = 6, r5c7 = 6
naked-pairs-in-a-block: b1{r1c1 r3c1}{n3 n7} ==> r2c1 ≠ 7
biv-chain[3]: r8c7{n7 n1} - r6c7{n1 n9} - r6c4{n9 n7} ==> r8c4 ≠ 7
naked-single ==> r8c4 = 2
naked-pairs-in-a-block: b7{r8c3 r9c3}{n1 n7} ==> r7c2 ≠ 1
whip[1]: b7n1{r9c3 .} ==> r1c3 ≠ 1
singles ==> r1c3 = 9, r2c5 = 9, r3c5 = 2
biv-chain[3]: r2n7{c6 c7} - r8c7{n7 n1} - r7n1{c8 c6} ==> r7c6 ≠ 7
biv-chain[3]: r6c5{n1 n7} - r7n7{c5 c8} - r4c8{n7 n1} ==> r6c7 ≠ 1
stte
denis_berthier
2010 Supporter
 
Posts: 4211
Joined: 19 June 2007
Location: Paris


Return to Sudoku variants