ReduceTo

Trait ReduceTo 

Source
pub trait ReduceTo<T: Problem>: Problem {
    type Result: ReductionResult<Source = Self, Target = T>;

    // Required method
    fn reduce_to(&self) -> Self::Result;
}
Expand description

Trait for problems that can be reduced to target type T.

§Example

let sat_problem = Satisfiability::new(...);
let reduction = sat_problem.reduce_to::<IndependentSet<i32>>();
let is_problem = reduction.target_problem();
let solutions = solver.find_best(is_problem);
let sat_solutions: Vec<_> = solutions.iter()
    .map(|s| reduction.extract_solution(s))
    .collect();

Required Associated Types§

Source

type Result: ReductionResult<Source = Self, Target = T>

The reduction result type.

Required Methods§

Source

fn reduce_to(&self) -> Self::Result

Reduce this problem to the target problem type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ReduceTo<QUBO> for SpinGlass<f64>

Source§

impl ReduceTo<SpinGlass> for QUBO<f64>

Source§

impl ReduceTo<CircuitSAT> for Factoring

Source§

impl<W> ReduceTo<Coloring> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<DominatingSet<W>> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<IndependentSet<W>> for VertexCovering<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<IndependentSet<W>> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<IndependentSet<W>> for SetPacking<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<MaxCut<W>> for SpinGlass<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<VertexCovering<W>> for IndependentSet<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<SpinGlass<W>> for MaxCut<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<SpinGlass<W>> for CircuitSAT<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<KSatisfiability<3, W>> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<KSatisfiability<4, W>> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<KSatisfiability<5, W>> for Satisfiability<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<SetCovering<W>> for VertexCovering<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<SetPacking<W>> for IndependentSet<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReduceTo<SetPacking<W>> for Matching<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<const K: usize, W> ReduceTo<Satisfiability<W>> for KSatisfiability<K, W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,