GithubHelp home page GithubHelp logo

gearhartlove / ai-sudoku-solver Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 249 KB

Using backtracking and local search algorithms to solve Sudoku problems.

C# 100.00%
sudoku ai artificial-intelligence backtracking local-search algorithms

ai-sudoku-solver's Introduction

AI-Sudoku-Solver

Solving Sudoku puzzles with backtracking and local search algorithms
Contributers: Gearhartlove | LordThesus | MrVintage710

  • Simple Backtracking
  • Backtrackign with forward checking
  • Backtracking using arc consistency
  • Genetic Algorithm with a tournament and penalty function
  • Simulated Annealing using a minimum conflict heuristic

Input

9x9 grid filled with number or ? (empty space) as a .txt file

?,?,8,?,5,6,?,?,?
7,?,4,?,?,?,6,1,9
?,?,?,?,?,?,8,5,?
6,?,7,?,2,9,5,?,?
?,?,9,?,6,?,1,?,?
?,?,2,3,1,?,9,?,4
?,3,5,?,?,?,?,?,?
4,2,1,?,?,?,3,?,6
?,?,?,8,3,?,4,?,?

The Input for the project is stored at: AI-Sudoku-Solver/AI-Sudoku-Solver/puzzles
There are a total of 19 puzzle files similar to the example above. The program runs each algorithm for each puzzle, one at a time.

Output

Hard-P4.csv:
    (Simple Backtracking) - SOLVED (Checker) - PASSED | ms: 2 | backtracks: 44 | nodes visit: 98
    (Look Forward Backtracking) - SOLVED (Checker) - PASSED | ms: 5 | backtracks: 44 | nodes visit: 98
    (MAC Backtracking) - SOLVED (Checker) - PASSED | ms: 312 | backtracks: 9534 | nodes visit: 9588
    (Genetic Local Search) - UNSOLVED (Checker) - FAILED | 
        (Constraints violated by the population)
        START worst: 161 best: 123 mean: 141.48 median: 142
        END   worst: 56 best: 24 mean: 24.65 median: 24
    (Simmulated Annealing Local Search) - UNSOLVED (Checker) - FAILED | ms: 122
Starting Puzzle Violation Score: 87 | Final Puzzle Violation Score: 22

ai-sudoku-solver's People

Contributors

lordthesus avatar mrvintage710 avatar

Watchers

 avatar  avatar  avatar

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.