Generate a circular graph of type GraphType with Nodes nodes. The generated graph will have an edge from each node to the subsequent OutDegree nodes.
Parameters:
Class of output graph – one of PNGraph, PNEANet, or PUNGraph.
Number of nodes in the generated graph.
The number of edges to be added to each node. This number does not include reciprocal edges.
Indicates whether the edges should be directed or undirected. Defaults to directed.
Return value:
A Snap.py graph of the specified type.
The following example shows how to generate circular graphs for classes TNGraph, TUNGraph, and TNEANet:
import snap
Graph = snap.GenCircle(snap.PNGraph, 100, 10)
for EI in Graph.Edges():
print "edge: (%d, %d)" % (EI.GetSrcNId(), EI.GetDstNId())
UGraph = snap.GenCircle(snap.PUNGraph, 100, 10)
for EI in UGraph.Edges():
print "edge: (%d, %d)" % (EI.GetSrcNId(), EI.GetDstNId())
Network = snap.GenCircle(snap.PNEANet, 100, 10)
for EI in Network.Edges():
print "edge: (%d, %d)" % (EI.GetSrcNId(), EI.GetDstNId())