Add GraphTopology::incidences(), update and add related tests

This commit is contained in:
2026-05-08 13:12:23 +02:00
parent d3fcd690a5
commit 0bcd270d12
4 changed files with 378 additions and 63 deletions
+1
View File
@@ -19,6 +19,7 @@ pub trait GraphTopology {
fn vertices(&self) -> impl Iterator<Item = Self::Vertex>;
fn adjacent_vertices(&self, v: Self::Vertex) -> impl Iterator<Item = Self::Vertex>;
fn edges(&self) -> impl Iterator<Item = Self::Edge>;
fn incidences(&self, v: Self::Vertex) -> impl Iterator<Item = (Self::Vertex, Self::Edge)>;
fn add_vertex(&mut self) -> Self::Vertex;
fn add_edge(&mut self, v1: Self::Vertex, v2: Self::Vertex) -> Self::Edge;
}