-
Notifications
You must be signed in to change notification settings - Fork 430
feat: Add Kou's algorithm for finding a MST #682
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
Conversation
e0d8b6b to
ca0f4c2
Compare
ca0f4c2 to
5a27486
Compare
XVilka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this:
---- src/algo/floyd_warshall.rs - algo::floyd_warshall::floyd_warshall_path (line 127) stdout ----
error[E0432]: unresolved import `petgraph::algo::floyd_warshall_path`
--> src/algo/floyd_warshall.rs:130:5
|
6 | use petgraph::algo::floyd_warshall_path;
| ^^^^^^^^^^^^^^^^-------------------
| | |
| | help: a similar name exists in the module: `floyd_warshall`
| no `floyd_warshall_path` in `algo`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0432`.
Couldn't compile the test.
failures:
src/algo/floyd_warshall.rs - algo::floyd_warshall::floyd_warshall_path (line 127)
|
I always get the following issue when trying to run the pipeline: At least |
It is a restriction by GitHub to avoid malicious CI runs from external contributors. Once the first PR of you will get merged, it wont happen anymore on any subsequent PRs. |
|
@daehiff it still happens |
Ohh, sorry about that. |
5149ec5 to
398820c
Compare
ABorgna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I ran the benchmarks to see if the extra code made the old floyd_warshal impl slower, but it actually seems to be sightly faster now :)
You mentioned you'll add a quickcheck test, I'll wait for that before merging.
Signed-off-by: David Winderl <winderl13@gmail.com>
Simplify compute_shortest_path_length, compute_shortest_path and format compute_metric_closure.
Format reconstruct_metric_closure, my_node_ids to simplify them. Add basic tests for first stages of steiner tree. Implement integration tests in test folder.
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: David Winderl <winderl13@gmail.com>
…l floyd warshall algorithm
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: David Winderl <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
Signed-off-by: daehiff <winderl13@gmail.com>
0f84f2c to
22747e8
Compare
Signed-off-by: daehiff <winderl13@gmail.com> Remove build errors Signed-off-by: daehiff <winderl13@gmail.com> Update src/algo/floyd_warshall.rs Co-authored-by: Agustín Borgna <agustinborgna@gmail.com> Fix PR: Update code such that steiner_trees requires stable graph Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Update module description Signed-off-by: daehiff <winderl13@gmail.com> Disable steiner_tree Signed-off-by: daehiff <winderl13@gmail.com> Add conditional build in quickcheck tests Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Fix formatting Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: fix quickcheck tests Signed-off-by: daehiff <winderl13@gmail.com> Fix PR. Fix Clippy Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Fix Clippy Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Fix build Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Adjust typehints Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Fix clippy by adding typedefs Signed-off-by: daehiff <winderl13@gmail.com> Fix PR: Fix formatting Signed-off-by: daehiff <winderl13@gmail.com>
102b322 to
705c658
Compare
Motivation
This PR implements a generic Steiner Tree algorithm for undirected graphs based on Kou's algorithm. The algorithm leverages Dijkstra's shortest path, Floyd-Warshall path reconstruction, and minimum spanning tree computation to determine the Steiner tree for a set of terminal nodes.
The implementation follows the implementation in the networkx library. A detailed description can be found in A fast algorithm for Steiner trees.
petgraphhas no algorithm to approximate a minimal steiner tree. The algorithm melhorn in the networkx documentation, seems to be only different by the complexity class and apperently is an extension. So this could be implemented at a later point.Runtime
Further Notes
Floyd-warshall implementation is adjusted to also allow path reconstruction (see here) this is required in the function
subgraph_edges_from_metric_closure