diff --git a/graphs/basic_graphs.py b/graphs/basic_graphs.py index ee63ca995de6..1893b26766da 100644 --- a/graphs/basic_graphs.py +++ b/graphs/basic_graphs.py @@ -141,7 +141,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: