Skip to main content

prim

Function prim 

Source
pub fn prim(g: &Graph) -> Result<SpanningForest, ErrorsJSL>
Expand description

Prim’s algorithm: grows each tree from a root by the cheapest edge leaving it (binary heap). O(E log V); better than Kruskal on dense graphs.