MCPcopy Create free account
hub / github.com/douchuan/algorithm / Kruskal_mst

Function Kruskal_mst

tests/test_graph_mst.rs:59–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57#[allow(non_snake_case)]
58#[test]
59fn Kruskal_mst() {
60 let i = TINY_EWG;
61 let g = create_graph(i);
62 let mst = KruskalMST::new(g.as_ref());
63 assert_relative_eq!(1.81, mst.weight());
64 assert!(mst.check(g.as_ref()).is_ok());
65
66 // for e in mst.edges() {
67 // println!("{}", e.to_string());
68 // }
69}
70
71fn create_graph(i: &str) -> Box<dyn IEWGraph> {
72 Box::new(EWGraph::from(i))

Callers

nothing calls this directly

Calls 1

create_graphFunction · 0.70

Tested by

no test coverage detected