Skip to main content

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: &<Self::Target as Problem>::Solution,
    ) -> ExtractionResult<<Self::Source as Problem>::Solution>;
}
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: &<Self::Target as Problem>::Solution, ) -> ExtractionResult<<Self::Source as Problem>::Solution>

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§