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

Function acyclic_lp

tests/test_shortest_paths.rs:112–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111#[test]
112fn acyclic_lp() {
113 let i = TINY_EWDAG;
114 let graph = create_graph(i);
115 let sp = AcyclicLP::new(graph.as_ref(), 5).unwrap();
116 for (i, (weight, size)) in vec![
117 (2.44, 5), // (dist_to(i), path_to(i).len())
118 (0.32, 1),
119 (2.77, 6),
120 (0.61, 2),
121 (2.06, 4),
122 (0.0, 0),
123 (1.13, 3),
124 (2.43, 5),
125 ]
126 .iter()
127 .enumerate()
128 {
129 assert_eq!(*size, sp.path_to(i).map_or(0, |path| path.len()));
130 assert_relative_eq!(*weight, sp.dist_to(i));
131 }
132}
133
134#[test]
135fn cpm() {

Callers

nothing calls this directly

Calls 2

create_graphFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected