Add GraphTopology::edges() and tests
This commit is contained in:
+1
-1
@@ -1,5 +1,4 @@
|
||||
// TODO: Add functions to reserve memory for vertices and edges.
|
||||
// TODO: Add iterator of all edges.
|
||||
// TODO: Add iterator of incident edges for a vertex.
|
||||
// TODO: Add finding incident vertices for an edge.
|
||||
// TODO: Split out GraphTopologyAddition trait.
|
||||
@@ -13,6 +12,7 @@ pub trait GraphTopology {
|
||||
fn are_adjacent(&self, v1: Self::Vertex, v2: Self::Vertex) -> bool;
|
||||
fn vertices(&self) -> impl Iterator<Item = Self::Vertex>;
|
||||
fn neighbors(&self, v: Self::Vertex) -> impl Iterator<Item = Self::Vertex>;
|
||||
fn edges(&self) -> impl Iterator<Item = Self::Edge>;
|
||||
fn add_vertex(&mut self) -> Self::Vertex;
|
||||
fn add_edge(&mut self, v1: Self::Vertex, v2: Self::Vertex) -> Self::Edge;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user