Skip to content

Instantly share code, notes, and snippets.

@reiddraper
Created March 7, 2010 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reiddraper/324629 to your computer and use it in GitHub Desktop.
Save reiddraper/324629 to your computer and use it in GitHub Desktop.
D = nx.DiGraph()
n = G.nodes()
m = {}
for i, x in enumerate(n):
m[x] = i
for a,b in G.edges():
D.add_edge( m[a], m[b] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment