-
Notifications
You must be signed in to change notification settings - Fork 41
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
[ALGO] Kosaraju's Algorithm #141
Conversation
Codecov ReportAll modified lines are covered by tests ✅
... and 6 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
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.
Thanks for working on this!
Looks quite good already, was just thinking about a possible issue regarding the order in which we add vertices to the set in the first DFS.
include/graaflib/algorithm/strongly_connected_components/kosaraju.tpp
Outdated
Show resolved
Hide resolved
include/graaflib/algorithm/strongly_connected_components/kosaraju.tpp
Outdated
Show resolved
Hide resolved
include/graaflib/algorithm/strongly_connected_components/kosaraju.tpp
Outdated
Show resolved
Hide resolved
include/graaflib/algorithm/strongly_connected_components/kosaraju.tpp
Outdated
Show resolved
Hide resolved
include/graaflib/algorithm/strongly_connected_components/kosaraju.tpp
Outdated
Show resolved
Hide resolved
test/graaflib/algorithm/strongly_connected_components/kosaraju_test.cpp
Outdated
Show resolved
Hide resolved
test/graaflib/algorithm/strongly_connected_components/kosaraju_test.cpp
Outdated
Show resolved
Hide resolved
Thanks very much for the review! All of these suggestions look great and I will try to implement them when back from work today. |
Thanks a lot and no rush 👍🏻 |
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 excellent 🎉
|
||
using sccs_t = std::vector<std::vector<vertex_id_t>>; |
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.
👍🏻 very nice that we now have this. Also thanks for updating Tarjan!
TEST(KosarajuTest, DisconnectedGraphScenario) { | ||
// GIVEN | ||
const auto [graph, vertex_ids] = | ||
utils::scenarios::create_disconnected_graph_scenario< | ||
directed_graph<int, int>>(); |
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.
Also nice that we are now using these scenario's in the tests! I would like to start using them more throughout the codebase
Implements #115
☑ The algorithm is implemented
☑ The new function has a javadoc-style comment explaining the interface
☑ Appropriate tests are added under
test/graaflib/algorithm/strongly_connected_components/kosarajus_test.cpp
☑ A test coverage of at least 95% is reached
☑ A documentation entry is added under
docs/docs/algorithms
under the appropriate category. Just adding a short description and the algorithm syntax here is fine. See the wiki on how to build the documentation locally☑ The algorithm is added to the list of algorithms in
README.md
I should flag here that I decided to use a simple recursive DFS - the one that was already in the library seemed (unless I am mistaken) more geared towards searching through edges as opposed to vertices. However, if the library implementation of DFS is required please do let me know and I can work it into the existing code.