Skip to content

Instantly share code, notes, and snippets.

@yohm
Last active August 29, 2015 14:25
Show Gist options
  • Save yohm/f7b0865c5af8d1f4de60 to your computer and use it in GitHub Desktop.
Save yohm/f7b0865c5af8d1f4de60 to your computer and use it in GitHub Desktop.
creating a regular random graph with degree d and size N
import networkx
import sys
G = networkx.Graph()
argvs = sys.argv
if( len(argvs) != 4 ):
print 'Usage: python %s <d> <n> <seed>' % argvs[0]
quit()
d = int( argvs[1] )
n = int( argvs[2] )
seed = int( argvs[3] )
er = networkx.random_regular_graph(d,n,seed)
for e in er.edges():
print e[0],e[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment