jeremydover / ORsudoku

A Python class which allows (relatively) easy modeling of common (and some uncommon) Sudoku constraints for Google's ORTools SAT Solver.
GNU General Public License v3.0
0 stars 0 forks source link

Update parity quads to allow setting of disallowed parity counts #58

Closed jeremydover closed 6 months ago

jeremydover commented 6 months ago

The current parity quad functionality disallows a 2x2 quad that is all odd or all even. Update this functionality to allow different counts to be forbidden, thinking specifically of a "majority rules" variant where no 2x2 is evenly split (not even sure if this is possible). This would require creating a class variable for "disallowed" values, similar to that used for Gamma/Epsilon, but leaving the default as 0/4 to support backward compatibility for existing quadro.

jeremydover commented 6 months ago

Ran a brief test, and it is possible.

jeremydover commented 6 months ago

Code updated in 5/24/2024 push