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

Interface IEWDigraph

src/graph/shortest/mod.rs:19–42  ·  view source on GitHub ↗

Edge weighted graph

Source from the content-addressed store, hash-verified

17use crate::ll::linked_list::Iter;
18/// Edge weighted graph
19pub trait IEWDigraph {
20 /// number of vertices
21 #[allow(non_snake_case)]
22 fn V(&self) -> usize;
23
24 /// number of edges
25 #[allow(non_snake_case)]
26 fn E(&self) -> usize;
27
28 /// Adds the directed edge e to this edge-weighted graph
29 fn add_edge(&mut self, v: usize, w: usize, weight: f32);
30
31 /// Returns the edges incident on vertex v
32 fn adj(&self, v: usize) -> Iter<'_, DirectedEdge>;
33
34 /// Returns all edges in this edge-weighted graph
35 fn edges(&self) -> Vec<DirectedEdge>;
36
37 /// Returns the degree of vertex v
38 fn out_degree(&self, v: usize) -> usize;
39
40 /// Returns the number of directed edges incident to vertex
41 fn in_degree(&self, v: usize) -> usize;
42}

Callers

nothing calls this directly

Implementers 1

ew_digraph.rssrc/graph/shortest/ew_digraph.rs

Calls

no outgoing calls

Tested by

no test coverage detected