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§
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn num_variables(&self) -> usize
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.