Closed sdboyer closed 10 years ago
Changing that plan - instead it's this:
// An IncidentEdgeEnumerator iteratively enumerates a given vertex's incident edges.
type IncidentEdgeEnumerator interface {
EachEdgeIncidentTo(v Vertex, incidentEdgeLambda EdgeLambda)
}
// An IncidentArcEnumerator iteratively enumerates a given vertex's incident arcs (directed edges).
// One enumerator provides inbound edges, the other outbound edges.
type IncidentArcEnumerator interface {
EachArcFrom(v Vertex, outEdgeLambda EdgeLambda)
EachArcTo(v Vertex, inEdgeLambda EdgeLambda)
}
ugh, that was mind-numbing. #17 really needs to happen next.
right now,
EachAdjacent()
is lying in the implementations - 'adjacency' means the same thing regardless of whether the connecting edge is directed or not. so we need more enumerators that allow traversal purely of out-edges, purely of in-edges, or both (and which send the edge instead of the vertex, asEachAdjacent()
does).the final set of methods should be:
EachInEdge(Vertex, func(Edge))
EachOutEdge(Vertex, func(Edge))
EachIncident(Vertex, func(Edge))