[][src]Struct ddo::core::implementation::heuristics::NbUnassigned

pub struct NbUnassigned;

This is the default max width heuristic. This strategy specifies a variable maximum width for the layers of an approximate MDD. When using this heuristic, each layer of an approximate MDD is allowed to have as many nodes as there are free variables to decide upon.

Example

Assuming a problem with 5 variables (0..=4). If we are calling this heuristic to derive the maximum allowed width for the layers of an approximate MDD when variables {1, 3, 4} have been fixed, then the set of free_vars will contain only the variables {0, 2}. In that case, this strategy will return a max width of two.


let mut var_set = VarSet::all(5); // assume a problem with 5 variables
var_set.remove(Variable(1));      // variables {1, 3, 4} have been fixed
var_set.remove(Variable(3));
var_set.remove(Variable(4));      // only variables {0, 2} remain in the set

assert_eq!(2, NbUnassigned.max_width(&var_set));

Trait Implementations

impl Clone for NbUnassigned[src]

impl Debug for NbUnassigned[src]

impl WidthHeuristic for NbUnassigned[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.