Add GraphTopology::edges() and tests

This commit is contained in:
2026-05-05 22:54:33 +02:00
parent c589095737
commit 6e9867a65e
4 changed files with 97 additions and 29 deletions
+7
View File
@@ -181,6 +181,13 @@ impl GraphTopology for Graph {
}
}
fn edges(&self) -> impl Iterator<Item = Self::Edge> {
self.incidences
.iter()
.filter(|(i, _)| i.arr_idx() % 2 == 0)
.map(|(i, _)| i)
}
fn add_vertex(&mut self) -> Self::Vertex {
self.vertices.insert(VertexIncidenceHeader {
incidence_count: 0,