Struct quickbacktrack::BackTrackSolver [] [src]

pub struct BackTrackSolver<T> where
    T: Puzzle
{ pub original: T, pub state: T, pub prevs: Vec<(T::Pos, T::Val, bool)>, pub choice: Vec<(T::Pos, Vec<T::Val>)>, pub settings: SolveSettings, }

Solvees puzzles using back tracking.

Fields

Stores the original state.

Stores the state.

Stores the previous values of a position before making a choice. If the flag is true, the value was inserted due to a simple choice.

Stores the choices for the states.

Search for simple solutions.

Methods

impl<T> BackTrackSolver<T> where
    T: Puzzle
[src]

[src]

Creates a new solver.

[src]

Solves puzzle, using a closure to look for best position to set a value next, and a closure for picking options in preferred order.

The second closure returns possible values at a given position. The last move in the list has highest priority, because the solver pops the values in turn.

Trait Implementations

Auto Trait Implementations

impl<T> Send for BackTrackSolver<T> where
    T: Send,
    <T as Puzzle>::Pos: Send,
    <T as Puzzle>::Val: Send

impl<T> Sync for BackTrackSolver<T> where
    T: Sync,
    <T as Puzzle>::Pos: Sync,
    <T as Puzzle>::Val: Sync