Skip to content

Add algorithm for simple cycles in a directed graph#126

Open
npcoder2k14 wants to merge 1 commit into
aysylu:masterfrom
npcoder2k14:master
Open

Add algorithm for simple cycles in a directed graph#126
npcoder2k14 wants to merge 1 commit into
aysylu:masterfrom
npcoder2k14:master

Conversation

@npcoder2k14

Copy link
Copy Markdown

Test:
- Add test for the algorithm
@npcoder2k14

Copy link
Copy Markdown
Author

Closing it since build failed on this one.
Will reopen to trigger the build

@npcoder2k14

Copy link
Copy Markdown
Author

@npcoder2k14

npcoder2k14 commented Jan 21, 2020

Copy link
Copy Markdown
Author

@aysylu Can you suggest to me what am I doing wrong?

Testing loom.test.alg FAIL in (bellman-ford-test) (at /home/travis/build/aysylu/loom/target/loom.js:1021:261) expected: (= [{:e INF, :d INF, :b INF, :a INF, :c 0} {:c [:c]}] (bellman-ford g11 :c)) actual: (not (= [{:e nil, :d nil, :b nil, :a nil, :c 0} {:c [:c]}] [{:c 0, :a ##Inf, :b ##Inf, :d ##Inf, :e ##Inf} {:c (:c)}])) FAIL in (bellman-ford-test) (at /home/travis/build/aysylu/loom/target/loom.js:1021:261) expected: (= [{:e 7, :d 5, :c 4, :a INF, :b 0} {:b [:b], :c [:b :c], :d [:b :d], :e [:b :d :e]}] (bellman-ford g12 :b)) actual: (not (= [{:e 7, :d 5, :c 4, :a nil, :b 0} {:b [:b], :c [:b :c], :d [:b :d], :e [:b :d :e]}] [{:b 0, :a ##Inf, :c 4, :d 5, :e 7} {:b (:b), :c (:b :c), :d (:b :d), :e (:b :d :e)}])) FAIL in (bellman-ford-test) (at /home/travis/build/aysylu/loom/target/loom.js:1021:261) expected: (= [{:e INF, :d INF, :b INF, :a INF, :c 0} {:c [:c]}] (bellman-ford g12 :c)) actual: (not (= [{:e nil, :d nil, :b nil, :a nil, :c 0} {:c [:c]}] [{:c 0, :a ##Inf, :b ##Inf, :d ##Inf, :e ##Inf} {:c (:c)}])) FAIL in (bellman-ford-test) (at /home/travis/build/aysylu/loom/target/loom.js:1021:261) expected: (= [{:e 2, :b -5, :c -1, :a INF, :d 0} {:d [:d], :c [:d :e :b :c], :b [:d :e :b], :e [:d :e]}] (bellman-ford g12 :d)) actual: (not (= [{:e 2, :b -5, :c -1, :a nil, :d 0} {:d [:d], :c [:d :e :b :c], :b [:d :e :b], :e [:d :e]}] [{:d 0, :a ##Inf, :b -5, :c -1, :e 2} {:d (:d), :b (:d :e :b), :c (:d :e :b :c), :e (:d :e)}])) FAIL in (bellman-ford-test) (at /home/travis/build/aysylu/loom/target/loom.js:1021:261) expected: (= [{:d -2, :b -7, :c -3, :a INF, :e 0} {:e [:e], :c [:e :b :c], :b [:e :b], :d [:e :b :d]}] (bellman-ford g12 :e)) actual: (not (= [{:d -2, :b -7, :c -3, :a nil, :e 0} {:e [:e], :c [:e :b :c], :b [:e :b], :d [:e :b :d]}] [{:e 0, :a ##Inf, :b -7, :c -3, :d -2} {:e (:e), :b (:e :b), :c (:e :b :c), :d (:e :b :d)}])) Testing clojure.test.check.properties

Some Bellman-ford tests are failing for me which I haven't even touched.

jsavyasachi added a commit to jsavyasachi/loom that referenced this pull request Jun 21, 2026
Enumerate all simple cycles in a directed graph; returns ::not-a-directed-graph
for undirected input. Ported with tests from aysylu#126.
jsavyasachi added a commit to jsavyasachi/loom that referenced this pull request Jun 21, 2026
Adds simple-paths (aysylu#111) and digraph-all-cycles (aysylu#126); perf for
degeneracy-ordering (aysylu#108) and pre-traverse (aysylu#120).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant