J D
J D

Reputation: 48697

Implementation of Johnson's algorithm to find elementary circuits (cycles) in a graph

Does anyone have source code implementing this algorithm for finding cycles, preferably in a modern statically-typed language like SML, OCaml, Haskell, F#, Scala?

Upvotes: 4

Views: 6659

Answers (4)

Vishrant
Vishrant

Reputation: 16698

You can find it here as part of jgrapht implementation.

Upvotes: 1

Alessandro S.
Alessandro S.

Reputation: 1043

I struggled on this too, I came up with this page that lists some implementations for Johnson algorithm (the one looking for elementary circuits) in Java and OCaml. The author of the blog post fixed some issues in the original implementations, on the same page I linked before there are also the fixed versions of both implementations.

Upvotes: 1

user152468
user152468

Reputation: 3242

The following is a Java implementation of the algorithm you need: https://github.com/1123/johnson. Java running on the JVM, you can also use it from Scala.

Upvotes: 2

mlt
mlt

Reputation: 1669

Will C++ and Boost Graph Library work for you?

Upvotes: 0

Related Questions