Premier commit
This commit is contained in:
commit
3b3a960a2a
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Autour des Sudoku
|
||||
|
||||
Diverses variations autour des Sudoku.
|
43
Solver/README.md
Normal file
43
Solver/README.md
Normal file
@ -0,0 +1,43 @@
|
||||
# Solveurs de Sudoku
|
||||
|
||||
Résolution de grilles de Sudoku programmée en Python.
|
||||
|
||||
## Description des fichiers
|
||||
|
||||
* `sudoku_grid.py` : module définissant une classe `SudokuGrid` pour représenter les grilles de Sudoku.
|
||||
* `sudoku_solver.py` : module définissant une fonction `solve` pour la résolution des grilles de Sudoku.
|
||||
* `main1.py` : script de résolution d'une grille décrite en argument sur la ligne de commande.
|
||||
* `main2.py` : script de résolution d'une grille contenue dans un fichier. Les solutions sont affichées dans le terminal.
|
||||
* `main3.py` : script de résolution de toutes les grilles contenues dans un fichier. Les solutions sont inscrites dans un fichier.
|
||||
* `main4.py` : script de résolution d'une grille décrite sur la ligne de commande, et qui produit une image représentant la recherche des solutions.
|
||||
* `main5.py` : scripy de résolution d'une grille décrite sur la ligne de commande, qui visualise le remplissage progressif de la grille.
|
||||
* `bdd/sudokus.bdd` : un fichier texte contenant la description de 5000 grilles de Sudoku ayant toutes une seule solution.
|
||||
* `bdd/sudoku17.bdd` : un fichier texte contenant la description de 49151 grilles de Sudoku n'ayant que 17 cases remplis et ayant toutes une seule solution.
|
||||
|
||||
## Exemples d'utilisation
|
||||
|
||||
|
||||
### Visualiser la recherche de solution avec le script `main4.py`
|
||||
Pour la grille ci-dessous (grille de la ligne 43 (en numérotant à partir de 0) du fichier `bdd/sudokus.bdd`)
|
||||
|
||||
+-------+-------+-------+
|
||||
| 2 . . | . 5 . | 8 4 . |
|
||||
| . 1 . | 7 9 . | 5 . . |
|
||||
| . . . | . . 4 | . . . |
|
||||
+-------+-------+-------+
|
||||
| . 8 1 | . . . | 2 . 9 |
|
||||
| 3 . . | . . . | . . 5 |
|
||||
| 7 . 6 | . . . | 3 1 . |
|
||||
+-------+-------+-------+
|
||||
| . . . | 9 . . | . . . |
|
||||
| . . 8 | . 2 3 | . 5 . |
|
||||
| . 6 3 | . 1 . | . . 7 |
|
||||
+-------+-------+-------+
|
||||
après la commande
|
||||
|
||||
./main4.py 200050840010790500000004000081000209300000005706000310000900000008023050063010007 sudokufiendish
|
||||
|
||||
on obtient, outre la solution, deux fichiers `sudokufiendish.dot` et `sudokufiendish.png`décrivant l'arbre de recherche des solutions suivant
|
||||
|
||||
![Arbre de résolution d'un sudoku difficile](sudokufiendish.png)
|
||||
|
49151
Solver/bdd/sudoku17.bdd
Normal file
49151
Solver/bdd/sudoku17.bdd
Normal file
File diff suppressed because it is too large
Load Diff
5000
Solver/bdd/sudokus.bdd
Normal file
5000
Solver/bdd/sudokus.bdd
Normal file
File diff suppressed because it is too large
Load Diff
61
Solver/main1.py
Executable file
61
Solver/main1.py
Executable file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod: module
|
||||
:author: `Eric W`
|
||||
:date: 2016, october
|
||||
|
||||
search and print all solutions of a sudoku puzzle described by a string on the command line
|
||||
|
||||
"""
|
||||
|
||||
GRID='''
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
'''
|
||||
|
||||
def usage():
|
||||
print('Usage: {:s} <grid>'.format(sys.argv[0]))
|
||||
print('where <grid> is a 81 characters string describing a valid sudoku grid')
|
||||
print('\nExample: with the grid')
|
||||
print(GRID)
|
||||
print('$ {:s} 906028003040500001080900040600000070008206900030000005050003060100002080200870500'.format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import sudoku_grid, sudoku_solver
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
usage()
|
||||
else:
|
||||
strgrid = sys.argv[1]
|
||||
try:
|
||||
grid = sudoku_grid.SudokuGrid(strgrid)
|
||||
except sudoku_grid.SudokuGridError:
|
||||
usage()
|
||||
print('Sudoku to solve')
|
||||
grid.pretty_print()
|
||||
sols = sudoku_solver.solve(grid)
|
||||
nb_sols = len(sols)
|
||||
print('Number of solution(s): {:d}'.format(nb_sols))
|
||||
print('--')
|
||||
for i in range(nb_sols):
|
||||
print('Solution {:d}'.format(i + 1))
|
||||
sols[i].pretty_print()
|
||||
print('--')
|
||||
|
||||
exit(0)
|
||||
|
63
Solver/main2.py
Executable file
63
Solver/main2.py
Executable file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod: module
|
||||
:author: `Éric W`
|
||||
:date: 2016, october
|
||||
|
||||
"""
|
||||
|
||||
def usage():
|
||||
print('Usage: {:s} <bdd> <n>'.format(sys.argv[0]))
|
||||
print('where')
|
||||
print('\t<bdd> is a text file whose lines are valid sudoku grids descriptions')
|
||||
print('\t<n> is the line number to extract in file <bdd>')
|
||||
print('\nExample: with the grid on line 7 of the file bdd/sudokus.bdd')
|
||||
print('$ {:s} bdd/sudokus.bdd 7'.format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import sudoku_grid, sudoku_solver
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print('Argument missing.')
|
||||
usage()
|
||||
else:
|
||||
filename = sys.argv[1]
|
||||
try:
|
||||
n = int(sys.argv[2])
|
||||
except ValueError:
|
||||
print('Second argument must be an integer >=0.')
|
||||
usage()
|
||||
try:
|
||||
with open(filename, 'r') as input:
|
||||
lines = input.readlines()
|
||||
except FileNotFoundError:
|
||||
print('No such file {:s}'.format(filename))
|
||||
usage()
|
||||
try:
|
||||
line = lines[n].rstrip('\n')
|
||||
except IndexError:
|
||||
print('File {:s} has no line number {:d}.'.format(filename, n))
|
||||
usage()
|
||||
strgrid = line.split(':')[-1]
|
||||
try:
|
||||
grid = sudoku_grid.SudokuGrid(strgrid)
|
||||
except sudoku_grid.SudokuGridError:
|
||||
print("Line number {:d} of file {:s} has no valid sudoku's grid description".format(n, filename,))
|
||||
usage()
|
||||
print('Sudoku to solve')
|
||||
grid.pretty_print()
|
||||
sols = sudoku_solver.solve(grid)
|
||||
nb_sols = len(sols)
|
||||
print('Number of solution(s): {:d}'.format(nb_sols))
|
||||
print('--')
|
||||
for i in range(nb_sols):
|
||||
print('Solution {:d}'.format(i + 1))
|
||||
sols[i].pretty_print()
|
||||
print('--')
|
||||
|
||||
exit(0)
|
||||
|
52
Solver/main3.py
Executable file
52
Solver/main3.py
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod: module
|
||||
:author: `Éric W`
|
||||
:date: 2016, october
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
def usage():
|
||||
print('Usage: {:s} <bdd>'.format(sys.argv[0]))
|
||||
print('where')
|
||||
print('\t<bdd> is a text file whose lines are valid sudoku grids descriptions')
|
||||
exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import sudoku_grid, sudoku_solver
|
||||
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print('Argument missing.')
|
||||
usage()
|
||||
else:
|
||||
filename = sys.argv[1]
|
||||
try:
|
||||
with open(filename, 'r') as input:
|
||||
lines = input.readlines()
|
||||
except FileNotFoundError:
|
||||
print('No such file {:s}'.format(filename))
|
||||
usage()
|
||||
with open(filename+'.sol', 'w') as output:
|
||||
for line in lines:
|
||||
line = line.rstrip('\n')
|
||||
output.write(line + ':')
|
||||
strgrid = line.split(':')[-1]
|
||||
grid = sudoku_grid.SudokuGrid(strgrid)
|
||||
sols = sudoku_solver.solve(grid)
|
||||
nb_sols = len(sols)
|
||||
if nb_sols == 1:
|
||||
output.write('y:')
|
||||
else:
|
||||
output.write('n:')
|
||||
sols = ':'.join(str(sol) for sol in sols)
|
||||
output.write(sols + '\n')
|
||||
|
||||
exit(0)
|
||||
|
74
Solver/main4.py
Executable file
74
Solver/main4.py
Executable file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod: module
|
||||
:author: `Éric W`
|
||||
:date: 2016, october
|
||||
|
||||
"""
|
||||
|
||||
GRID='''
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
'''
|
||||
|
||||
def usage():
|
||||
print('Usage: {:s} <grid> <dot_filename>'.format(sys.argv[0]))
|
||||
print('where\n\t<grid> is a 81 characters string describing a valid sudoku grid')
|
||||
print('\t<dot_filename> is the name of the file containing the resolution\'s tree description')
|
||||
print('\nExample: with the grid')
|
||||
print(GRID)
|
||||
print('$ {:s} 906028003040500001080900040600000070008206900030000005050003060100002080200870500 tree_resolution'.format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys, os
|
||||
import sudoku_grid, sudoku_solver
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
usage()
|
||||
else:
|
||||
strgrid = sys.argv[1]
|
||||
try:
|
||||
grid = sudoku_grid.SudokuGrid(strgrid)
|
||||
except sudoku_grid.SudokuGridError:
|
||||
usage()
|
||||
filename = sys.argv[2]
|
||||
print('Sudoku to solve')
|
||||
grid.pretty_print()
|
||||
with open(filename + '.dot', 'w') as output:
|
||||
node = 'START'
|
||||
output.write(
|
||||
'''/*
|
||||
Resolution tree for sudoku number
|
||||
*/
|
||||
digraph T {{
|
||||
\tbgcolor="#FFFF00";
|
||||
\tnode[style=filled];
|
||||
\t{:s}[shape=hexagon, fillcolor="#FF0000"];
|
||||
'''.format(node))
|
||||
sols = sudoku_solver.solve(grid, output, node)
|
||||
output.write('}\n')
|
||||
nb_sols = len(sols)
|
||||
print('Number of solution(s): {:d}'.format(nb_sols))
|
||||
print('--')
|
||||
for i in range(nb_sols):
|
||||
print('Solution {:d}'.format(i + 1))
|
||||
sols[i].pretty_print()
|
||||
print('--')
|
||||
|
||||
os.system('dot -Tpng -o {0:s}.png {0:s}.dot'.format(filename))
|
||||
exit(0)
|
||||
|
226
Solver/sudoku_grid.py
Normal file
226
Solver/sudoku_grid.py
Normal file
@ -0,0 +1,226 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod:`sudoku_grid` module
|
||||
:author: `Éric W`
|
||||
:date: 2016, october
|
||||
|
||||
Module for internal representation of Sudoku grids.
|
||||
|
||||
:Provides:
|
||||
|
||||
* a class SudokuGrid
|
||||
|
||||
:Examples: with the sudoku grid
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
|
||||
|
||||
>>> strgrid = '906028003040500001080900040600000070008206900030000005050003060100002080200870500'
|
||||
>>> grid = SudokuGrid(strgrid)
|
||||
>>> str(grid) == strgrid
|
||||
True
|
||||
>>> grid[4, 6]
|
||||
'9'
|
||||
>>> grid.get_row(2)
|
||||
'080900040'
|
||||
>>> grid.get_col(1)
|
||||
'048003500'
|
||||
>>> grid.get_square(4, 7)
|
||||
'070900005'
|
||||
>>> grid[1, 5]
|
||||
'0'
|
||||
>>> grid.is_empty_cell(1, 5)
|
||||
True
|
||||
>>> grid.is_empty_cell(4, 6)
|
||||
False
|
||||
>>> grid[1, 5] = '7'
|
||||
>>> grid.pretty_print()
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . 7 | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
"""
|
||||
|
||||
_SYMBOLS_SET = set('0123456789')
|
||||
|
||||
EMPTY_SYMBOL = '0'
|
||||
|
||||
_LINE_SEP = ('+' + '-' * 7) * 3 + '+'
|
||||
_LINE_TO_FILL = '| {} {} {} ' * 3 + '|'
|
||||
|
||||
|
||||
class SudokuGridError(Exception):
|
||||
"""
|
||||
Exception for bad description of sudokus grids
|
||||
"""
|
||||
def __init__(self, msg):
|
||||
self.message = msg
|
||||
|
||||
class SudokuGrid():
|
||||
|
||||
def _is_valid(block):
|
||||
"""
|
||||
predicate for block validation
|
||||
"""
|
||||
return all(block.count(c) <= 1 for c in _SYMBOLS_SET if c != EMPTY_SYMBOL)
|
||||
|
||||
def __init__(self, grid):
|
||||
"""
|
||||
:param grid: a string of 81 characters in ['0'-'9'] describing a sudoku.
|
||||
'0' for an empty cell of the grid.
|
||||
:type grid: str
|
||||
:UC: grid must be of length 81 and contains only characters in ['0'-'9'].
|
||||
"""
|
||||
if not type(grid) in (str, tuple, list):
|
||||
raise SudokuGridError('grid must be a str or tuple or list')
|
||||
if len(grid) != 81:
|
||||
raise SudokuGridError('grid must be of length 81')
|
||||
if not set(grid).issubset(_SYMBOLS_SET):
|
||||
raise SudokuGridError("grid must contain only characters in ['0'-'9']")
|
||||
if not all(SudokuGrid._is_valid(grid[9*r:9*(r+1)]) for r in range(9)):
|
||||
raise SudokuGridError('a row is not valid')
|
||||
if not all(SudokuGrid._is_valid(''.join(grid[c + 9*r] for c in range(9))) for r in range(9)):
|
||||
raise SudokuGridError('a col is not valid')
|
||||
if not all(SudokuGrid._is_valid(''.join(grid[9*(3*blockrow + r) + 3*blockcol + c]
|
||||
for r in range(3) for c in range(3)))
|
||||
for blockrow in range(3) for blockcol in range(3)):
|
||||
raise SudokuGridError('a square block is not valid')
|
||||
self._grid = list(c for c in grid)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
:return: a string representation of self
|
||||
"""
|
||||
return ''.join(c for c in self._grid)
|
||||
|
||||
def __getitem__(self, coord):
|
||||
"""
|
||||
:return: value of cell of coordinate coord=(row, col)
|
||||
:rtype: str
|
||||
:UC: coord must be a tuple of two valid coordinates
|
||||
"""
|
||||
try:
|
||||
row, col = coord
|
||||
assert 0 <= row < 9
|
||||
assert 0 <= col < 9
|
||||
return self._grid[9 * row + col]
|
||||
except:
|
||||
raise SudokuGridError('coord must be a tuple of two valid coordinates')
|
||||
|
||||
def __setitem__(self, coord, value):
|
||||
"""
|
||||
:return: value of cell of coordinate coord=(row, col)
|
||||
:rtype: str
|
||||
:UC: coord must be a tuple of two valid coordinates
|
||||
"""
|
||||
if not value in _SYMBOLS_SET:
|
||||
raise SudokuGridError("new value must be in ['0'..'9']")
|
||||
try:
|
||||
row, col = coord
|
||||
assert 0 <= row < 9
|
||||
assert 0 <= col < 9
|
||||
old_value = self._grid[9 * row + col]
|
||||
self._grid[9 * row + col] = value
|
||||
except:
|
||||
raise SudokuGridError('coord must be a tuple of two valid coordinates')
|
||||
if not (SudokuGrid._is_valid(self.get_row(row)) and
|
||||
SudokuGrid._is_valid(self.get_col(col)) and
|
||||
SudokuGrid._is_valid(self.get_square(row, col))):
|
||||
self._grid[9 * row + col] = old_value
|
||||
raise SudokuGridError("value violate the grid's validity")
|
||||
|
||||
def get_row(self, row):
|
||||
"""
|
||||
:param row: row number to select
|
||||
:type row: int
|
||||
:return: value of the row `row` of `grid`
|
||||
:rtype: str
|
||||
:UC: 0 <= row < 9
|
||||
"""
|
||||
if not (0 <= row < 9):
|
||||
raise SudokuGridError('row must be in [0, 9[')
|
||||
return ''.join(self[row, col] for col in range(9))
|
||||
|
||||
def get_col(self, col):
|
||||
"""
|
||||
:param col: col number to select
|
||||
:type col: int
|
||||
:return: value of the col `col` of `grid`
|
||||
:rtype: str
|
||||
:UC: 0 <= col < 9
|
||||
"""
|
||||
if not (0 <= col < 9):
|
||||
raise SudokuGridError('col must be in [0, 9[')
|
||||
return "".join([self[row, col] for row in range(9)])
|
||||
|
||||
def get_square(self, row, col):
|
||||
"""
|
||||
:param row: row number of the cell in the square_block to select
|
||||
:type row: int
|
||||
:param col: col number of the cell in the block to select
|
||||
:type col: int
|
||||
:return: value of block in containing the cell (`row`, `col`)
|
||||
:rtype: str
|
||||
:UC: 0 <= row < 9, 0<= col < 9
|
||||
"""
|
||||
if not (0 <= row < 9):
|
||||
raise SudokuGridError('row must be in [0, 9[')
|
||||
if not (0 <= col < 9):
|
||||
raise SudokuGridError('col must be in [0, 9[')
|
||||
firstrow = 3 * (row // 3)
|
||||
firstcol = 3 * (col // 3)
|
||||
return "".join(self[firstrow + i, firstcol + j]
|
||||
for i in range(3) for j in range(3))
|
||||
|
||||
def is_empty_cell(grid, row, col):
|
||||
"""
|
||||
:param row: row number of the cell to test
|
||||
:type row: int
|
||||
:param col: col number of the cell to test
|
||||
:type col: int
|
||||
:return: True if cell (`row`, `col`) is empty, False otherwise
|
||||
:rtype: bool
|
||||
:UC: 0 <= row < 9, 0<= col < 9
|
||||
"""
|
||||
return grid[row, col] == EMPTY_SYMBOL
|
||||
|
||||
def pretty_print(self):
|
||||
for row in range(9):
|
||||
if row % 3 == 0: print(_LINE_SEP)
|
||||
print(_LINE_TO_FILL.format(*self.get_row(row).replace(EMPTY_SYMBOL, '.')))
|
||||
print(_LINE_SEP)
|
||||
|
||||
def copy(self):
|
||||
return SudokuGrid(str(self))
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod ()
|
||||
|
||||
|
82
Solver/sudoku_printer.py
Normal file
82
Solver/sudoku_printer.py
Normal file
@ -0,0 +1,82 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod:`sudoku_printer` module
|
||||
|
||||
:author: `FIL - IEEA - Univ. Lille1.fr <http://portail.fil.univ-lille1.fr>`_
|
||||
|
||||
:date: 2016, october
|
||||
|
||||
:Provides:
|
||||
|
||||
* print
|
||||
|
||||
:Example: with the grid
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
|
||||
>>> import sudoku_grid
|
||||
>>> strgrid = '906028003040500001080900040600000070008206900030000005050003060100002080200870500'
|
||||
>>> grid = sudoku_grid.from_string(strgrid)
|
||||
>>> print(grid)
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
"""
|
||||
|
||||
import builtins
|
||||
import sudoku_grid
|
||||
|
||||
LINE_SEP = ('+' + '-' * 7) * 3 + '+'
|
||||
LINE_TO_FILL = '| {} {} {} ' * 3 + '|'
|
||||
|
||||
def print(grid):
|
||||
for r in range(9):
|
||||
if r % 3 == 0: builtins.print(LINE_SEP)
|
||||
row = sudoku_grid.get_row(grid, r).replace(sudoku_grid.EMPTY_SYMBOL, '.')
|
||||
builtins.print(LINE_TO_FILL.format(*row))
|
||||
builtins.print(LINE_SEP)
|
||||
|
||||
def reset():
|
||||
builtins.print("\x1b[2J", end='')
|
||||
|
||||
def color_print(grid):
|
||||
reset()
|
||||
for r in range(9):
|
||||
if r % 3 == 0: builtins.print(LINE_SEP)
|
||||
row = sudoku_grid.get_row(grid, r).replace(sudoku_grid.EMPTY_SYMBOL, '.')
|
||||
builtins.print(LINE_TO_FILL.format(*row))
|
||||
builtins.print(LINE_SEP)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod ()
|
||||
|
||||
|
||||
|
163
Solver/sudoku_solver.py
Normal file
163
Solver/sudoku_solver.py
Normal file
@ -0,0 +1,163 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
:mod:`sudoku_solver` module
|
||||
:author: `Éric W`
|
||||
:date: 2016, october
|
||||
|
||||
:Provides:
|
||||
|
||||
* a function `solve` to solve sudoku grids
|
||||
|
||||
:Example: with the following sudoku grid
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | 5 . . |
|
||||
+-------+-------+-------+
|
||||
|
||||
and second with the grid
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
+-------+-------+-------+
|
||||
| 9 . 6 | . 2 8 | . . 3 |
|
||||
| . 4 . | 5 . . | . . 1 |
|
||||
| . 8 . | 9 . . | . 4 . |
|
||||
+-------+-------+-------+
|
||||
| 6 . . | . . . | . 7 . |
|
||||
| . . 8 | 2 . 6 | 9 . . |
|
||||
| . 3 . | . . . | . . 5 |
|
||||
+-------+-------+-------+
|
||||
| . 5 . | . . 3 | . 6 . |
|
||||
| 1 . . | . . 2 | . 8 . |
|
||||
| 2 . . | 8 7 . | . . . |
|
||||
+-------+-------+-------+
|
||||
|
||||
>>> from sudoku_grid import SudokuGrid
|
||||
>>> strgrid = '906028003040500001080900040600000070008206900030000005050003060100002080200870500'
|
||||
>>> grid = SudokuGrid(strgrid)
|
||||
>>> solved_grid = solve(grid)
|
||||
>>> len(solved_grid)
|
||||
1
|
||||
>>> solved_grid[0].pretty_print()
|
||||
+-------+-------+-------+
|
||||
| 9 1 6 | 4 2 8 | 7 5 3 |
|
||||
| 3 4 2 | 5 6 7 | 8 9 1 |
|
||||
| 7 8 5 | 9 3 1 | 2 4 6 |
|
||||
+-------+-------+-------+
|
||||
| 6 2 9 | 3 4 5 | 1 7 8 |
|
||||
| 5 7 8 | 2 1 6 | 9 3 4 |
|
||||
| 4 3 1 | 7 8 9 | 6 2 5 |
|
||||
+-------+-------+-------+
|
||||
| 8 5 7 | 1 9 3 | 4 6 2 |
|
||||
| 1 9 4 | 6 5 2 | 3 8 7 |
|
||||
| 2 6 3 | 8 7 4 | 5 1 9 |
|
||||
+-------+-------+-------+
|
||||
"""
|
||||
|
||||
import time
|
||||
from sudoku_grid import SudokuGrid, EMPTY_SYMBOL
|
||||
|
||||
def __possible_values(s):
|
||||
"""
|
||||
"""
|
||||
return "".join(c for c in '123456789' if c not in s)
|
||||
|
||||
|
||||
def __grid_exam(grid):
|
||||
"""
|
||||
"""
|
||||
ROWS = [grid.get_row(r) for r in range(9)]
|
||||
COLS = [grid.get_col(c) for c in range(9)]
|
||||
SQUARES = [grid.get_square(3*r, 3*c) for r in range(3) for c in range(3)]
|
||||
poss_min, coord_min = '0123456789', (-1, -1)
|
||||
for r in range(9):
|
||||
for c in range(9):
|
||||
if grid.is_empty_cell(r, c):
|
||||
poss = __possible_values(ROWS[r] + COLS[c] + SQUARES[3 * (r // 3) + (c // 3)])
|
||||
if len(poss) < len(poss_min):
|
||||
poss_min = poss
|
||||
coord_min = (r, c)
|
||||
return poss_min, coord_min
|
||||
|
||||
def __is_solved(grid):
|
||||
"""
|
||||
:param grid: a Sudoku grid
|
||||
:typr grid: sudoku_grid.grid
|
||||
:return: `True` if the grid is solved, `False` otherwise
|
||||
:rtype: bool
|
||||
:UC: none
|
||||
"""
|
||||
return not any(grid.is_empty_cell(row, col) for row in range(9) for col in range(9))
|
||||
|
||||
def solve(grid, out_channel=None, node=None):
|
||||
"""
|
||||
:param grid: a Sudoku grid to solve
|
||||
:type grid: SudokuGrid
|
||||
:return: list of solutions (solved grids)
|
||||
:rtype: list
|
||||
:UC: none
|
||||
"""
|
||||
if __is_solved(grid):
|
||||
if not out_channel is None:
|
||||
out_channel.write('\t"{:s}"[shape=hexagon, fillcolor="#00FF00"];\n'.format(node))
|
||||
return [grid.copy()]
|
||||
else:
|
||||
maybe, (i, j) = __grid_exam(grid)
|
||||
res = []
|
||||
for c in maybe:
|
||||
if not out_channel is None:
|
||||
label = str((c, i, j))
|
||||
next_node = node + '{:s}{:d}{:d}'.format(c, i, j)
|
||||
out_channel.write('\t"{:s}"[label="{:s}"];\n'.format(next_node, label))
|
||||
out_channel.write('\t"{:s}" -> "{:s}";\n'.format(node, next_node))
|
||||
else:
|
||||
next_node = None
|
||||
grid[i, j] = c
|
||||
res += solve(grid, out_channel, next_node)
|
||||
grid[i, j] = EMPTY_SYMBOL
|
||||
return res
|
||||
|
||||
def solve_one(grid, pause=0):
|
||||
"""
|
||||
:param grid: a Sudoku grid to solve
|
||||
:type grid: sudoku_grid.grid
|
||||
:return: a solution of grid
|
||||
:rtype: sudoku_grid.grid
|
||||
:UC: none
|
||||
"""
|
||||
time.sleep(pause)
|
||||
print("\x1b[2J", end='')
|
||||
grid.pretty_print()
|
||||
if __is_solved(grid):
|
||||
return [grid]
|
||||
else:
|
||||
maybe, (i, j) = __grid_exam(grid)
|
||||
res = None
|
||||
for c in maybe:
|
||||
grid[i, j] = c
|
||||
res = solve_one(grid, pause)
|
||||
if not res is None:
|
||||
return res
|
||||
return res
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod ()
|
||||
|
||||
|
331
Solver/sudokufiendish.dot
Normal file
331
Solver/sudokufiendish.dot
Normal file
@ -0,0 +1,331 @@
|
||||
/*
|
||||
Resolution tree for sudoku number
|
||||
*/
|
||||
digraph T {
|
||||
bgcolor="#FFFF00";
|
||||
node[style=filled];
|
||||
START[shape=hexagon, fillcolor="#FF0000"];
|
||||
"START412"[label="('4', 1, 2)"];
|
||||
"START" -> "START412";
|
||||
"START412702"[label="('7', 0, 2)"];
|
||||
"START412" -> "START412702";
|
||||
"START412702301"[label="('3', 0, 1)"];
|
||||
"START412702" -> "START412702301";
|
||||
"START412702301103"[label="('1', 0, 3)"];
|
||||
"START412702301" -> "START412702301103";
|
||||
"START412702301103605"[label="('6', 0, 5)"];
|
||||
"START412702301103" -> "START412702301103605";
|
||||
"START412702301603"[label="('6', 0, 3)"];
|
||||
"START412702301" -> "START412702301603";
|
||||
"START412702301603105"[label="('1', 0, 5)"];
|
||||
"START412702301603" -> "START412702301603105";
|
||||
"START412702901"[label="('9', 0, 1)"];
|
||||
"START412702" -> "START412702901";
|
||||
"START412702901522"[label="('5', 2, 2)"];
|
||||
"START412702901" -> "START412702901522";
|
||||
"START412702901522321"[label="('3', 2, 1)"];
|
||||
"START412702901522" -> "START412702901522321";
|
||||
"START412702901522321262"[label="('2', 6, 2)"];
|
||||
"START412702901522321" -> "START412702901522321262";
|
||||
"START412702901522321262942"[label="('9', 4, 2)"];
|
||||
"START412702901522321262" -> "START412702901522321262942";
|
||||
"START412702901522321262942105"[label="('1', 0, 5)"];
|
||||
"START412702901522321262942" -> "START412702901522321262942105";
|
||||
"START412702901522321262942105303"[label="('3', 0, 3)"];
|
||||
"START412702901522321262942105" -> "START412702901522321262942105303";
|
||||
"START412702901522321262942105303608"[label="('6', 0, 8)"];
|
||||
"START412702901522321262942105303" -> "START412702901522321262942105303608";
|
||||
"START412702901522321262942105303608610"[label="('6', 1, 0)"];
|
||||
"START412702901522321262942105303608" -> "START412702901522321262942105303608610";
|
||||
"START412702901522321262942105303608610820"[label="('8', 2, 0)"];
|
||||
"START412702901522321262942105303608610" -> "START412702901522321262942105303608610820";
|
||||
"START412702901522321262942105303608610820624"[label="('6', 2, 4)"];
|
||||
"START412702901522321262942105303608610820" -> "START412702901522321262942105303608610820624";
|
||||
"START412702901522321262942105303608610820624223"[label="('2', 2, 3)"];
|
||||
"START412702901522321262942105303608610820624" -> "START412702901522321262942105303608610820624223";
|
||||
"START412702901522321262942105303608610820624223815"[label="('8', 1, 5)"];
|
||||
"START412702901522321262942105303608610820624223" -> "START412702901522321262942105303608610820624223815";
|
||||
"START412702901522321262942105303608610820624223815128"[label="('1', 2, 8)"];
|
||||
"START412702901522321262942105303608610820624223815" -> "START412702901522321262942105303608610820624223815128";
|
||||
"START412702901522321262942105303608610820624223815128478"[label="('4', 7, 8)"];
|
||||
"START412702901522321262942105303608610820624223815128" -> "START412702901522321262942105303608610820624223815128478";
|
||||
"START412702901522321262942105303608610820624223815128478858"[label="('8', 5, 8)"];
|
||||
"START412702901522321262942105303608610820624223815128478" -> "START412702901522321262942105303608610820624223815128478858";
|
||||
"START412702901522321262942105303608610820624223815128478858454"[label="('4', 5, 4)"];
|
||||
"START412702901522321262942105303608610820624223815128478858" -> "START412702901522321262942105303608610820624223815128478858454";
|
||||
"START412702901522321262942105303608610820624223815128478858454553"[label="('5', 5, 3)"];
|
||||
"START412702901522321262942105303608610820624223815128478858454" -> "START412702901522321262942105303608610820624223815128478858454553";
|
||||
"START412702901522321262942105303608610820624223815128478858454553633"[label="('6', 3, 3)"];
|
||||
"START412702901522321262942105303608610820624223815128478858454553" -> "START412702901522321262942105303608610820624223815128478858454553633";
|
||||
"START412702901522321262942105303608810"[label="('8', 1, 0)"];
|
||||
"START412702901522321262942105303608" -> "START412702901522321262942105303608810";
|
||||
"START412702901522321262942105303608810620"[label="('6', 2, 0)"];
|
||||
"START412702901522321262942105303608810" -> "START412702901522321262942105303608810620";
|
||||
"START412702901522321262942105303608810620824"[label="('8', 2, 4)"];
|
||||
"START412702901522321262942105303608810620" -> "START412702901522321262942105303608810620824";
|
||||
"START412702901522321262942105303608810620824223"[label="('2', 2, 3)"];
|
||||
"START412702901522321262942105303608810620824" -> "START412702901522321262942105303608810620824223";
|
||||
"START412702901522321262942105303608810620824223615"[label="('6', 1, 5)"];
|
||||
"START412702901522321262942105303608810620824223" -> "START412702901522321262942105303608810620824223615";
|
||||
"START412702901522321262942105303608810620824223615128"[label="('1', 2, 8)"];
|
||||
"START412702901522321262942105303608810620824223615" -> "START412702901522321262942105303608810620824223615128";
|
||||
"START412702901522321262942105303608810620824223615128454"[label="('4', 5, 4)"];
|
||||
"START412702901522321262942105303608810620824223615128" -> "START412702901522321262942105303608810620824223615128454";
|
||||
"START412702901522321262942105303608810620824223615128454858"[label="('8', 5, 8)"];
|
||||
"START412702901522321262942105303608810620824223615128454" -> "START412702901522321262942105303608810620824223615128454858";
|
||||
"START412702901522321262942105303608810620824223615128454858553"[label="('5', 5, 3)"];
|
||||
"START412702901522321262942105303608810620824223615128454858" -> "START412702901522321262942105303608810620824223615128454858553";
|
||||
"START412702901522321262942105303608810620824223615128454858553633"[label="('6', 3, 3)"];
|
||||
"START412702901522321262942105303608810620824223615128454858553" -> "START412702901522321262942105303608810620824223615128454858553633";
|
||||
"START412702901522321262942105303608810620824223615128454858553633735"[label="('7', 3, 5)"];
|
||||
"START412702901522321262942105303608810620824223615128454858553633" -> "START412702901522321262942105303608810620824223615128454858553633735";
|
||||
"START412702901522321262942105603"[label="('6', 0, 3)"];
|
||||
"START412702901522321262942105" -> "START412702901522321262942105603";
|
||||
"START412702901522321262942105603308"[label="('3', 0, 8)"];
|
||||
"START412702901522321262942105603" -> "START412702901522321262942105603308";
|
||||
"START412702901522321262942105603308824"[label="('8', 2, 4)"];
|
||||
"START412702901522321262942105603308" -> "START412702901522321262942105603308824";
|
||||
"START412702901522321262942105603308824215"[label="('2', 1, 5)"];
|
||||
"START412702901522321262942105603308824" -> "START412702901522321262942105603308824215";
|
||||
"START412702901522321262942605"[label="('6', 0, 5)"];
|
||||
"START412702901522321262942" -> "START412702901522321262942605";
|
||||
"START412702901522321262942605824"[label="('8', 2, 4)"];
|
||||
"START412702901522321262942605" -> "START412702901522321262942605824";
|
||||
"START412702901522321262942605824215"[label="('2', 1, 5)"];
|
||||
"START412702901522321262942605824" -> "START412702901522321262942605824215";
|
||||
"START412702901522321262942605824215620"[label="('6', 2, 0)"];
|
||||
"START412702901522321262942605824215" -> "START412702901522321262942605824215620";
|
||||
"START412702901522321262942605824215620810"[label="('8', 1, 0)"];
|
||||
"START412702901522321262942605824215620" -> "START412702901522321262942605824215620810";
|
||||
"START412702901522321262942605824215620810123"[label="('1', 2, 3)"];
|
||||
"START412702901522321262942605824215620810" -> "START412702901522321262942605824215620810123";
|
||||
"START412702901522321262942605824215620810123303"[label="('3', 0, 3)"];
|
||||
"START412702901522321262942605824215620810123" -> "START412702901522321262942605824215620810123303";
|
||||
"START412702901522321262942605824215620810123303108"[label="('1', 0, 8)"];
|
||||
"START412702901522321262942605824215620810123303" -> "START412702901522321262942605824215620810123303108";
|
||||
"START412702901522321262942605824215620810123303108228"[label="('2', 2, 8)"];
|
||||
"START412702901522321262942605824215620810123303108" -> "START412702901522321262942605824215620810123303108228";
|
||||
"START412702901522321262942605824215620810123303108228454"[label="('4', 5, 4)"];
|
||||
"START412702901522321262942605824215620810123303108228" -> "START412702901522321262942605824215620810123303108228454";
|
||||
"START412702901522321262942605824215620810123303108228454858"[label="('8', 5, 8)"];
|
||||
"START412702901522321262942605824215620810123303108228454" -> "START412702901522321262942605824215620810123303108228454858";
|
||||
"START412702901522321262942605824215620810123303108228454858317"[label="('3', 1, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858" -> "START412702901522321262942605824215620810123303108228454858317";
|
||||
"START412702901522321262942605824215620810123303108228454858317618"[label="('6', 1, 8)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317" -> "START412702901522321262942605824215620810123303108228454858317618";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478"[label="('4', 7, 8)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618" -> "START412702901522321262942605824215620810123303108228454858317618478";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368"[label="('3', 6, 8)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478" -> "START412702901522321262942605824215620810123303108228454858317618478368";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771"[label="('7', 7, 1)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368" -> "START412702901522321262942605824215620810123303108228454858317618478368771";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673"[label="('6', 7, 3)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771" -> "START412702901522321262942605824215620810123303108228454858317618478368771673";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533"[label="('5', 3, 3)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430"[label="('4', 3, 0)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735"[label="('7', 3, 5)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637"[label="('6', 3, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334"[label="('3', 3, 4)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241"[label="('2', 4, 1)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843"[label="('8', 4, 3)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644"[label="('6', 4, 4)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145"[label="('1', 4, 5)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747"[label="('7', 4, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927"[label="('9', 2, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726"[label="('7', 2, 6)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446"[label="('4', 4, 6)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551"[label="('5', 5, 1)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253"[label="('2', 5, 3)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955"[label="('9', 5, 5)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461"[label="('4', 6, 1)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764"[label="('7', 6, 4)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867"[label="('8', 6, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565"[label="('5', 6, 5)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160"[label="('1', 6, 0)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666"[label="('6', 6, 6)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970"[label="('9', 7, 0)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176"[label="('1', 7, 6)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580"[label="('5', 8, 0)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483"[label="('4', 8, 3)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885"[label="('8', 8, 5)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986"[label="('9', 8, 6)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986287"[label="('2', 8, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986" -> "START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986287";
|
||||
"START412702901522321262942605824215620810123303108228454858317618478368771673533430735637334241843644145747927726446551253955461764867565160666970176580483885986287"[shape=hexagon, fillcolor="#00FF00"];
|
||||
"START412702901522321262942605824215620810123303108228454858617"[label="('6', 1, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858" -> "START412702901522321262942605824215620810123303108228454858617";
|
||||
"START412702901522321262942605824215620810123303108228454858617318"[label="('3', 1, 8)"];
|
||||
"START412702901522321262942605824215620810123303108228454858617" -> "START412702901522321262942605824215620810123303108228454858617318";
|
||||
"START412702901522321262942605824215620810123303108228454858617318737"[label="('7', 3, 7)"];
|
||||
"START412702901522321262942605824215620810123303108228454858617318" -> "START412702901522321262942605824215620810123303108228454858617318737";
|
||||
"START412902"[label="('9', 0, 2)"];
|
||||
"START412" -> "START412902";
|
||||
"START412902242"[label="('2', 4, 2)"];
|
||||
"START412902" -> "START412902242";
|
||||
"START412902242301"[label="('3', 0, 1)"];
|
||||
"START412902242" -> "START412902242301";
|
||||
"START412902242301103"[label="('1', 0, 3)"];
|
||||
"START412902242301" -> "START412902242301103";
|
||||
"START412902242301103605"[label="('6', 0, 5)"];
|
||||
"START412902242301103" -> "START412902242301103605";
|
||||
"START412902242301603"[label="('6', 0, 3)"];
|
||||
"START412902242301" -> "START412902242301603";
|
||||
"START412902242301603105"[label="('1', 0, 5)"];
|
||||
"START412902242301603" -> "START412902242301603105";
|
||||
"START412902242701"[label="('7', 0, 1)"];
|
||||
"START412902242" -> "START412902242701";
|
||||
"START412902242701522"[label="('5', 2, 2)"];
|
||||
"START412902242701" -> "START412902242701522";
|
||||
"START412902242701522321"[label="('3', 2, 1)"];
|
||||
"START412902242701522" -> "START412902242701522321";
|
||||
"START412902242701522321762"[label="('7', 6, 2)"];
|
||||
"START412902242701522321" -> "START412902242701522321762";
|
||||
"START412902242701522321762105"[label="('1', 0, 5)"];
|
||||
"START412902242701522321762" -> "START412902242701522321762105";
|
||||
"START412902242701522321762105303"[label="('3', 0, 3)"];
|
||||
"START412902242701522321762105" -> "START412902242701522321762105303";
|
||||
"START412902242701522321762105303608"[label="('6', 0, 8)"];
|
||||
"START412902242701522321762105303" -> "START412902242701522321762105303608";
|
||||
"START412902242701522321762105303608610"[label="('6', 1, 0)"];
|
||||
"START412902242701522321762105303608" -> "START412902242701522321762105303608610";
|
||||
"START412902242701522321762105303608610820"[label="('8', 2, 0)"];
|
||||
"START412902242701522321762105303608610" -> "START412902242701522321762105303608610820";
|
||||
"START412902242701522321762105303608610820624"[label="('6', 2, 4)"];
|
||||
"START412902242701522321762105303608610820" -> "START412902242701522321762105303608610820624";
|
||||
"START412902242701522321762105303608610820624223"[label="('2', 2, 3)"];
|
||||
"START412902242701522321762105303608610820624" -> "START412902242701522321762105303608610820624223";
|
||||
"START412902242701522321762105303608610820624223815"[label="('8', 1, 5)"];
|
||||
"START412902242701522321762105303608610820624223" -> "START412902242701522321762105303608610820624223815";
|
||||
"START412902242701522321762105303608610820624223815128"[label="('1', 2, 8)"];
|
||||
"START412902242701522321762105303608610820624223815" -> "START412902242701522321762105303608610820624223815128";
|
||||
"START412902242701522321762105303608610820624223815128478"[label="('4', 7, 8)"];
|
||||
"START412902242701522321762105303608610820624223815128" -> "START412902242701522321762105303608610820624223815128478";
|
||||
"START412902242701522321762105303608610820624223815128478858"[label="('8', 5, 8)"];
|
||||
"START412902242701522321762105303608610820624223815128478" -> "START412902242701522321762105303608610820624223815128478858";
|
||||
"START412902242701522321762105303608610820624223815128478858454"[label="('4', 5, 4)"];
|
||||
"START412902242701522321762105303608610820624223815128478858" -> "START412902242701522321762105303608610820624223815128478858454";
|
||||
"START412902242701522321762105303608610820624223815128478858454553"[label="('5', 5, 3)"];
|
||||
"START412902242701522321762105303608610820624223815128478858454" -> "START412902242701522321762105303608610820624223815128478858454553";
|
||||
"START412902242701522321762105303608610820624223815128478858454553633"[label="('6', 3, 3)"];
|
||||
"START412902242701522321762105303608610820624223815128478858454553" -> "START412902242701522321762105303608610820624223815128478858454553633";
|
||||
"START412902242701522321762105303608810"[label="('8', 1, 0)"];
|
||||
"START412902242701522321762105303608" -> "START412902242701522321762105303608810";
|
||||
"START412902242701522321762105303608810620"[label="('6', 2, 0)"];
|
||||
"START412902242701522321762105303608810" -> "START412902242701522321762105303608810620";
|
||||
"START412902242701522321762105303608810620824"[label="('8', 2, 4)"];
|
||||
"START412902242701522321762105303608810620" -> "START412902242701522321762105303608810620824";
|
||||
"START412902242701522321762105303608810620824223"[label="('2', 2, 3)"];
|
||||
"START412902242701522321762105303608810620824" -> "START412902242701522321762105303608810620824223";
|
||||
"START412902242701522321762105303608810620824223615"[label="('6', 1, 5)"];
|
||||
"START412902242701522321762105303608810620824223" -> "START412902242701522321762105303608810620824223615";
|
||||
"START412902242701522321762105303608810620824223615128"[label="('1', 2, 8)"];
|
||||
"START412902242701522321762105303608810620824223615" -> "START412902242701522321762105303608810620824223615128";
|
||||
"START412902242701522321762105303608810620824223615128454"[label="('4', 5, 4)"];
|
||||
"START412902242701522321762105303608810620824223615128" -> "START412902242701522321762105303608810620824223615128454";
|
||||
"START412902242701522321762105303608810620824223615128454858"[label="('8', 5, 8)"];
|
||||
"START412902242701522321762105303608810620824223615128454" -> "START412902242701522321762105303608810620824223615128454858";
|
||||
"START412902242701522321762105303608810620824223615128454858553"[label="('5', 5, 3)"];
|
||||
"START412902242701522321762105303608810620824223615128454858" -> "START412902242701522321762105303608810620824223615128454858553";
|
||||
"START412902242701522321762105303608810620824223615128454858553633"[label="('6', 3, 3)"];
|
||||
"START412902242701522321762105303608810620824223615128454858553" -> "START412902242701522321762105303608810620824223615128454858553633";
|
||||
"START412902242701522321762105303608810620824223615128454858553633735"[label="('7', 3, 5)"];
|
||||
"START412902242701522321762105303608810620824223615128454858553633" -> "START412902242701522321762105303608810620824223615128454858553633735";
|
||||
"START412902242701522321762105603"[label="('6', 0, 3)"];
|
||||
"START412902242701522321762105" -> "START412902242701522321762105603";
|
||||
"START412902242701522321762105603308"[label="('3', 0, 8)"];
|
||||
"START412902242701522321762105603" -> "START412902242701522321762105603308";
|
||||
"START412902242701522321762105603308824"[label="('8', 2, 4)"];
|
||||
"START412902242701522321762105603308" -> "START412902242701522321762105603308824";
|
||||
"START412902242701522321762105603308824215"[label="('2', 1, 5)"];
|
||||
"START412902242701522321762105603308824" -> "START412902242701522321762105603308824215";
|
||||
"START412902242701522321762605"[label="('6', 0, 5)"];
|
||||
"START412902242701522321762" -> "START412902242701522321762605";
|
||||
"START412902242701522321762605824"[label="('8', 2, 4)"];
|
||||
"START412902242701522321762605" -> "START412902242701522321762605824";
|
||||
"START412902242701522321762605824215"[label="('2', 1, 5)"];
|
||||
"START412902242701522321762605824" -> "START412902242701522321762605824215";
|
||||
"START412902242701522321762605824215620"[label="('6', 2, 0)"];
|
||||
"START412902242701522321762605824215" -> "START412902242701522321762605824215620";
|
||||
"START412902242701522321762605824215620810"[label="('8', 1, 0)"];
|
||||
"START412902242701522321762605824215620" -> "START412902242701522321762605824215620810";
|
||||
"START412902242701522321762605824215620810123"[label="('1', 2, 3)"];
|
||||
"START412902242701522321762605824215620810" -> "START412902242701522321762605824215620810123";
|
||||
"START412902242701522321762605824215620810123303"[label="('3', 0, 3)"];
|
||||
"START412902242701522321762605824215620810123" -> "START412902242701522321762605824215620810123303";
|
||||
"START412902242701522321762605824215620810123303108"[label="('1', 0, 8)"];
|
||||
"START412902242701522321762605824215620810123303" -> "START412902242701522321762605824215620810123303108";
|
||||
"START412902242701522321762605824215620810123303108228"[label="('2', 2, 8)"];
|
||||
"START412902242701522321762605824215620810123303108" -> "START412902242701522321762605824215620810123303108228";
|
||||
"START412902242701522321762605824215620810123303108228454"[label="('4', 5, 4)"];
|
||||
"START412902242701522321762605824215620810123303108228" -> "START412902242701522321762605824215620810123303108228454";
|
||||
"START412902242701522321762605824215620810123303108228454858"[label="('8', 5, 8)"];
|
||||
"START412902242701522321762605824215620810123303108228454" -> "START412902242701522321762605824215620810123303108228454858";
|
||||
"START412902242701522321762605824215620810123303108228454858664"[label="('6', 6, 4)"];
|
||||
"START412902242701522321762605824215620810123303108228454858" -> "START412902242701522321762605824215620810123303108228454858664";
|
||||
"START412902242701522321762605824215620810123303108228454858664744"[label="('7', 4, 4)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664" -> "START412902242701522321762605824215620810123303108228454858664744";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334"[label="('3', 3, 4)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744" -> "START412902242701522321762605824215620810123303108228454858664744334";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535"[label="('5', 3, 5)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334" -> "START412902242701522321762605824215620810123303108228454858664744334535";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430"[label="('4', 3, 0)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535" -> "START412902242701522321762605824215620810123303108228454858664744334535430";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633"[label="('6', 3, 3)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430" -> "START412902242701522321762605824215620810123303108228454858664744334535430633";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737"[label="('7', 3, 7)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927"[label="('9', 2, 7)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726"[label="('7', 2, 6)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941"[label="('9', 4, 1)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843"[label="('8', 4, 3)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145"[label="('1', 4, 5)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647"[label="('6', 4, 7)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317"[label="('3', 1, 7)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618"[label="('6', 1, 8)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446"[label="('4', 4, 6)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551"[label="('5', 5, 1)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253"[label="('2', 5, 3)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253955"[label="('9', 5, 5)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253955";
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253955865"[label="('8', 6, 5)"];
|
||||
"START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253955" -> "START412902242701522321762605824215620810123303108228454858664744334535430633737927726941843145647317618446551253955865";
|
||||
}
|
BIN
Solver/sudokufiendish.png
Normal file
BIN
Solver/sudokufiendish.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 334 KiB |
187
Solver/sudokus_2.dot
Normal file
187
Solver/sudokus_2.dot
Normal file
@ -0,0 +1,187 @@
|
||||
/*
|
||||
Resolution tree for sudoku number
|
||||
*/
|
||||
digraph T {
|
||||
bgcolor="#FFFF00";
|
||||
node[style=filled];
|
||||
START[shape=hexagon, fillcolor="#FF0000"];
|
||||
"START358"[label="('3', 5, 8)"];
|
||||
"START" -> "START358";
|
||||
"START358177"[label="('1', 7, 7)"];
|
||||
"START358" -> "START358177";
|
||||
"START358177778"[label="('7', 7, 8)"];
|
||||
"START358177" -> "START358177778";
|
||||
"START358177778370"[label="('3', 7, 0)"];
|
||||
"START358177778" -> "START358177778370";
|
||||
"START358177778370830"[label="('8', 3, 0)"];
|
||||
"START358177778370" -> "START358177778370830";
|
||||
"START358177778370830637"[label="('6', 3, 7)"];
|
||||
"START358177778370830" -> "START358177778370830637";
|
||||
"START358177778370830637436"[label="('4', 3, 6)"];
|
||||
"START358177778370830637" -> "START358177778370830637436";
|
||||
"START358177778370830637436334"[label="('3', 3, 4)"];
|
||||
"START358177778370830637436" -> "START358177778370830637436334";
|
||||
"START358177778370830637436334240"[label="('2', 4, 0)"];
|
||||
"START358177778370830637436334" -> "START358177778370830637436334240";
|
||||
"START358177778370830637436334240143"[label="('1', 4, 3)"];
|
||||
"START358177778370830637436334240" -> "START358177778370830637436334240143";
|
||||
"START358177778370830637436334240143445"[label="('4', 4, 5)"];
|
||||
"START358177778370830637436334240143" -> "START358177778370830637436334240143445";
|
||||
"START358177778370830637436334240143445544"[label="('5', 4, 4)"];
|
||||
"START358177778370830637436334240143445" -> "START358177778370830637436334240143445544";
|
||||
"START358177778370830637436334240143445544342"[label="('3', 4, 2)"];
|
||||
"START358177778370830637436334240143445544" -> "START358177778370830637436334240143445544342";
|
||||
"START358177778370830637436334240143445544342654"[label="('6', 5, 4)"];
|
||||
"START358177778370830637436334240143445544342" -> "START358177778370830637436334240143445544342654";
|
||||
"START358177778370830637436334240143445544342654673"[label="('6', 7, 3)"];
|
||||
"START358177778370830637436334240143445544342654" -> "START358177778370830637436334240143445544342654673";
|
||||
"START358177778370830637436334240143445544342654673576"[label="('5', 7, 6)"];
|
||||
"START358177778370830637436334240143445544342654673" -> "START358177778370830637436334240143445544342654673576";
|
||||
"START358177778370830637436334240143445544342654673576472"[label="('4', 7, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576" -> "START358177778370830637436334240143445544342654673576472";
|
||||
"START358177778370830637436334240143445544342654673576472102"[label="('1', 0, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472" -> "START358177778370830637436334240143445544342654673576472102";
|
||||
"START358177778370830637436334240143445544342654673576472102804"[label="('8', 0, 4)"];
|
||||
"START358177778370830637436334240143445544342654673576472102" -> "START358177778370830637436334240143445544342654673576472102804";
|
||||
"START358177778370830637436334240143445544342654673576472102804605"[label="('6', 0, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804" -> "START358177778370830637436334240143445544342654673576472102804605";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900"[label="('9', 0, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605" -> "START358177778370830637436334240143445544342654673576472102804605900";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408"[label="('4', 0, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900" -> "START358177778370830637436334240143445544342654673576472102804605900408";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610"[label="('6', 1, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408" -> "START358177778370830637436334240143445544342654673576472102804605900408610";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311"[label="('3', 1, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610" -> "START358177778370830637436334240143445544342654673576472102804605900408610311";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712"[label="('7', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421"[label="('4', 2, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822"[label="('8', 2, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927"[label="('9', 2, 7)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552"[label="('5', 5, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751"[label="('7', 5, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561"[label="('5', 6, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262"[label="('2', 6, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867"[label="('8', 6, 7)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288"[label="('2', 8, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128"[label="('1', 2, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818"[label="('8', 1, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216"[label="('2', 1, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115"[label="('1', 1, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724"[label="('7', 2, 4)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323"[label="('3', 2, 3)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225"[label="('2', 2, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626"[label="('6', 2, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948"[label="('9', 4, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846"[label="('8', 4, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763"[label="('7', 6, 3)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160"[label="('1', 6, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464"[label="('4', 6, 4)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365"[label="('3', 6, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966"[label="('9', 6, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780"[label="('7', 8, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883"[label="('8', 8, 3)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184"[label="('1', 8, 4)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184386"[label="('3', 8, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184" -> "START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184386";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311712421822927552751561262867288128818216115724323225626948846763160464365966780883184386"[shape=hexagon, fillcolor="#00FF00"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311812"[label="('8', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311" -> "START358177778370830637436334240143445544342654673576472102804605900408610311812";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311812216"[label="('2', 1, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311812" -> "START358177778370830637436334240143445544342654673576472102804605900408610311812216";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311812216115"[label="('1', 1, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610311812216" -> "START358177778370830637436334240143445544342654673576472102804605900408610311812216115";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610711"[label="('7', 1, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610" -> "START358177778370830637436334240143445544342654673576472102804605900408610711";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610711812"[label="('8', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408610711" -> "START358177778370830637436334240143445544342654673576472102804605900408610711812";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408710"[label="('7', 1, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408" -> "START358177778370830637436334240143445544342654673576472102804605900408710";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408710311"[label="('3', 1, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408710" -> "START358177778370830637436334240143445544342654673576472102804605900408710311";
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408710311812"[label="('8', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472102804605900408710311" -> "START358177778370830637436334240143445544342654673576472102804605900408710311812";
|
||||
"START358177778370830637436334240143445544342654673576472802"[label="('8', 0, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472" -> "START358177778370830637436334240143445544342654673576472802";
|
||||
"START358177778370830637436334240143445544342654673576472802104"[label="('1', 0, 4)"];
|
||||
"START358177778370830637436334240143445544342654673576472802" -> "START358177778370830637436334240143445544342654673576472802104";
|
||||
"START358177778370830637436334240143445544342654673576472802104605"[label="('6', 0, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104" -> "START358177778370830637436334240143445544342654673576472802104605";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900"[label="('9', 0, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605" -> "START358177778370830637436334240143445544342654673576472802104605900";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408"[label="('4', 0, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900" -> "START358177778370830637436334240143445544342654673576472802104605900408";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311"[label="('3', 1, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408" -> "START358177778370830637436334240143445544342654673576472802104605900408311";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215"[label="('2', 1, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311" -> "START358177778370830637436334240143445544342654673576472802104605900408311215";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325"[label="('3', 2, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165"[label="('1', 6, 5)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760"[label="('7', 6, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561"[label="('5', 6, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751"[label="('7', 5, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421"[label="('4', 2, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552"[label="('5', 5, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262"[label="('2', 6, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180"[label="('1', 8, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610"[label="('6', 1, 0)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816"[label="('8', 1, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118"[label="('1', 1, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712"[label="('7', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122"[label="('1', 2, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927"[label="('9', 2, 7)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228"[label="('2', 2, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626"[label="('6', 2, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626946"[label="('9', 4, 6)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626946";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626946848"[label="('8', 4, 8)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626946" -> "START358177778370830637436334240143445544342654673576472802104605900408311215325165760561751421552262180610816118712122927228626946848";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408711"[label="('7', 1, 1)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408" -> "START358177778370830637436334240143445544342654673576472802104605900408711";
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408711112"[label="('1', 1, 2)"];
|
||||
"START358177778370830637436334240143445544342654673576472802104605900408711" -> "START358177778370830637436334240143445544342654673576472802104605900408711112";
|
||||
}
|
BIN
Solver/sudokus_2.png
Normal file
BIN
Solver/sudokus_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 KiB |
Loading…
Reference in New Issue
Block a user