pub struct Graph<T: Ord + Copy + Debug> { /* private fields */ }
Implementations§
source§impl<T: Ord + Copy + Debug> Graph<T>
impl<T: Ord + Copy + Debug> Graph<T>
sourcepub fn new(entry: T, nodes: Vec<T>, edges: Vec<(T, T)>) -> Self
pub fn new(entry: T, nodes: Vec<T>, edges: Vec<(T, T)>) -> Self
This function creates a graph from a set of nodes (with a unique entry node) and a set of edges.
sourcepub fn compute_reducible(&self) -> Option<Vec<NaturalLoop<T>>>
pub fn compute_reducible(&self) -> Option<Vec<NaturalLoop<T>>>
This function computes the loop headers and natural loops of a reducible graph. If the graph is irreducible, None is returned.