This file contains 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
""" | |
DFS with children visited in sorted order. | |
Nodes must be sortable. | |
Basic algorithms for depth-first searching. | |
Based on http://www.ics.uci.edu/~eppstein/PADS/DFS.py | |
by D. Eppstein, July 2004. | |
""" | |
__author__ = """\n""".join(['Aric Hagberg <hagberg@lanl.gov>']) |
This file contains 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 as nx | |
import sys | |
G=nx.read_gexf(sys.argv[1]) | |
for u,d in G.nodes(data=True): | |
print(u,d) | |
for u,v,d in G.edges(data=True): | |
print(u,v,d) | |
print(G.graph) | |
print "G",type(G) | |
nx.write_gexf(G,'test.gexf') |
NewerOlder