Skip to main content

minimum_spanning_tree

Function minimum_spanning_tree 

Source
pub fn minimum_spanning_tree<V>(
    q: &GraphQuery<V>,
    weight: &TraversalWeight<V>,
) -> Vec<Pattern<V>>
where V: GraphValue + Clone, V::Id: Clone + Eq + Hash + Ord,
Expand description

Minimum spanning tree using Kruskal’s algorithm with path-compression union-find.

  • Edge cost is min(forward_cost, backward_cost).
  • Edges with INFINITY cost in both directions are excluded.
  • Returns the subset of nodes that are included in the MST.