Expand description
The crate implements an algorithm for solving exact cover problems using:
- backtracking and minimal remain values heuristic logic and
- an optimzed data structure called dancing cells based on sparse sets
Define a Problem and use function solve to find solution(s) for the generalized problem with both primary items and secondary items with colors, and for the standard problem with only primary items.
See usage examples for function solve.
Structs§
- Dancing
Cells - Implementation using Dancing Cells data structure and the logic used by the main solve function
- Option
- eXact Cover with Colors option
- Param
Error - Parameter error messages for invalid parameters used in problem setup
- Problem
- eXact Cover with Colors problem
- Solutions
- eXact Cover with Colors solutions
Functions§
- new_
item_ validate - Validate new item in items
- new_
option_ validate - Validate new option
- new_
primary_ validate - Validate new item in primary items
- new_
secondary_ validate - Validate new item in secondary items
- option_
validate - Validate primary and secondary items in and option
- problem_
validate - Validate options, primary and secondary items in a problem
- solve
- Function solve looks for Solutions (exact covers)