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
+4
View File
@@ -102,6 +102,10 @@ impl GraphTopology for AppendGraph {
}
}
fn edges(&self) -> impl Iterator<Item = Self::Edge> {
(0..self.incidences.len()).step_by(2).map(Incidence)
}
fn add_vertex(&mut self) -> Self::Vertex {
self.vertices.push(VertexIncidenceHeader {
incidence_count: 0,