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

Method add_edge

src/graph/shortest/ew_digraph.rs:23–28  ·  view source on GitHub ↗
(&mut self, v: usize, w: usize, weight: f32)

Source from the content-addressed store, hash-verified

21 }
22
23 fn add_edge(&mut self, v: usize, w: usize, weight: f32) {
24 let e = DirectedEdge::new(v, w, weight);
25 self.adj[v].push_front(e);
26 self.in_degree[w] += 1;
27 self.ne += 1;
28 }
29
30 fn adj(&self, v: usize) -> Iter<'_, DirectedEdge> {
31 self.adj[v].iter()

Callers 4

try_fromMethod · 0.45
find_negative_cycleMethod · 0.45
try_fromMethod · 0.45
fromMethod · 0.45

Calls 1

push_frontMethod · 0.80

Tested by

no test coverage detected