Skip to content

A sudoku (standard, killer, an sudoku X) solver using genetic algorithms

Notifications You must be signed in to change notification settings

troyxdp/Optimization-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimization Project

Welcome to my Optimization project for my Honours year! It is a Sudoku solver that makes use of a genetic algorithm. It also solves Killer Sudoku and Sudoku X puzzles.

To run the project, execute the following command:

python main.py
  --sudoku-path <path-to-txt-file>
  [--mutation-rate <float>]
  [--nt <int>]
  [--no-improvement-max-generations <int>]
  [--num-mutation-retries <int>]
  [--mutation-retry-scale <float>]
  [--num-offspring <int>]
  [--output-folder <path-to-folder>]
  [--killer]
  [--sudoku-x]
  [--population-size <int>]

For more information on the different arguments, run the following command:

python main.py --help

The input for standard sudoku and sudoku X puzzles is of the following form:

0 0 3 0 2 0 6 0 0
9 0 0 3 0 5 0 0 1
0 0 1 8 0 6 4 0 0
0 0 8 1 0 2 9 0 0
7 0 0 0 0 0 0 0 8
0 0 6 7 0 8 2 0 0
0 0 2 6 0 9 5 0 0
8 0 0 2 0 3 0 0 9
0 0 5 0 1 0 3 0 0

where a 0 represent an empty cell. If the puzzle input is not valid, an error will be thrown.

I honestly cannot remember the format for inputing a killer sudoku, but I will check and add it hear when I can.

About

A sudoku (standard, killer, an sudoku X) solver using genetic algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages