[][src]Trait dancing_links::ExactCover

pub trait ExactCover {
    type Possibility: Debug;
    type Constraint: Debug;
    fn satisfies(
        &self,
        poss: &Self::Possibility,
        cons: &Self::Constraint
    ) -> bool;
fn is_optional(&self, cons: &Self::Constraint) -> bool;
fn possibilities(&self) -> &[Self::Possibility];
fn constraints(&self) -> &[Self::Constraint]; fn solver(&self) -> Solver<Self>

Important traits for Solver<'e, E>

impl<'e, E> Iterator for Solver<'e, E> where
    E: ExactCover
type Item = Vec<&'e E::Possibility>;

    where
        Self: Sized
, { ... } }

An instance of an exact cover problem.

Associated Types

type Possibility: Debug

The type of values that are elements of a solution to the exact cover problem.

type Constraint: Debug

The type of value that are constraints on a given instance of an exact cover problem.

Loading content...

Required methods

fn satisfies(&self, poss: &Self::Possibility, cons: &Self::Constraint) -> bool

Return true if the given Possibility will satisfy the given Constraint.

fn is_optional(&self, cons: &Self::Constraint) -> bool

Return true if the given Constraint is optional.

fn possibilities(&self) -> &[Self::Possibility]

Return a list of possibilities for this instance of the problem.

fn constraints(&self) -> &[Self::Constraint]

Return a list of constraints that must be satisfied for this instance of the problem.

Loading content...

Provided methods

fn solver(&self) -> Solver<Self>

Important traits for Solver<'e, E>

impl<'e, E> Iterator for Solver<'e, E> where
    E: ExactCover
type Item = Vec<&'e E::Possibility>;
where
    Self: Sized

Return an iterator over all solutions to this instance of the exact cover problem.

Loading content...

Implementors

impl ExactCover for LatinSquare[src]

type Constraint = Constraint

type Possibility = Possibility

impl ExactCover for NQueens[src]

type Constraint = Constraint

type Possibility = Possibility

impl ExactCover for Sudoku[src]

type Constraint = Constraint

type Possibility = Possibility

Loading content...