diff --git a/api/arrange.py b/api/arrange.py index ac5520f..627880a 100644 --- a/api/arrange.py +++ b/api/arrange.py @@ -29,7 +29,7 @@ def topo_sort(graph): column_index = {} for node in reversed(sorted_nodes): - column_index[node] = max([ column_index[node] for node in graph[node] ], default=-1) + 1 + column_index[node] = max([ column_index[adj_node] for adj_node in graph[node] ], default=-1) + 1 if column_index[node] == len(columns): columns.append([node]) else: