| 29 | |
| 30 | use crate::ll::linked_list::Iter; |
| 31 | pub 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected