Expand description
Simple state restoration for backtracking search algorithms using a trail.
During a typical branching search algorithm, the search state must be cloned at each branch
point in order to explore the branches independently. contrail
provides a framework to create
search algorithms that only require a partial clone of the search state at each branch point.
This is facilitated by the trail, a struct where all search state is stored.
This library is based on the memory model used by Minion, a C++ constraint satisfaction problem solver.
§Limitations
The main limitation of contrail is that once a trail has been created using a trail builder, nothing can be added to the trail. This is to prevent dangling pointers.
Modules§
Structs§
- Array
- A reference to a fixed-length array of values stored on the trail.
- Array
Iter - An iterator over the values of an
Array
. - Trail
- The trail itself.
- Trail
Builder - A builder to create a
Trail
. - Value
- A reference to a value stored on the trail.
Type Aliases§
- Backtrackable
Array - A fixed-length array stored on the trail in backtrackable memory.
- Backtrackable
Value - A value stored on the trail in backtrackable memory.
- NonBacktrackable
Array - A fixed-length array stored on the trail in non-backtrackable memory.
- NonBacktrackable
Value - A value stored on the trail in non-backtrackable memory.