if (_node, direction) not in traversed_list:
if _node not in observed_list:
active_nodes += [_node]
traversed_list += (_node, direction),
if direction == "up" and _node not in observed_list:
for parent in self.predecessors(_node):
visit_list += (parent, "up"),
for child in self.successors(_node):
After Change
// up -> from parent to child
// down -> from child to parent
visit_list = set()
visit_list.add((start, "up"))
traversed_list = set()
active_nodes = set()
while visit_list: