@@ -134,7 +134,7 @@ class GraphCrawler<T extends Object> {
134134 /// [start] to each reachable vertex.
135135 /// * The map keys represent vertices reachable from [start] .
136136 /// * The map values represent the path from [start] to the vertex listed as
137- /// map key. Note: The first node , [start] , is omitted.
137+ /// map key. Hereby, the first vertex , [start] , is omitted.
138138 Map <T , Set <T >> shortestPaths (T start) {
139139 final pathMap = < T , Set <T >> {};
140140
@@ -249,46 +249,6 @@ class GraphCrawler<T extends Object> {
249249 return result;
250250 }
251251
252- /// Returns a set containing all vertices that are reachable from
253- /// vertex [start] .
254- // Set<T> reachableVertices(T start) {
255- // final result = edges(start).toSet();
256-
257- // final tree = <Set<T>>[];
258- // for (final connected in edges(start)) {
259- // // Store first branches of tree.
260- // tree.add({connected});
261- // }
262-
263- // if (tree.isNotEmpty) {
264- // var startIndex = 0;
265- // var endIndex = 0;
266- // final visited = HashSet<T>()..add(start);
267- // do {
268- // endIndex = tree.length;
269- // for (var i = startIndex; i < endIndex; ++i) {
270- // final path = tree[i];
271- // for (final vertex in edges(path.last)) {
272- // // Discard walks which reach the same (inner) vertex twice.
273- // // Note: Each path starts with [start] even though it is not
274- // // listed!
275- // if (path.contains(vertex) || visited.contains(vertex)) {
276- // continue;
277- // } else {
278- // result.add(vertex);
279-
280- // // Continue growing tree.
281- // tree.add({...path, vertex});
282- // }
283- // }
284- // visited.add(path.last);
285- // }
286- // startIndex = endIndex;
287- // } while (endIndex < tree.length);
288- // }
289- // return result;
290- // }
291-
292252 /// Returns a map containing all paths commencing at [start] .
293253 /// * Each entry of type `Set<T>` represents a path
294254 /// (the [start] vertex is omitted).
0 commit comments