diff --git a/graphs/basic_graphs.py b/graphs/basic_graphs.py index 64c51e139..308abc083 100644 --- a/graphs/basic_graphs.py +++ b/graphs/basic_graphs.py @@ -128,7 +128,9 @@ def dijk(G, s): from collections import deque -def topo(G, ind=None, Q=[1]): +def topo(G, ind=None, Q=None): + if Q is None: + Q = [1] if ind is None: ind = [0] * (len(G) + 1) # SInce oth Index is ignored for u in G: