Reputation: 89
I have created a directed graph in Haskell. I would like to write an algorithm that checks the graph for cycles. Are there library functions available that could do this quickly?
Upvotes: 2
Views: 757
Reputation: 375745
You could try containers package, Data.Graph
includes functions for strongly connected components (which are essentially cycles).
Upvotes: 4
Reputation: 153162
http://hackage.haskell.org/package/fgl is fairly complete, and I have heard it's speedy as well.
Upvotes: 4