ReductionResult

Trait ReductionResult 

Source
pub trait ReductionResult: Clone {
    type Source: Problem;
    type Target: Problem;

    // Required methods
    fn target_problem(&self) -> &Self::Target;
    fn extract_solution(&self, target_solution: &[usize]) -> Vec<usize>;
    fn source_size(&self) -> ProblemSize;
    fn target_size(&self) -> ProblemSize;
}
Expand description

Result of reducing a source problem to a target problem.

This trait encapsulates the target problem and provides methods to extract solutions back to the source problem space.

Required Associated Types§

Source

type Source: Problem

The source problem type.

Source

type Target: Problem

The target problem type.

Required Methods§

Source

fn target_problem(&self) -> &Self::Target

Get a reference to the target problem.

Source

fn extract_solution(&self, target_solution: &[usize]) -> Vec<usize>

Extract a solution from target problem space to source problem space.

§Arguments
  • target_solution - A solution to the target problem
§Returns

The corresponding solution in the source problem space

Source

fn source_size(&self) -> ProblemSize

Get the size of the source problem (for complexity analysis).

Source

fn target_size(&self) -> ProblemSize

Get the size of the target problem (for complexity analysis).

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 ReductionResult for ReductionFactoringToCircuit

Source§

impl ReductionResult for ReductionQUBOToSG

Source§

impl ReductionResult for ReductionSGToQUBO

Source§

impl<W> ReductionResult for ReductionCircuitToSG<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReductionResult for ReductionISToSP<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionISToVC<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionMatchingToSP<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionMaxCutToSG<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReductionResult for ReductionSATToColoring<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionSATToDS<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionSATToIS<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionSGToMaxCut<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + From<i32> + 'static,

Source§

impl<W> ReductionResult for ReductionSPToIS<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionVCToIS<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

impl<W> ReductionResult for ReductionVCToSC<W>
where W: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,

Source§

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

Source§

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