def __init__(self, graph): assert graph.directed, "must be digraph" DFS.__init__(self, graph) self.id = [-1] * graph.V self.count = 0