TopologicalSort

Trait TopologicalSort 

Source
pub trait TopologicalSort {
    type Graph: VisitableGraph;

    // Required method
    fn topological_sort_opt(
        &self,
        roots: &Nodes,
        roots_only: bool,
    ) -> Result<Vec<NodeID>>;

    // Provided methods
    fn topological_sort(&self) -> Result<Vec<NodeID>> { ... }
    fn is_dag(&self) -> bool { ... }
}
Expand description

A trait for a graph that supports topological sort.

Required Associated Types§

Required Methods§

Source

fn topological_sort_opt( &self, roots: &Nodes, roots_only: bool, ) -> Result<Vec<NodeID>>

Returns reverse-order of topological sort.

Provided Methods§

Source

fn topological_sort(&self) -> Result<Vec<NodeID>>

Returns reverse-order of topological sort.

Source

fn is_dag(&self) -> bool

Implementors§