Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(scc ...) doesn't compute the correct components in some cases #6

Closed
jszakmeister opened this issue Oct 18, 2013 · 1 comment
Closed

Comments

@jszakmeister
Copy link
Contributor

I managed to whittle this down to a test case that fails to compute the correct components, but haven't gotten to the point where I understand what it broken just yet. Here's the test case:

(defn scc-is-busted []
  (let [g (digraph [1 5] [2 4] [3 1] [3 2] [3 6]
                   [4 10] [5 3] [6 1] [6 10] [7 8]
                   [8 9] [8 11] [9 3] [9 5] [9 7]
                   [10 2] [11 2] [11 4])
        components (set (map set (scc g)))
        expected   #{ #{2 4 10} #{1 3 5 6} #{11} #{7 8 9}}]
    (prn components)
    (if (not= expected components)
      (throw (RuntimeException. "scc did not compute the correct components")))))

There should be 4 strongly connected components, but scc is only returning 2, and they're wrong.

@aysylu
Copy link
Owner

aysylu commented Oct 19, 2013

This has been fixed with the pull request #7. Thanks!

@aysylu aysylu closed this as completed Oct 19, 2013
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

No branches or pull requests

2 participants