Add graph density

Change-Id: I97036e8cf2f528633287d4abe46fe5779a8d5f76
This commit is contained in:
Joshua Harlow
2013-09-28 20:46:17 +00:00
parent 278e2ba53b
commit 013aa6beb7

View File

@@ -71,6 +71,7 @@ def pformat(graph):
for (u, v, e_data) in graph.edges_iter(data=True):
reason = e_data.get('reason', '??')
lines.append(" %s -> %s (%s)" % (u, v, reason))
lines.append("Density: %0.3f" % nx.density(graph))
cycles = list(nx.cycles.recursive_simple_cycles(graph))
lines.append("Cycles: %s" % len(cycles))
for cycle in cycles: