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

Interface IGraph

src/graph/undirected/mod.rs:31–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30use crate::ll::linked_list::Iter;
31pub trait IGraph {
32 /// number of vertices
33 #[allow(non_snake_case)]
34 fn V(&self) -> usize;
35
36 /// number of edges
37 #[allow(non_snake_case)]
38 fn E(&self) -> usize;
39
40 /// add edge v-w to this graph
41 fn add_edge(&mut self, v: usize, w: usize);
42
43 /// vertices adjacent to v
44 fn adj(&self, v: usize) -> Iter<'_, usize>;
45
46 /// directed graph op
47 fn reverse(&self) -> Box<dyn IGraph> {
48 panic!("No Support");
49 }
50}

Callers

nothing calls this directly

Implementers 2

graph.rssrc/graph/undirected/graph.rs
digraph.rssrc/graph/directed/digraph.rs

Calls

no outgoing calls

Tested by

no test coverage detected