Skip to content

Fix BUG in graph reverse method & Add needed tests#916

Merged
trekhleb merged 3 commits into
trekhleb:masterfrom
itsamirhn:fix-graph-reverse
Jun 26, 2026
Merged

Fix BUG in graph reverse method & Add needed tests#916
trekhleb merged 3 commits into
trekhleb:masterfrom
itsamirhn:fix-graph-reverse

Conversation

@itsamirhn

Copy link
Copy Markdown
Contributor

This PR fix the issue in #873.

The issue was in the old reverse method, edges reversed one by one and this was making issue for graphs with cycle of length 2. For example, when graph with only two edges AB and BA was reversing, on reversing AB, BA was exist and there will be crash.

@itsamirhn itsamirhn changed the title Fix graph reverse method & Add needed tests Fix BUG in graph reverse method & Add needed tests Jul 30, 2022
@itsamirhn itsamirhn force-pushed the fix-graph-reverse branch from 71b2b0f to ede3b37 Compare June 3, 2024 22:37
@itsamirhn itsamirhn force-pushed the fix-graph-reverse branch from d41ffb9 to c26a75e Compare June 7, 2026 17:28
@itsamirhn

Copy link
Copy Markdown
Contributor Author

Would you please check this PR? @trekhleb

@trekhleb trekhleb merged commit dc12f1f into trekhleb:master Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants