user1787066
user1787066

Reputation: 89

checking for cycles in a directed graph haskell

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

Answers (2)

Andy Hayden
Andy Hayden

Reputation: 375745

You could try containers package, Data.Graph includes functions for strongly connected components (which are essentially cycles).

Upvotes: 4

Daniel Wagner
Daniel Wagner

Reputation: 153162

http://hackage.haskell.org/package/fgl is fairly complete, and I have heard it's speedy as well.

Upvotes: 4

Related Questions