GithubHelp home page GithubHelp logo

2pa4ul2 / killer-sudoku Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

Killer Sudoku Program Using Simulated Annealing, Backtracking, and Backjumping Algorithm

License: MIT License

Python 100.00%
backjumping backtracking-algorithm killer-sudoku simulated-annealing sudoku-solver

killer-sudoku's Introduction

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

  1. Clone the repository:

    git clone https://github.com/2pa4ul2/Killer-Sudoku.git
  2. Navigate to the project directory

    cd Killer-Sudoku

Usage

Input Cage Configurations

  • 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

Run the Program

  • Execute the Python script to solve the puzzle:

    • Backjumping
    python sudokubackjump.py
    • Backtracking
    python sudokubacktrack.py
    • Simulated Annealing
    python SimAnnealling.py

Examples

Sample input for the program:

7,00,10;6,11,20,21;5,01,02;3,03,13;5,12,22;6,30,31;8,23,32,33

Output

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

killer-sudoku's People

Contributors

2pa4ul2 avatar

Watchers

 avatar

killer-sudoku's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.