archie94 / GA-sudoku

An Attempt to solve Sudoku problem using Genetic Algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GA-Sudoku

An Attempt to solve Sudoku problem using a genetic algorithm in python `

Details

  • generate valid sudoku using graph coloring technique.
  • Eliminate some of the values from the sudoku and generate different level of problem sudokus
  • Pass problem Sudoku to the Genetic algorithm.

Initial Sample

  • Initially, sample spaces are generated by picking the values allowed to a position, and if no valid value is possible then pick a random value.

Fitness calculation

  • Fitness is calculated based on the incorrectness caused by each position. Instead of scoring the sample, each position of the samples is scored.

Selection

  • Based on the probability (calculated from the score) of each position, positions are chosen for the next generation.

Numpy and Python are required to run the project.

Run

python ga_solve_sudoku.py

About

An Attempt to solve Sudoku problem using Genetic Algorithm

License:MIT License


Languages

Language:Python 100.0%