This project is read-only.

Walking Graphs

Iterate vertices
Use the Vertices property to get an enumerable collection of vertices:
foreach(var v in g.Vertices)
    Console.WriteLine(v);
Iterate edges
Use the Edges property get an enumerable collection of edges:
foreach(var e in g.Edges)
    Console.WriteLine(e);
Iterate out edges
The OutEdges method returns an enumerable collection of out-edges:
foreach(var v in g.Vertices)
    foreach(var e in g.OutEdges(v))
        Console.WriteLine(e);

Similarly, InEdges returns an enumerable collection of in-edges.

Last edited Jan 2, 2009 at 12:01 PM by pelikhan, version 6

Comments

avikalpgupta Aug 3, 2016 at 11:36 AM 
There doesn't seem to be an InEdges function in the graph. Only the OutEdges seems to work.