ReductionResult

Trait ReductionResult 

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

    // Required methods
    fn target_problem(&self) -> &Self::Target;
    fn extract_solution(&self, target_solution: &[usize]) -> Vec<usize>;
}
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

Implementors§