From 013aa6beb75508c36510e41e89f10939792fe474 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 28 Sep 2013 20:46:17 +0000 Subject: [PATCH] Add graph density Change-Id: I97036e8cf2f528633287d4abe46fe5779a8d5f76 --- taskflow/utils/graph_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/taskflow/utils/graph_utils.py b/taskflow/utils/graph_utils.py index ce15992a..60b847a4 100644 --- a/taskflow/utils/graph_utils.py +++ b/taskflow/utils/graph_utils.py @@ -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: