This Python program provides a solver for Killer Sudoku puzzles. Killer Sudoku is a variant of Sudoku that includes cages, where groups of cells must sum up to specific values, adding an additional layer of complexity to the puzzle.
- Solve Killer Sudoku puzzles with ease.
- Choose between three solving algorithms: Backtracking, Backjumping, and Simulated annealing .
- Input cage configurations directly into the program.
- Get detailed information about the solved puzzle, including the placement of numbers and cage configurations.
-
Clone the repository:
git clone https://github.com/2pa4ul2/Killer-Sudoku.git
-
Navigate to the project directory
cd Killer-Sudoku
-
Provide the cage configurations in the specified format (sum,cell1,cell2,...), separated by semicolons. For example:
Enter cages (sum,cell1,cell2,...) separated by semicolon: 7,00,10;6,11,20,21;5,01,02;3,03,13;5,12,22;6,30,31;8,23,32,33
-
Execute the Python script to solve the puzzle:
- Backjumping
python sudokubackjump.py
- Backtracking
python sudokubacktrack.py
- Simulated Annealing
python SimAnnealling.py
7,00,10;6,11,20,21;5,01,02;3,03,13;5,12,22;6,30,31;8,23,32,33
Solution found:
2 4 1 3
1 3 2 4
4 1 3 2
3 2 4 1
Cages:
Sum: 7, Cells: [(0, 0), (1, 0)]
Sum: 6, Cells: [(1, 1), (2, 0), (2, 1)]
Sum: 5, Cells: [(0, 1), (0, 2)]
Sum: 3, Cells: [(0, 3), (1, 3)]
Sum: 5, Cells: [(1, 2), (2, 2)]
Sum: 6, Cells: [(3, 0), (3, 1)]
Sum: 8, Cells: [(2, 3), (3, 2), (3, 3)]
- Python 3.x