GraphIterator trait would be a variation on Iterator from the standard library, requiring to implement just "next" functionality (probably next_vertex and next_edge, but I haven't thought about the details at all yet) and providing iterator-like functionality that makes sense to do for graphs. A list of such functionality (not exhaustive):
map(v, e), map_vertices(v), map_edges(e)
filter(v, e), filter_vertices(v), filter_edges(e)
filter_map
count -> (v, e), vertex_count -> v, edge_count -> e
collect -> G with G generic type implementing a trait
When consuming, vertices are always processed first and edges second (existence of an edge is dependent on its endpoint(s) not being removed), which may impose some implementation challenges.
GraphIterator
trait would be a variation onIterator
from the standard library, requiring to implement just "next" functionality (probablynext_vertex
andnext_edge
, but I haven't thought about the details at all yet) and providing iterator-like functionality that makes sense to do for graphs. A list of such functionality (not exhaustive):When consuming, vertices are always processed first and edges second (existence of an edge is dependent on its endpoint(s) not being removed), which may impose some implementation challenges.