Skip to content

Correct cycle finding for graphs#2199

Merged
mergify[bot] merged 5 commits intomainfrom
cycle-finding
Oct 27, 2024
Merged

Correct cycle finding for graphs#2199
mergify[bot] merged 5 commits intomainfrom
cycle-finding

Conversation

@byorgey
Copy link
Copy Markdown
Member

@byorgey byorgey commented Oct 21, 2024

Closes #2198 . Adds a new function findCycle for finding directed cycles in graphs via DFS, and updates failOnCyclicGraph to use it rather than SCCs for reporting cycles.

@byorgey byorgey requested a review from kostmo October 21, 2024 21:48
@byorgey
Copy link
Copy Markdown
Member Author

byorgey commented Oct 26, 2024

@kostmo any thoughts on this?

Copy link
Copy Markdown
Member

@kostmo kostmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix. Surprised there's not some more off-the-shelf solution though.

@byorgey
Copy link
Copy Markdown
Member Author

byorgey commented Oct 27, 2024

Surprised there's not some more off-the-shelf solution though.

Well, Data.Graph from containers is somewhat impoverished. I was going to say that we could use a more off-the-shelf solution if we switched to fgl... but actually, I don't see any cycle-finding algorithms there either.

See here for a related discussion: haskell/containers#978

@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Oct 27, 2024
@mergify mergify Bot merged commit 39adce6 into main Oct 27, 2024
@mergify mergify Bot deleted the cycle-finding branch October 27, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Trigger the merge process of the Pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cycles are reported incorrectly

2 participants