Add GraphTopology::incident_edges() and tests
This commit is contained in:
@@ -200,6 +200,10 @@ impl GraphTopology for Graph {
|
||||
.map(|(i, _)| i)
|
||||
}
|
||||
|
||||
fn incident_edges(&self, v: Self::Vertex) -> impl Iterator<Item = Self::Edge> {
|
||||
self.raw_incidences(v).map(|(_, e)| self.normalize_edge(e))
|
||||
}
|
||||
|
||||
fn incidences(&self, v: Self::Vertex) -> impl Iterator<Item = (Self::Vertex, Self::Edge)> {
|
||||
self.raw_incidences(v)
|
||||
.map(|(vs, e)| (self.vertices.get_idx(vs.0).unwrap(), self.normalize_edge(e)))
|
||||
|
||||
Reference in New Issue
Block a user