diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clojure/contrib/graph.clj | 5 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib/test_graph.clj | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/clojure/contrib/graph.clj b/src/clojure/contrib/graph.clj index 5890a8f8..34a3454e 100644 --- a/src/clojure/contrib/graph.clj +++ b/src/clojure/contrib/graph.clj @@ -56,8 +56,7 @@ ) (defn- post-ordered-visit - "Starting at node n, return a sequence of a post-ordered walk of the - graph." + "Starting at node n, perform a post-ordered walk." [g n [visited acc :as state]] (if (visited n) state @@ -84,7 +83,7 @@ acc (let [[nv comp] (post-ordered-visit rev (first stack) - [visited []]) + [visited #{}]) ns (remove nv stack)] (recur ns nv (conj acc comp)))))] (step po #{} []))) diff --git a/src/clojure/contrib/test_contrib/test_graph.clj b/src/clojure/contrib/test_contrib/test_graph.clj index 7a92a734..093462b8 100644 --- a/src/clojure/contrib/test_contrib/test_graph.clj +++ b/src/clojure/contrib/test_contrib/test_graph.clj @@ -60,7 +60,7 @@ (deftest test-scc - (is (= (map set (scc test-graph-2)) + (is (= (scc test-graph-2) [#{8 9} #{7} #{6} #{5} #{0 1 2 3 4}])) (is (empty? (scc empty-graph)))) |