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.
pub fn prim(g: &Graph) -> Result<SpanningForest, ErrorsJSL>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.