Ejemplo n.º 1
0
 public DirectedDFS(DiGraph G, IEnumerable <int> Sources)
 {
     visited = new bool[G.Vertices()];
     foreach (var source in Sources)
     {
         Dfs(G, source);
     }
 }
Ejemplo n.º 2
0
        private bool[] visited;     // visitd[v] = true if v is reachable from source

        public DirectedDFS(DiGraph G, int source)
        {
            visited = new bool[G.Vertices()];
            Dfs(G, source);
        }