Puzzle solving library, written in Rust.
7e908457a2
This is a very simple equality constraint. It only assigns a variable when all other variables in the equation have been assigned. Possible improvements: - We can find the min and max range by considering the coefficients and the max and min values of the other variables in the equation. - When there are only 2 variables remaining, we can eliminate the incompatible candidates and then substitute one variable for the other in other constraints. |
||
---|---|---|
src | ||
tests | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
LICENCE-MIT.txt | ||
README.md |
Puzzle Solver
About
Solve logic puzzles by simply describing the puzzle's rules as constraints. This is suitable for solving puzzles with integer variables such as Sudoku.
Examples
A few example programs are provided in the tests/
directory:
- Sudoku - https://en.wikipedia.org/wiki/Sudoku
- N-queens problem - https://en.wikipedia.org/wiki/Eight_queens_puzzle
To clone this repository, run:
git clone https://github.com/wangds/puzzle-solver.git
Then build the library and run the test programs using Cargo.
cargo test --test sudoku -- --nocapture
Basic Usage
Add Puzzle Solver as a dependency to your project's Cargo.toml:
[dependencies]
puzzle-solver = "0.1"
Documentation
Author
David Wang