How to use the sorted() and min() function with OR-Tools in python?
I’m building a Python Sudoku Solver to solve the classic and non-classic sudokus using the cp_model
from Google’s ortools
library. Specifically, I’m trying to write a method that solves a Sudoku Variant in which every row/column/subgrid contains 9 unique numbers between 0 – 11. For instance, if row 1 of the sudoku has numbers [1, 2, 3, 4, 5, 6, 7, 8, 9], rows 2-9 cannot have the same numbers in any permutation. However, row 2 can have the numbers [0, 1, 2, 3, 4, 5, 6, 7, 8] since this is a distinct set of 9 numbers. Likewise, this distinction applies to all rows.