Add GraphTopology::incident_edges() and tests
This commit is contained in:
+1
-1
@@ -1,7 +1,6 @@
|
||||
use crate::maps::{EdgeMap, VertexMap};
|
||||
|
||||
// TODO: Add functions to reserve memory for vertices and edges.
|
||||
// TODO: Add iterator of incident edges for a vertex.
|
||||
// TODO: Split out GraphTopologyAddition trait.
|
||||
pub trait GraphTopology {
|
||||
type Vertex: Copy + Eq;
|
||||
@@ -19,6 +18,7 @@ pub trait GraphTopology {
|
||||
fn adjacent_vertices(&self, v: Self::Vertex) -> impl Iterator<Item = Self::Vertex>;
|
||||
fn incident_vertices(&self, e: Self::Edge) -> (Self::Vertex, Self::Vertex);
|
||||
fn edges(&self) -> impl Iterator<Item = Self::Edge>;
|
||||
fn incident_edges(&self, v: Self::Vertex) -> 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;
|
||||
|
||||
Reference in New Issue
Block a user