pub trait Edge: Display {
// Required methods
fn direction(&self) -> EdgeDirection;
fn lhs(&self) -> usize;
fn rhs(&self) -> usize;
// Provided methods
fn max_index(&self) -> usize { ... }
fn min_index(&self) -> usize { ... }
fn delta_index(&self) -> usize { ... }
}
Expand description
Required Methods§
Provided Methods§
Sourcefn max_index(&self) -> usize
fn max_index(&self) -> usize
The smaller of the two indices.
§Examples
use graph_theory::{Edge, UndirectedEdge};
assert_eq!(UndirectedEdge::new(1, 2).max_index(), 2);
assert_eq!(UndirectedEdge::new(2, 1).max_index(), 2);
Sourcefn min_index(&self) -> usize
fn min_index(&self) -> usize
The smaller of the two indices.
§Examples
use graph_theory::{Edge, UndirectedEdge};
assert_eq!(UndirectedEdge::new(1, 2).min_index(), 1);
assert_eq!(UndirectedEdge::new(2, 1).min_index(), 1);
Sourcefn delta_index(&self) -> usize
fn delta_index(&self) -> usize
The smaller of the two indices.
§Examples
use graph_theory::{Edge, UndirectedEdge};
assert_eq!(UndirectedEdge::new(1, 3).delta_index(), 2);
assert_eq!(UndirectedEdge::new(3, 1).delta_index(), 2);