Last active
August 29, 2015 14:25
-
-
Save yohm/f7b0865c5af8d1f4de60 to your computer and use it in GitHub Desktop.
creating a regular random graph with degree d and size N
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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