diff --git a/paraffin/utils.py b/paraffin/utils.py index dae3462..1f4e523 100644 --- a/paraffin/utils.py +++ b/paraffin/utils.py @@ -124,7 +124,8 @@ def dag_to_levels( for node in nx.bfs_tree(graph, start_node): if node not in nodes: nodes.append(node) - # iterate all paths from start_node to node + # find the longest path from the start_node to the current node + # to determine the level of the current node level = 0 for path in nx.all_simple_paths(graph, start_node, node): level = max(level, len(path) - 1)