-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
[WIP] Support undirected graphs for Algorithm\ShortestPath #79
Conversation
Each algorithm only implements the new method which returns an intermediary result. The dedicated Result interface implements the common accessors and avoids running the algorithm again. Added a BC layer for now, which forwards all method calls.
The new algorithms now use a smaller signature and avoid passing the start Vertex to the ctor. Keep a BC layer for now.
Conflicts: lib/Fhaculty/Graph/Algorithm/ShortestPath/MooreBellmanFord.php tests/Fhaculty/Graph/Algorithm/ShortestPath/BaseShortestPathTest.php tests/Fhaculty/Graph/Algorithm/ShortestPath/MooreBellmanFordTest.php
The new design allows for a much cleaner implementation. This now also works for undirected edges just as well. Fixes #66
The good news:
The bad news:
So while the end result looks good to me, it's quite difficult to work with. To clean things up a bit, I'll have to rework this whole thing and introduce smaller, independent changesets. Obviously, this will take some time. So if anybody wants to test out the results and check if this branch fixes #66, go ahead :) But expect this to take some time until it can actually be merged. |
All algorithms will be split off to a separate package graphp/algorithms (see also #119 for some background). As such, this PR can no longer be merged into this repo. That being said, I'd still love this see this in! I've filed a new ticket as a reminder to keep track of this PR until it has been migrated over. |
This PR is a WIP ticket to keep track of the current status to actually support undirected graphs for Dijkstra and MooreBellmanFord.
Refs #66 (original bug report + lengthy details on what needs to be done) and supersedes #68 (initial attempt).