https://github.com/2pa4ul2/killer-sudoku
Killer Sudoku Program Using Simulated Annealing, Backtracking, and Backjumping Algorithm
https://github.com/2pa4ul2/killer-sudoku
backjumping backtracking-algorithm killer-sudoku simulated-annealing sudoku-solver
Last synced: about 2 months ago
JSON representation
Killer Sudoku Program Using Simulated Annealing, Backtracking, and Backjumping Algorithm
- Host: GitHub
- URL: https://github.com/2pa4ul2/killer-sudoku
- Owner: 2pa4ul2
- License: mit
- Created: 2024-03-16T00:40:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-10T03:42:36.000Z (12 months ago)
- Last Synced: 2025-01-25T11:08:08.046Z (3 months ago)
- Topics: backjumping, backtracking-algorithm, killer-sudoku, simulated-annealing, sudoku-solver
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Killer Sudoku Solver
## Description
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.
## Features
- 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.## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Input Cage Configurations](#input-cage-configurations)
- [Run the Program](#run-the-program)
- [Examples](#examples)
- [Dependencies](#dependencies)## Installation
1. Clone the repository:
```bash
git clone https://github.com/2pa4ul2/Killer-Sudoku.git
```2. Navigate to the project directory
```bash
cd Killer-Sudoku
```
## Usage
### Input Cage Configurations
- Provide the cage configurations in the specified format (sum,cell1,cell2,...), separated by semicolons. For example:```bash
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
```### Run the Program
- Execute the Python script to solve the puzzle:
- Backjumping```bash
python sudokubackjump.py
```
- Backtracking
```bash
python sudokubacktrack.py
```
- Simulated Annealing
```bash
python SimAnnealling.py
```
## Examples
### Sample input for the program:
```bash
7,00,10;6,11,20,21;5,01,02;3,03,13;5,12,22;6,30,31;8,23,32,33
```
### Output
```bash
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)]```
## Dependencies
- Python 3.x