pub trait OptimizationProblem {
type Solution;
type ObjectiveValue;
// Required methods
fn description(&self) -> String;
fn size_metrics(&self) -> HashMap<String, usize>;
fn validate(&self) -> ApplicationResult<()>;
fn to_qubo(&self) -> ApplicationResult<(QuboModel, HashMap<String, usize>)>;
fn evaluate_solution(
&self,
solution: &Self::Solution,
) -> ApplicationResult<Self::ObjectiveValue>;
fn is_feasible(&self, solution: &Self::Solution) -> bool;
}Expand description
Common traits for industry-specific problems Problem instance that can be solved with quantum annealing
Required Associated Types§
type Solution
type ObjectiveValue
Required Methods§
Sourcefn description(&self) -> String
fn description(&self) -> String
Get problem description
Sourcefn size_metrics(&self) -> HashMap<String, usize>
fn size_metrics(&self) -> HashMap<String, usize>
Get problem size metrics
Sourcefn validate(&self) -> ApplicationResult<()>
fn validate(&self) -> ApplicationResult<()>
Validate problem instance
Sourcefn to_qubo(&self) -> ApplicationResult<(QuboModel, HashMap<String, usize>)>
fn to_qubo(&self) -> ApplicationResult<(QuboModel, HashMap<String, usize>)>
Convert to QUBO formulation
Sourcefn evaluate_solution(
&self,
solution: &Self::Solution,
) -> ApplicationResult<Self::ObjectiveValue>
fn evaluate_solution( &self, solution: &Self::Solution, ) -> ApplicationResult<Self::ObjectiveValue>
Evaluate solution quality
Sourcefn is_feasible(&self, solution: &Self::Solution) -> bool
fn is_feasible(&self, solution: &Self::Solution) -> bool
Check if solution satisfies all constraints