Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Add enumeration methods+interfaces for out-edge/in-edge traversal, similar to adjacency #11

Closed
sdboyer opened this issue Apr 17, 2014 · 2 comments
Assignees

Comments

@sdboyer
Copy link
Owner

sdboyer commented Apr 17, 2014

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, as EachAdjacent() does).

the final set of methods should be:

  • EachInEdge(Vertex, func(Edge))
  • EachOutEdge(Vertex, func(Edge))
  • EachIncident(Vertex, func(Edge))
@sdboyer sdboyer self-assigned this Apr 17, 2014
sdboyer added a commit that referenced this issue Apr 18, 2014
@sdboyer
Copy link
Owner Author

sdboyer commented Apr 18, 2014

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)
}

@sdboyer
Copy link
Owner Author

sdboyer commented Apr 18, 2014

ugh, that was mind-numbing. #17 really needs to happen next.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant