Skip to content

zeryabmoussaoui/sudoku-optimization-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Optimization Solvers

Authors : Zeryab Moussaoui

Introduction

The aim of this project is to provide benchmarking environnement to solve Sudoku grid using Optimization Methods. This is done my minimizing Grid Energy, which corresponds to number of free positions.

Installation

  • Download zip of github project and unzip it.

  • Check the following requirements :

  • Python > 3.6.3

  • Scikit-learn > 0.19.1

How to

1/ Edit the Sudoku Grid in the sudoku.dat file.

Zeros corresponds to unknown values.

For example :

0 0 1 2
0 0 0 0
1 0 0 3
0 3 0 0

Or

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

2/ Choose one of the provided methods (or implement your !) :

Method Reference File to execute
Metropolis Metr-53 sudoku_MC.py
Q-Learning Watkins-89 sudoku_QL.py
Q Neural Network Tesauro-95 sudoku_QNN.py

Execute the file, console shows results :

[[5 9 1 6 4 7 3 8 2]
[7 6 2 3 1 8 4 5 9]
[8 3 4 5 2 9 7 6 1]
[4 7 9 2 5 1 6 3 8]
[1 8 3 9 7 6 2 4 5]
[2 5 6 4 8 3 1 9 7]
[6 4 7 1 9 5 8 2 3]
[9 2 8 7 3 4 5 1 6]
[3 1 5 8 6 2 9 7 4]]

Releases

No releases published

Packages

No packages published

Languages