Problem

Trait Problem 

Source
pub trait Problem: Clone {
    type Metric: Clone;

    const NAME: &'static str;

    // Required methods
    fn dims(&self) -> Vec<usize>;
    fn evaluate(&self, config: &[usize]) -> Self::Metric;
    fn variant() -> Vec<(&'static str, &'static str)>;

    // Provided method
    fn num_variables(&self) -> usize { ... }
}
Expand description

Minimal problem trait — a problem is a function from configuration to metric.

This trait defines the interface for computational problems that can be solved by enumeration or reduction to other problems.

Required Associated Constants§

Source

const NAME: &'static str

Base name of this problem type (e.g., “MaximumIndependentSet”).

Required Associated Types§

Source

type Metric: Clone

The evaluation metric type.

Required Methods§

Source

fn dims(&self) -> Vec<usize>

Configuration space dimensions. Each entry is the cardinality of that variable.

Source

fn evaluate(&self, config: &[usize]) -> Self::Metric

Evaluate the problem on a configuration.

Source

fn variant() -> Vec<(&'static str, &'static str)>

Returns variant attributes derived from type parameters.

Used for generating variant IDs in the reduction graph schema. Returns pairs like [("graph", "SimpleGraph"), ("weight", "i32")].

Provided Methods§

Source

fn num_variables(&self) -> usize

Number of variables (derived from dims).

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 Problem for BMF

Source§

const NAME: &'static str = "BMF"

Source§

type Metric = SolutionSize<i32>

Source§

impl Problem for CircuitSAT

Source§

const NAME: &'static str = "CircuitSAT"

Source§

type Metric = bool

Source§

impl Problem for Satisfiability

Source§

const NAME: &'static str = "Satisfiability"

Source§

type Metric = bool

Source§

impl Problem for BicliqueCover

Source§

const NAME: &'static str = "BicliqueCover"

Source§

type Metric = SolutionSize<i32>

Source§

impl Problem for Factoring

Source§

const NAME: &'static str = "Factoring"

Source§

type Metric = SolutionSize<i32>

Source§

impl Problem for Knapsack

Source§

const NAME: &'static str = "Knapsack"

Source§

type Metric = SolutionSize<i64>

Source§

impl Problem for PaintShop

Source§

const NAME: &'static str = "PaintShop"

Source§

type Metric = SolutionSize<i32>

Source§

impl Problem for SubsetSum

Source§

const NAME: &'static str = "SubsetSum"

Source§

type Metric = bool

Source§

impl<G> Problem for GraphPartitioning<G>
where G: Graph + VariantParam,

Source§

const NAME: &'static str = "GraphPartitioning"

Source§

type Metric = SolutionSize<i32>

Source§

impl<G, W> Problem for MaxCut<G, W>

Source§

const NAME: &'static str = "MaxCut"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MaximalIS<G, W>

Source§

const NAME: &'static str = "MaximalIS"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MaximumClique<G, W>

Source§

const NAME: &'static str = "MaximumClique"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MaximumIndependentSet<G, W>

Source§

const NAME: &'static str = "MaximumIndependentSet"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MaximumMatching<G, W>

Source§

const NAME: &'static str = "MaximumMatching"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MinimumDominatingSet<G, W>

Source§

const NAME: &'static str = "MinimumDominatingSet"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for MinimumVertexCover<G, W>

Source§

const NAME: &'static str = "MinimumVertexCover"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for SpinGlass<G, W>

Source§

const NAME: &'static str = "SpinGlass"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<G, W> Problem for TravelingSalesman<G, W>

Source§

const NAME: &'static str = "TravelingSalesman"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<K: KValue> Problem for KSatisfiability<K>

Source§

const NAME: &'static str = "KSatisfiability"

Source§

type Metric = bool

Source§

impl<K: KValue, G> Problem for KColoring<K, G>
where G: Graph + VariantParam,

Source§

const NAME: &'static str = "KColoring"

Source§

type Metric = bool

Source§

impl<T> Problem for ClosestVectorProblem<T>
where T: Clone + Into<f64> + VariantParam + Serialize + for<'de> Deserialize<'de> + Debug + 'static,

Source§

const NAME: &'static str = "ClosestVectorProblem"

Source§

type Metric = SolutionSize<f64>

Source§

impl<V: VariableDomain> Problem for ILP<V>

Source§

const NAME: &'static str = "ILP"

Source§

type Metric = SolutionSize<f64>

Source§

impl<W> Problem for QUBO<W>
where W: WeightElement + VariantParam + PartialOrd + Num + Zero + Bounded + AddAssign + Mul<Output = W>,

Source§

const NAME: &'static str = "QUBO"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<W> Problem for MinimumFeedbackVertexSet<W>

Source§

const NAME: &'static str = "MinimumFeedbackVertexSet"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<W> Problem for BinPacking<W>

Source§

const NAME: &'static str = "BinPacking"

Source§

type Metric = SolutionSize<i32>

Source§

impl<W> Problem for MaximumSetPacking<W>

Source§

const NAME: &'static str = "MaximumSetPacking"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>

Source§

impl<W> Problem for MinimumSetCovering<W>

Source§

const NAME: &'static str = "MinimumSetCovering"

Source§

type Metric = SolutionSize<<W as WeightElement>::Sum>