#[non_exhaustive]pub enum BuildError {
NodeOutOfRange {
arc: usize,
node: usize,
node_count: usize,
},
InvalidBounds {
arc: usize,
lower: Capacity,
upper: Capacity,
},
SupplyNodeOutOfRange {
node: usize,
node_count: usize,
},
UnbalancedSupply {
total: Objective,
},
TooLarge {
what: &'static str,
count: usize,
max: usize,
},
Overflow(Overflow),
}Expand description
Building a Problem failed: the network description is
not a well-formed min-cost-flow instance.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NodeOutOfRange
An arc endpoint is not a node of this network.
Fields
InvalidBounds
An arc’s lower bound exceeds its capacity, so it admits no flow at all.
Fields
SupplyNodeOutOfRange
A supply was set on a node id the network does not have.
Reported rather than accommodated: growing the node space to fit a mistyped id would produce a larger, different problem that solves perfectly well and answers a question nobody asked.
Fields
UnbalancedSupply
Supplies do not sum to zero, so no flow can conserve them.
This is a statement about the instance, not a solver limitation: the caller must balance supply against demand before solving.
TooLarge
The network exceeds the crate’s index width.
Nodes and arcs are addressed with u32 in the solver’s CSR arrays;
this is a deliberate memory trade, documented in crate::Problem.
Fields
Overflow(Overflow)
An intermediate quantity left integer range while validating.
Trait Implementations§
Source§impl Clone for BuildError
impl Clone for BuildError
Source§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
impl Eq for BuildError
Source§impl Error for BuildError
impl Error for BuildError
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()