Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Moore-Bellman-Ford for unweighted edges #81

Merged
merged 5 commits into from
Dec 29, 2013
Merged

Fix Moore-Bellman-Ford for unweighted edges #81

merged 5 commits into from
Dec 29, 2013

Conversation

clue
Copy link
Member

@clue clue commented Nov 19, 2013

Spotted an issue while adding unit tests for Algorithm\DetectNegativeCycle (#88):

Detecting negative cycles fails for graphs with multiple components.

Turns out this was actually an issue with unweighted edges, which caused their weights to be re-calculated on each iteration which was then interpreted as a negative cycle. This PR fixes this by explicitly considering a null weight as (int)0 weight.

  • Implement Fix
  • 100% test coverage
  • Documentation / Changelog

@clue clue mentioned this pull request Dec 27, 2013
1 task
@clue
Copy link
Member Author

clue commented Dec 27, 2013

Finally resolved: This was actually an issue with undirected edges. PR updated accordingly and WIP marker removed.

This is now ready for review / merge. Given how trivial this fix is, I'm looking forward to merge this soon.

clue added a commit that referenced this pull request Dec 29, 2013
Fix Moore-Bellman-Ford for unweighted edges
@clue clue merged commit aadcd1e into master Dec 29, 2013
@clue clue deleted the fix-mbf branch December 29, 2013 19:47
@clue clue mentioned this pull request Dec 30, 2013
4 tasks
@clue clue added this to the v0.8.0 milestone Jul 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant