Is there a good library (or wrapper to Java library) for graphs, and/or graph algorithms in scala?
This one seems to be quite dead. This is an example for the Dijkstra algorithm in scala, but I'm looking for a library a-la JGraphT.
We have developed a small graph library for the apparat project. You can take a look at it here. It is not purely functional and not a zipper graph but does a good job for us. You get also mutable and immutable graphs.
Here is a simple example for graph creation:
implicit val factory = DefaultEdge[String](_, _)
val G = Graph(
"Entry" -> "A",
"A" -> "B",
"B" -> "C",
"B" -> "D",
"D" -> "F",
"F" -> "E",
"E" -> "F",
"E" -> "C",
"C" -> "A",
"C" -> "Exit")
G.dotExport to Console.out
Finding SCCs and subcomponents
G.sccs foreach println
G.sccs map { _.entry } foreach println
G.sccs filter { _.canSearch } map { _.subcomponents } foreach { _ foreach println }
Traversal
for(x <- G.topsort) println(x)
for(x <- G.dft(y)) println(x)
The current drawback is that the library is supporting only invariant types and not feature complete for a whole graph library.