#[non_exhaustive]pub enum VerifyError {
LengthMismatch {
expected: usize,
found: usize,
},
CapacityViolated {
arc: usize,
flow: Flow,
lower: Capacity,
upper: Capacity,
},
ConservationViolated {
node: usize,
net: Objective,
supply: Flow,
},
NegativeReducedCost {
tail: usize,
head: usize,
reduced_cost: Cost,
},
PotentialsDoNotExist {
node: usize,
},
NegativeCycle {
numerator: i128,
denominator: i128,
node: usize,
},
CertifiersDisagree {
dual_verdict: &'static str,
cycle_verdict: &'static str,
},
CycleSearchDidNotConverge {
iterations: u64,
},
Overflow(Overflow),
}Expand description
A certificate could not be issued: the candidate solution is not feasible, not optimal, or not a solution to this problem at all.
Each variant is a counterexample, carrying the witness that refutes the claim — the arc whose capacity is exceeded, the node whose conservation fails, the residual arc whose reduced cost is negative.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LengthMismatch
The flow vector does not have one entry per arc.
CapacityViolated
Feasibility: an arc’s flow is outside [lower, upper].
Fields
ConservationViolated
Feasibility: flow is not conserved at a node.
Fields
NegativeReducedCost
Dual certificate: a residual arc has negative reduced cost under the recomputed potentials, so the flow admits a cheaper rerouting and is not optimal.
Fields
PotentialsDoNotExist
Dual certificate: no potential function exists, because the residual graph has a negative cycle. Detected while computing the potentials.
NegativeCycle
Cycle check: the residual graph contains a cycle of negative mean cost, which can be cancelled for a strictly cheaper flow.
Fields
CertifiersDisagree
The two optimality proofs disagreed. Both are suspect until this is resolved — by construction they cannot both be right.
The two certifiers share no code path precisely so that this can be observed rather than silently averaged away.
Fields
CycleSearchDidNotConverge
Cycle check: policy iteration exceeded its safety bound without converging.
A certifier that can spin is not a certifier, so the search is bounded; reaching the bound is reported rather than silently treated as “no negative cycle found”.
Overflow(Overflow)
An intermediate quantity left integer range while verifying.
Trait Implementations§
Source§impl Clone for VerifyError
impl Clone for VerifyError
Source§impl Debug for VerifyError
impl Debug for VerifyError
Source§impl Display for VerifyError
impl Display for VerifyError
impl Eq for VerifyError
Source§impl Error for VerifyError
impl Error for VerifyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()