Interface EdgeSet

  • All Superinterfaces:
    Collection<Integer>, IntCollection, IntIterable, IntSet, Iterable<Integer>, Set<Integer>

    public interface EdgeSet
    extends IntSet
    Set of graph edges.

    A set of integers, each represent an edge ID in a graph

     
     Graph g = ...;
     int vertex = ...;
     for (EdgeIter eit = g.outEdges(vertex).iterator(); eit.hasNext();) {
     	int e = eit.nextInt();
     	int u = eit.source();
     	int v = eit.target();
     	assert vertex == u;
     	System.out.println("Out edge of " + vertex + ": " + e + "(" + u + ", " + v + ")");
     }
     
    Author:
    Barak Ugav
    See Also:
    EdgeIter