Crates.io | quickbacktrack |
lib.rs | quickbacktrack |
version | 0.7.0 |
source | src |
created_at | 2016-04-25 11:54:57.316859 |
updated_at | 2020-09-16 14:47:52.653388 |
description | Library for back tracking with customizable search for moves |
homepage | https://github.com/bvssvni/quickbacktrack |
repository | https://github.com/bvssvni/quickbacktrack.git |
max_upload_size | |
id | 4848 |
size | 111,028 |
Library for back tracking with customizable search for moves
Back tracking is a general algorithm for finding solutions to constraint satisfaction problems.
With other words, it solves puzzles like Sudoku or Knapsack!
Blog posts:
Puzzle
for solving generic constraint satisfaction problems ___ ___ ___
|436| 8 |751|
|17 | 34|8 9|
|859|761|324|
---+---+---
|964|153|287|
|285|497|136|
|713|826|945|
---+---+---
|521|349|678|
|347|618|592|
|698| 7 |413|
---+---+---
Guess [5, 0], 2 depth 50 51
To run, open up Terminal and type:
cargo run --example sudoku
Item { desc: "chocolate", weight: 0.2, value: 40 }
Item { desc: "book", weight: 0.5, value: 300 }
Item { desc: "hat", weight: 0.1, value: 1000 }
total weight: 0.7999999999999999
total value: 1340
To run, open up Terminal and type:
cargo run --example knapsack
_ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|x|
|_|_|_|x|_|_|_|_|
|x|_|_|_|_|_|_|_|
|_|_|x|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
Guess 4, 6 depth 5 6
To run, open up Terminal and type:
cargo run --example eight_queens