multi-puzzle-solver 0.9.31__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of multi-puzzle-solver might be problematic. Click here for more details.
- {multi_puzzle_solver-0.9.31/src/multi_puzzle_solver.egg-info → multi_puzzle_solver-1.0.3}/PKG-INFO +335 -1
- multi_puzzle_solver-0.9.31/PKG-INFO → multi_puzzle_solver-1.0.3/README.md +5235 -4927
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/pyproject.toml +7 -0
- multi_puzzle_solver-0.9.31/README.md → multi_puzzle_solver-1.0.3/src/multi_puzzle_solver.egg-info/PKG-INFO +5261 -4901
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/multi_puzzle_solver.egg-info/SOURCES.txt +5 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/__init__.py +60 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/core/utils_ortools.py +8 -6
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/core/utils_visualizer.py +12 -11
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/binairo/binairo.py +4 -4
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/black_box/black_box.py +5 -11
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/bridges/bridges.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/chess_range/chess_range.py +3 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/filling/filling.py +3 -3
- multi_puzzle_solver-1.0.3/src/puzzle_solver/puzzles/flood_it/flood_it.py +174 -0
- multi_puzzle_solver-1.0.3/src/puzzle_solver/puzzles/flood_it/parse_map/parse_map.py +198 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/galaxies/galaxies.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/galaxies/parse_map/parse_map.py +3 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/guess/guess.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/heyawake/heyawake.py +3 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/inertia/inertia.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +13 -10
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/inertia/tsp.py +5 -7
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/kakuro/kakuro.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/keen/keen.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +2 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/nonograms/nonograms.py +3 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/norinori/norinori.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/nurikabe/nurikabe.py +2 -2
- multi_puzzle_solver-1.0.3/src/puzzle_solver/puzzles/pipes/pipes.py +81 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/range/range.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/rectangles/rectangles.py +2 -6
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/shingoki/shingoki.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/signpost/signpost.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/slant/parse_map/parse_map.py +7 -5
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/slitherlink/slitherlink.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/stitches/parse_map/parse_map.py +6 -5
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/stitches/stitches.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/sudoku/sudoku.py +91 -20
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/tents/tents.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/thermometers/thermometers.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/towers/towers.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/undead/undead.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/unruly/unruly.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/yin_yang/yin_yang.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/utils/visualizer.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_aquarium.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_battleships.py +1 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_binairo.py +126 -126
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_binairo_plus.py +1 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_black_box.py +41 -40
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_chess_range.py +32 -33
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_chess_solo.py +23 -23
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_filling.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_flip.py +85 -73
- multi_puzzle_solver-1.0.3/tests/test_flood_it.py +158 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_galaxies.py +79 -79
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_guess.py +3 -6
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_heyawake.py +2 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_inertia.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_kakurasu.py +2 -4
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_keen.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_light_up.py +13 -14
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_lits.py +12 -12
- multi_puzzle_solver-1.0.3/tests/test_magnets.py +78 -0
- multi_puzzle_solver-1.0.3/tests/test_map.py +101 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_minesweeper.py +1 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_mosaic.py +19 -18
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_nonograms.py +45 -45
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_norinori.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_nurikabe.py +1 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_palisade.py +1 -3
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_pearl.py +12 -11
- multi_puzzle_solver-1.0.3/tests/test_pipes.py +72 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_range.py +11 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_shakashaka.py +2 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_shingoki.py +55 -2
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_signpost.py +21 -22
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_singles.py +15 -15
- multi_puzzle_solver-1.0.3/tests/test_slitherlink.py +118 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_star_battle.py +27 -10
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_stitches.py +4 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_sudoku.py +182 -1
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_tapa.py +1 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_tents.py +22 -21
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_thermometers.py +2 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_towers.py +15 -24
- multi_puzzle_solver-1.0.3/tests/test_tracks.py +94 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_undead.py +17 -18
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_unruly.py +18 -18
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_utils.py +4 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_yin_yang.py +2 -1
- multi_puzzle_solver-0.9.31/tests/test_magnets.py +0 -59
- multi_puzzle_solver-0.9.31/tests/test_map.py +0 -102
- multi_puzzle_solver-0.9.31/tests/test_slitherlink.py +0 -68
- multi_puzzle_solver-0.9.31/tests/test_tracks.py +0 -71
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/setup.cfg +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/core/utils.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/aquarium/aquarium.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/battleships/battleships.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/binairo/binairo_plus.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/flip/flip.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/kakurasu/kakurasu.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/lits/lits.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/map/map.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/palisade/palisade.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/shakashaka/shakashaka.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/singles/singles.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/slant/slant.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/star_battle/star_battle.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/star_battle/star_battle_shapeless.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/tapa/tapa.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/unequal/unequal.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/src/puzzle_solver/puzzles/yin_yang/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_bridges.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_dominosa.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_kakuro.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_rectangles.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_slant.py +0 -0
- {multi_puzzle_solver-0.9.31 → multi_puzzle_solver-1.0.3}/tests/test_unequal.py +0 -0
{multi_puzzle_solver-0.9.31/src/multi_puzzle_solver.egg-info → multi_puzzle_solver-1.0.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multi-puzzle-solver
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Efficient solvers for numerous popular and esoteric logic puzzles using CP-SAT
|
|
5
5
|
Author: Ar-Kareem
|
|
6
6
|
Project-URL: Homepage, https://github.com/Ar-Kareem/puzzle_solver
|
|
@@ -369,6 +369,33 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
369
369
|
</a>
|
|
370
370
|
</td>
|
|
371
371
|
</tr>
|
|
372
|
+
<tr>
|
|
373
|
+
<td align="center">
|
|
374
|
+
<a href="#kakuro-puzzle-type-51"><b>Kakuro</b><br><br>
|
|
375
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/kakuro_solved.png" alt="Kakuro" width="140">
|
|
376
|
+
</a>
|
|
377
|
+
</td>
|
|
378
|
+
<td align="center">
|
|
379
|
+
<a href="#sudoku-jigsaw-puzzle-type-52"><b>Sudoku Jigsaw</b><br><br>
|
|
380
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_jigsaw_solved.png" alt="Sudoku Jigsaw" width="140">
|
|
381
|
+
</a>
|
|
382
|
+
</td>
|
|
383
|
+
<td align="center">
|
|
384
|
+
<a href="#sudoku-killer-puzzle-type-53"><b>Sudoku Killer</b><br><br>
|
|
385
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_killer_solved.png" alt="Sudoku Killer" width="140">
|
|
386
|
+
</a>
|
|
387
|
+
</td>
|
|
388
|
+
<td align="center">
|
|
389
|
+
<a href="#flood-it-puzzle-type-54"><b>Flood It</b><br><br>
|
|
390
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/flood_it_unsolved.png" alt="Flood It" width="140">
|
|
391
|
+
</a>
|
|
392
|
+
</td>
|
|
393
|
+
<td align="center">
|
|
394
|
+
<a href="#pipes-puzzle-type-55"><b>Pipes</b><br><br>
|
|
395
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pipes_solved.png" alt="Pipes" width="140">
|
|
396
|
+
</a>
|
|
397
|
+
</td>
|
|
398
|
+
</tr>
|
|
372
399
|
</table>
|
|
373
400
|
|
|
374
401
|
</div>
|
|
@@ -434,6 +461,10 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
434
461
|
- [Binairo Plus (Puzzle Type #49)](#binairo-plus-puzzle-type-49)
|
|
435
462
|
- [Shakashaka (Puzzle Type #50)](#shakashaka-puzzle-type-50)
|
|
436
463
|
- [Kakuro (Puzzle Type #51)](#kakuro-puzzle-type-51)
|
|
464
|
+
- [Sudoku Jigsaw (Puzzle Type #52)](#sudoku-jigsaw-puzzle-type-52)
|
|
465
|
+
- [Sudoku Killer (Puzzle Type #53)](#sudoku-killer-puzzle-type-53)
|
|
466
|
+
- [Flood It (Puzzle Type #54)](#flood-it-puzzle-type-54)
|
|
467
|
+
- [Pipes (Puzzle Type #55)](#pipes-puzzle-type-55)
|
|
437
468
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
|
438
469
|
- [Testing](#testing)
|
|
439
470
|
- [Contributing](#contributing)
|
|
@@ -4823,6 +4854,305 @@ Time taken: 0.00 seconds
|
|
|
4823
4854
|
|
|
4824
4855
|
---
|
|
4825
4856
|
|
|
4857
|
+
## Sudoku Jigsaw (Puzzle Type #52)
|
|
4858
|
+
|
|
4859
|
+
* [**Play online**](https://www.puzzle-jigsaw-sudoku.com/)
|
|
4860
|
+
|
|
4861
|
+
* [**Solver Code**][52]
|
|
4862
|
+
|
|
4863
|
+
<details>
|
|
4864
|
+
<summary><strong>Rules</strong></summary>
|
|
4865
|
+
|
|
4866
|
+
1. The basic Sudoku rules apply.
|
|
4867
|
+
2. The difference is that instead of having 3x3 rectangular blocks these blocks have irregular shapes
|
|
4868
|
+
|
|
4869
|
+
</details>
|
|
4870
|
+
|
|
4871
|
+
**Unsolved puzzle**
|
|
4872
|
+
|
|
4873
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_jigsaw_unsolved.png" alt="Sudoku Jigsaw unsolved" width="500">
|
|
4874
|
+
|
|
4875
|
+
Code to utilize this package and solve the puzzle:
|
|
4876
|
+
|
|
4877
|
+
(Note: the ids are arbitrary and simply represent cells that share a block)
|
|
4878
|
+
|
|
4879
|
+
```python
|
|
4880
|
+
import numpy as np
|
|
4881
|
+
from puzzle_solver import sudoku_solver as solver
|
|
4882
|
+
board = np.array([
|
|
4883
|
+
[ '1', ' ', ' ', '2', ' ', ' ', '8', '5', ' ' ],
|
|
4884
|
+
[ '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
|
|
4885
|
+
[ ' ', ' ', '8', ' ', ' ', ' ', ' ', ' ', ' ' ],
|
|
4886
|
+
[ '7', ' ', ' ', '5', ' ', '1', ' ', ' ', ' ' ],
|
|
4887
|
+
[ ' ', ' ', ' ', '1', ' ', '3', ' ', ' ', ' ' ],
|
|
4888
|
+
[ ' ', ' ', ' ', '8', ' ', '4', ' ', ' ', '6' ],
|
|
4889
|
+
[ ' ', ' ', ' ', ' ', ' ', ' ', '5', ' ', ' ' ],
|
|
4890
|
+
[ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '5' ],
|
|
4891
|
+
[ ' ', '2', '6', ' ', ' ', '9', ' ', ' ', '1' ],
|
|
4892
|
+
])
|
|
4893
|
+
jigsaw_ids = np.array([
|
|
4894
|
+
['00', '00', '01', '01', '01', '01', '02', '02', '02'],
|
|
4895
|
+
['00', '00', '01', '01', '03', '01', '01', '02', '02'],
|
|
4896
|
+
['00', '00', '01', '04', '03', '03', '02', '02', '02'],
|
|
4897
|
+
['00', '04', '04', '04', '03', '03', '03', '03', '02'],
|
|
4898
|
+
['00', '00', '04', '04', '03', '03', '05', '05', '05'],
|
|
4899
|
+
['06', '04', '04', '04', '05', '05', '05', '07', '05'],
|
|
4900
|
+
['06', '08', '08', '08', '08', '05', '05', '07', '07'],
|
|
4901
|
+
['06', '06', '06', '06', '08', '07', '07', '07', '07'],
|
|
4902
|
+
['06', '06', '06', '08', '08', '08', '08', '07', '07'],
|
|
4903
|
+
])
|
|
4904
|
+
binst = solver.Board(board=board, jigsaw=jigsaw_ids, constrain_blocks=False)
|
|
4905
|
+
solutions = binst.solve_and_print()
|
|
4906
|
+
```
|
|
4907
|
+
|
|
4908
|
+
**Script Output**
|
|
4909
|
+
|
|
4910
|
+
```python
|
|
4911
|
+
Solution found
|
|
4912
|
+
[['1' '9' '4' '2' '3' '6' '8' '5' '7']
|
|
4913
|
+
['2' '8' '5' '9' '4' '7' '1' '6' '3']
|
|
4914
|
+
['6' '3' '8' '4' '7' '5' '9' '1' '2']
|
|
4915
|
+
['7' '6' '3' '5' '9' '1' '2' '8' '4']
|
|
4916
|
+
['4' '5' '2' '1' '6' '3' '7' '9' '8']
|
|
4917
|
+
['5' '7' '9' '8' '1' '4' '3' '2' '6']
|
|
4918
|
+
['3' '1' '7' '6' '8' '2' '5' '4' '9']
|
|
4919
|
+
['9' '4' '1' '7' '2' '8' '6' '3' '5']
|
|
4920
|
+
['8' '2' '6' '3' '5' '9' '4' '7' '1']]
|
|
4921
|
+
Solutions found: 1
|
|
4922
|
+
status: OPTIMAL
|
|
4923
|
+
Time taken: 0.01 seconds
|
|
4924
|
+
```
|
|
4925
|
+
|
|
4926
|
+
**Solved puzzle**
|
|
4927
|
+
|
|
4928
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_jigsaw_solved.png" alt="Sudoku Jigsaw solved" width="500">
|
|
4929
|
+
|
|
4930
|
+
---
|
|
4931
|
+
|
|
4932
|
+
## Sudoku Killer (Puzzle Type #53)
|
|
4933
|
+
|
|
4934
|
+
* [**Play online**](https://www.puzzle-killer-sudoku.com/)
|
|
4935
|
+
|
|
4936
|
+
* [**Solver Code**][53]
|
|
4937
|
+
|
|
4938
|
+
<details>
|
|
4939
|
+
<summary><strong>Rules</strong></summary>
|
|
4940
|
+
|
|
4941
|
+
1. The basic Sudoku rules apply.
|
|
4942
|
+
2. The sum of all numbers in a cage must match the small number printed in its corner.
|
|
4943
|
+
3. No number appears more than once in a cage.
|
|
4944
|
+
|
|
4945
|
+
</details>
|
|
4946
|
+
|
|
4947
|
+
**Unsolved puzzle**
|
|
4948
|
+
|
|
4949
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_killer_unsolved.png" alt="Sudoku Killer unsolved" width="500">
|
|
4950
|
+
|
|
4951
|
+
Code to utilize this package and solve the puzzle:
|
|
4952
|
+
|
|
4953
|
+
(Note: the ids are arbitrary and simply represent cells that share a cage)
|
|
4954
|
+
|
|
4955
|
+
```python
|
|
4956
|
+
import numpy as np
|
|
4957
|
+
from puzzle_solver import sudoku_solver as solver
|
|
4958
|
+
board = np.full((9, 9), ' ')
|
|
4959
|
+
killer_board = np.array([
|
|
4960
|
+
['01', '01', '03', '03', '03', '12', '12', '13', '14'],
|
|
4961
|
+
['02', '01', '04', '16', '16', '17', '17', '13', '14'],
|
|
4962
|
+
['02', '02', '04', '18', '19', '19', '15', '15', '14'],
|
|
4963
|
+
['11', '11', '05', '18', '19', '19', '20', '15', '23'],
|
|
4964
|
+
['10', '10', '05', '30', '31', '32', '20', '22', '23'],
|
|
4965
|
+
['08', '07', '06', '30', '31', '32', '21', '22', '24'],
|
|
4966
|
+
['08', '07', '06', '29', '31', '33', '21', '24', '24'],
|
|
4967
|
+
['09', '34', '34', '29', '28', '33', '26', '26', '25'],
|
|
4968
|
+
['09', '34', '34', '28', '28', '27', '27', '25', '25'],
|
|
4969
|
+
])
|
|
4970
|
+
killer_clues = {
|
|
4971
|
+
'01': 16, '02': 11, '03': 24, '04': 10, '05': 11, '06': 7, '07': 10, '08': 10, '09': 16,
|
|
4972
|
+
'10': 11, '11': 10, '12': 7, '13': 11, '14': 16, '15': 16, '16': 8, '17': 12, '18': 8, '19': 15,
|
|
4973
|
+
'20': 7, '21': 10, '22': 5, '23': 13, '24': 16, '25': 9, '26': 14, '27': 15, '28': 13, '29': 11,
|
|
4974
|
+
'30': 9, '31': 15, '32': 13, '33': 11, '34': 15,
|
|
4975
|
+
}
|
|
4976
|
+
binst = solver.Board(board=board, block_size=(3, 3), killer=(killer_board, killer_clues))
|
|
4977
|
+
solutions = binst.solve_and_print()
|
|
4978
|
+
```
|
|
4979
|
+
|
|
4980
|
+
**Script Output**
|
|
4981
|
+
|
|
4982
|
+
```python
|
|
4983
|
+
Solution found
|
|
4984
|
+
[['5' '4' '8' '7' '9' '1' '6' '2' '3']
|
|
4985
|
+
['3' '7' '1' '6' '2' '8' '4' '9' '5']
|
|
4986
|
+
['2' '6' '9' '5' '4' '3' '1' '7' '8']
|
|
4987
|
+
['1' '9' '4' '3' '6' '2' '5' '8' '7']
|
|
4988
|
+
['8' '3' '7' '1' '5' '9' '2' '4' '6']
|
|
4989
|
+
['6' '2' '5' '8' '7' '4' '3' '1' '9']
|
|
4990
|
+
['4' '8' '2' '9' '3' '5' '7' '6' '1']
|
|
4991
|
+
['7' '1' '3' '2' '8' '6' '9' '5' '4']
|
|
4992
|
+
['9' '5' '6' '4' '1' '7' '8' '3' '2']]
|
|
4993
|
+
Solutions found: 1
|
|
4994
|
+
status: OPTIMAL
|
|
4995
|
+
Time taken: 0.01 seconds
|
|
4996
|
+
```
|
|
4997
|
+
|
|
4998
|
+
**Solved puzzle**
|
|
4999
|
+
|
|
5000
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_killer_solved.png" alt="Sudoku Killer solved" width="500">
|
|
5001
|
+
|
|
5002
|
+
---
|
|
5003
|
+
|
|
5004
|
+
## Flood It (Puzzle Type #54)
|
|
5005
|
+
|
|
5006
|
+
* [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/flood.html)
|
|
5007
|
+
|
|
5008
|
+
* [**Instructions**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/flood.html#flood)
|
|
5009
|
+
|
|
5010
|
+
* [**Solver Code**][54]
|
|
5011
|
+
|
|
5012
|
+
<details>
|
|
5013
|
+
<summary><strong>Rules</strong></summary>
|
|
5014
|
+
|
|
5015
|
+
The game is a combinatorial puzzle played on a colored N by N grid where the goal is to make the entire grid a single color using the minimum number of moves.
|
|
5016
|
+
|
|
5017
|
+
A move consists of picking a new color, which then floods the connected component of the player's current area that has that chosen color.
|
|
5018
|
+
|
|
5019
|
+
The player's current area is the top-leftmost corner of the grid along with any similarly colored orthogonal cells connected to the current area.
|
|
5020
|
+
|
|
5021
|
+
</details>
|
|
5022
|
+
|
|
5023
|
+
This game has a lot of interesting mathematical properties related to Graph Theory (for example many details are referenced in this [2022 Graph Theory paper](https://arxiv.org/pdf/1101.5876))
|
|
5024
|
+
|
|
5025
|
+
Finding an optimal solution for any graph is NP-hard.
|
|
5026
|
+
|
|
5027
|
+
**Unsolved puzzle**
|
|
5028
|
+
|
|
5029
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/flood_it_unsolved.png" alt="Flood It unsolved" width="500">
|
|
5030
|
+
|
|
5031
|
+
Code to utilize this package and solve the puzzle:
|
|
5032
|
+
|
|
5033
|
+
(Note: the ids are arbitrary and simply represent cells that share a cage)
|
|
5034
|
+
|
|
5035
|
+
```python
|
|
5036
|
+
import numpy as np
|
|
5037
|
+
from puzzle_solver import flood_it_solver as solver
|
|
5038
|
+
board = np.array([
|
|
5039
|
+
['B', 'Y', 'G', 'Y', 'R', 'B', 'Y', 'Y', 'G', 'B', 'R', 'P'],
|
|
5040
|
+
['P', 'G', 'G', 'Y', 'B', 'O', 'Y', 'O', 'B', 'Y', 'R', 'O'],
|
|
5041
|
+
['B', 'R', 'P', 'Y', 'O', 'R', 'G', 'G', 'G', 'R', 'R', 'Y'],
|
|
5042
|
+
['O', 'G', 'P', 'G', 'Y', 'Y', 'P', 'P', 'O', 'Y', 'B', 'B'],
|
|
5043
|
+
['G', 'Y', 'G', 'O', 'R', 'G', 'R', 'P', 'G', 'O', 'B', 'R'],
|
|
5044
|
+
['R', 'G', 'B', 'G', 'O', 'B', 'O', 'G', 'B', 'O', 'O', 'B'],
|
|
5045
|
+
['G', 'B', 'P', 'R', 'Y', 'P', 'R', 'B', 'Y', 'B', 'Y', 'P'],
|
|
5046
|
+
['G', 'B', 'G', 'P', 'O', 'Y', 'R', 'Y', 'P', 'P', 'O', 'G'],
|
|
5047
|
+
['R', 'P', 'B', 'O', 'B', 'G', 'Y', 'O', 'Y', 'R', 'P', 'O'],
|
|
5048
|
+
['G', 'P', 'P', 'P', 'P', 'Y', 'G', 'P', 'O', 'G', 'O', 'R'],
|
|
5049
|
+
['Y', 'Y', 'B', 'B', 'R', 'B', 'O', 'R', 'O', 'O', 'R', 'O'],
|
|
5050
|
+
['B', 'G', 'B', 'G', 'R', 'B', 'P', 'Y', 'P', 'B', 'R', 'G']
|
|
5051
|
+
])
|
|
5052
|
+
solution = solver.solve_minimum_steps(board=board)
|
|
5053
|
+
```
|
|
5054
|
+
|
|
5055
|
+
**Script Output**
|
|
5056
|
+
|
|
5057
|
+
```python
|
|
5058
|
+
Trying with exactly 16 moves... Not possible!
|
|
5059
|
+
Trying with exactly 32 moves... Possible!
|
|
5060
|
+
Solution: ['Y', 'G', 'B', 'Y', 'B', 'R', 'B', 'Y', 'G', 'Y', 'G', 'B', 'B', 'G', 'Y', 'Y', 'R', 'B', 'Y', 'G', 'Y', 'B', 'Y', 'B', 'Y', 'B', 'G', 'Y', 'B', 'G', 'R', 'Y']
|
|
5061
|
+
Trying with exactly 24 moves... Possible!
|
|
5062
|
+
Solution: ['Y', 'G', 'B', 'Y', 'B', 'R', 'B', 'R', 'Y', 'G', 'R', 'Y', 'R', 'B', 'G', 'B', 'G', 'Y', 'G', 'B', 'Y', 'G', 'R', 'Y']
|
|
5063
|
+
Trying with exactly 20 moves... Possible!
|
|
5064
|
+
Solution: ['Y', 'G', 'B', 'Y', 'B', 'R', 'B', 'G', 'Y', 'G', 'B', 'G', 'Y', 'B', 'Y', 'R', 'B', 'G', 'R', 'Y']
|
|
5065
|
+
Trying with exactly 18 moves... Possible!
|
|
5066
|
+
Solution: ['Y', 'G', 'B', 'Y', 'R', 'B', 'R', 'Y', 'B', 'G', 'R', 'Y', 'R', 'B', 'G', 'R', 'Y', 'B']
|
|
5067
|
+
Trying with exactly 17 moves... Not possible!
|
|
5068
|
+
Best Horizon is: T=18
|
|
5069
|
+
Best solution is: ['Y', 'G', 'B', 'Y', 'R', 'B', 'R', 'Y', 'B', 'G', 'R', 'Y', 'R', 'B', 'G', 'R', 'Y', 'B']
|
|
5070
|
+
Time taken: 3.10 seconds
|
|
5071
|
+
```
|
|
5072
|
+
|
|
5073
|
+
**Solved puzzle**
|
|
5074
|
+
|
|
5075
|
+
This picture won't mean much as the game is about the sequence and number of moves not the final frame as shown here.
|
|
5076
|
+
|
|
5077
|
+
Note that the solved solution on the bottom left says that only 18 moves were used (based on the above output) despite the website saying 20 total moves are permitted (and the puzzle settings specified 0 extra moves permitted). Thus the solver managed to find a more optimal solution than the website.
|
|
5078
|
+
|
|
5079
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/flood_it_solved.png" alt="Flood It solved" width="500">
|
|
5080
|
+
|
|
5081
|
+
---
|
|
5082
|
+
|
|
5083
|
+
## Pipes (Puzzle Type #55)
|
|
5084
|
+
|
|
5085
|
+
Also called "Net"
|
|
5086
|
+
|
|
5087
|
+
* [**Play online 1**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/net.html)
|
|
5088
|
+
|
|
5089
|
+
* [**Play online 2**](https://www.puzzle-pipes.com/)
|
|
5090
|
+
|
|
5091
|
+
* [**Instructions**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/net.html#net)
|
|
5092
|
+
|
|
5093
|
+
* [**Solver Code**][55]
|
|
5094
|
+
|
|
5095
|
+
<details>
|
|
5096
|
+
<summary><strong>Rules</strong></summary>
|
|
5097
|
+
|
|
5098
|
+
You are given a grid of cells where each cell has 1, 2, 3, or 4 connections to its neighbors. Each cell can be freely rotated in multiple of 90 degrees, thus your can rotate the cells to be one of four possible states.
|
|
5099
|
+
|
|
5100
|
+
The goal is to create a single fully connected graph where each cell's connection must be towards another cell's connection. No loose ends or loops are allowed.
|
|
5101
|
+
|
|
5102
|
+
</details>
|
|
5103
|
+
|
|
5104
|
+
**Unsolved puzzle**
|
|
5105
|
+
|
|
5106
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pipes_unsolved.png" alt="Pipes unsolved" width="500">
|
|
5107
|
+
|
|
5108
|
+
Code to utilize this package and solve the puzzle:
|
|
5109
|
+
|
|
5110
|
+
(Note: cells with 1 or 3 active connections only have 1 unique orientation under rotational symmetry. However, cells with 2 active connections can be either a straight line (2I) or curved line (2L))
|
|
5111
|
+
|
|
5112
|
+
```python
|
|
5113
|
+
import numpy as np
|
|
5114
|
+
from puzzle_solver import pipes_solver as solver
|
|
5115
|
+
board=np.array([
|
|
5116
|
+
[ '1 ', '3 ', '3 ', '3 ', '1 ', '1 ', '2L', '2L', '2I', '1 ' ],
|
|
5117
|
+
[ '1 ', '1 ', '1 ', '3 ', '2I', '1 ', '2I', '3 ', '2I', '1 ' ],
|
|
5118
|
+
[ '2I', '1 ', '1 ', '3 ', '2L', '1 ', '3 ', '2I', '1 ', '1 ' ],
|
|
5119
|
+
[ '2I', '2I', '1 ', '3 ', '3 ', '3 ', '2L', '3 ', '3 ', '2L' ],
|
|
5120
|
+
[ '3 ', '3 ', '2I', '3 ', '1 ', '3 ', '2I', '2L', '1 ', '2L' ],
|
|
5121
|
+
[ '1 ', '1 ', '3 ', '2I', '3 ', '2L', '1 ', '1 ', '2L', '2L' ],
|
|
5122
|
+
[ '1 ', '1 ', '3 ', '1 ', '1 ', '1 ', '3 ', '3 ', '3 ', '2L' ],
|
|
5123
|
+
[ '3 ', '2I', '3 ', '3 ', '2L', '3 ', '3 ', '2I', '2L', '1 ' ],
|
|
5124
|
+
[ '1 ', '1 ', '3 ', '3 ', '3 ', '3 ', '1 ', '2L', '3 ', '2L' ],
|
|
5125
|
+
[ '1 ', '2I', '3 ', '2I', '1 ', '1 ', '1 ', '3 ', '1 ', '1 ' ],
|
|
5126
|
+
])
|
|
5127
|
+
binst = solver.Board(board=board)
|
|
5128
|
+
solutions = binst.solve_and_print()
|
|
5129
|
+
```
|
|
5130
|
+
|
|
5131
|
+
**Script Output**
|
|
5132
|
+
|
|
5133
|
+
```python
|
|
5134
|
+
Solution found
|
|
5135
|
+
[['R' 'DLR' 'DLR' 'DLR' 'L' 'R' 'DL' 'DR' 'LR' 'L']
|
|
5136
|
+
['D' 'U' 'U' 'UDR' 'LR' 'L' 'UD' 'UDR' 'LR' 'L']
|
|
5137
|
+
['UD' 'D' 'R' 'ULR' 'DL' 'R' 'UDL' 'UD' 'D' 'D']
|
|
5138
|
+
['UD' 'UD' 'R' 'DLR' 'ULR' 'DLR' 'UL' 'UDR' 'ULR' 'UL']
|
|
5139
|
+
['UDR' 'ULR' 'LR' 'ULR' 'L' 'UDR' 'LR' 'UL' 'R' 'DL']
|
|
5140
|
+
['U' 'R' 'DLR' 'LR' 'DLR' 'UL' 'D' 'D' 'DR' 'UL']
|
|
5141
|
+
['D' 'R' 'UDL' 'D' 'U' 'D' 'UDR' 'ULR' 'ULR' 'DL']
|
|
5142
|
+
['UDR' 'LR' 'ULR' 'UDL' 'DR' 'ULR' 'ULR' 'LR' 'DL' 'U']
|
|
5143
|
+
['U' 'R' 'DLR' 'ULR' 'ULR' 'DLR' 'L' 'DR' 'ULR' 'DL']
|
|
5144
|
+
['R' 'LR' 'ULR' 'LR' 'L' 'U' 'R' 'ULR' 'L' 'U']]
|
|
5145
|
+
Solutions found: 1
|
|
5146
|
+
status: OPTIMAL
|
|
5147
|
+
Time taken: 5.65 seconds
|
|
5148
|
+
```
|
|
5149
|
+
|
|
5150
|
+
**Solved puzzle**
|
|
5151
|
+
|
|
5152
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pipes_solved.png" alt="Pipes solved" width="500">
|
|
5153
|
+
|
|
5154
|
+
---
|
|
5155
|
+
|
|
4826
5156
|
---
|
|
4827
5157
|
|
|
4828
5158
|
## Why SAT / CP-SAT?
|
|
@@ -4925,3 +5255,7 @@ Issues and PRs welcome!
|
|
|
4925
5255
|
[49]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/binairo_plus "puzzle_solver/src/puzzle_solver/puzzles/binairo_plus at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
4926
5256
|
[50]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/shakashaka "puzzle_solver/src/puzzle_solver/puzzles/shakashaka at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
4927
5257
|
[51]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/kakuro "puzzle_solver/src/puzzle_solver/puzzles/kakuro at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
5258
|
+
[52]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/sudoku "puzzle_solver/src/puzzle_solver/puzzles/sudoku at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
5259
|
+
[53]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/sudoku "puzzle_solver/src/puzzle_solver/puzzles/sudoku at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
5260
|
+
[54]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/flood_it "puzzle_solver/src/puzzle_solver/puzzles/flood_it at master · Ar-Kareem/puzzle_solver · GitHub"
|
|
5261
|
+
[55]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/pipes "puzzle_solver/src/puzzle_solver/puzzles/pipes at master · Ar-Kareem/puzzle_solver · GitHub"
|