Skip to main content

pumpkin_core/branching/
mod.rs

1//! Contains structures and traits to define the decision making procedure of the [`Solver`].
2//!
3//! In general, it provides 3 traits:
4//! - The [`Brancher`] which defines how a branching procedure (which selects an unfixed variable and splits the domain in some way, see [Section 4.3.1 of \[1\]](http://www.cse.unsw.com.au/~tw/brwhkr08.pdf)
5//!   for more information) should operate; the main method of this trait is the [`Brancher::next_decision`] method. An example implementation of this trait is the [`IndependentVariableValueBrancher`].
6//! - The [`VariableSelector`] which defines the method required of a variable selector (including
7//!   the hooks into the solver); the main method of this trait is the
8//!   [`VariableSelector::select_variable`] method. An example implementation of this trait is the
9//!   [`AntiFirstFail`] strategy.
10//! - The [`ValueSelector`] which defines the method required of a value selector (including the
11//!   hooks into the solver); the main method of this trait is the [`ValueSelector::select_value`]
12//!   method.
13//!
14//! A [`Brancher`] is expected to be passed to [`Solver::satisfy`], and [`Solver::optimise`]:
15//!
16//! \[1\] F. Rossi, P. Van Beek, and T. Walsh, Handbook of constraint programming. Elsevier, 2006.
17
18mod brancher;
19pub mod branchers;
20mod selection_context;
21pub mod tie_breaking;
22pub mod value_selection;
23pub mod variable_selection;
24
25pub use brancher::*;
26pub use selection_context::SelectionContext;
27
28#[cfg(doc)]
29use crate::Solver;
30#[cfg(doc)]
31use crate::branching::branchers::independent_variable_value_brancher::IndependentVariableValueBrancher;
32#[cfg(doc)]
33use crate::branching::value_selection::ValueSelector;
34#[cfg(doc)]
35use crate::branching::variable_selection::AntiFirstFail;
36#[cfg(doc)]
37use crate::branching::variable_selection::VariableSelector;