def save_graph(self, graphname, fmt='gpickle'):
"""
Saves the graph to disk
**Positional Arguments:**
graphname:
- Filename for the graph
**Optional Arguments:**
fmt:
- Output graph format
"""
self.g.graph['ecount'] = nx.number_of_edges(self.g)
if fmt == 'gpickle':
nx.write_gpickle(self.g, graphname)
elif fmt == 'graphml':
nx.write_graphml(self.g, graphname)
else:
raise ValueError('graphml is the only format currently supported')
pass
评论列表
文章目录