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

Work on Tarjan's SCC algorithm #78

Merged
merged 3 commits into from
Aug 19, 2023

Conversation

ndcroos
Copy link
Contributor

@ndcroos ndcroos commented Aug 15, 2023

See #53

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Patch coverage: 98.85% and project coverage change: -0.17% ⚠️

Comparison is base (b8bd54e) 99.74% compared to head (35036c3) 99.57%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   99.74%   99.57%   -0.17%     
==========================================
  Files          23       25       +2     
  Lines        1158     1408     +250     
==========================================
+ Hits         1155     1402     +247     
- Misses          3        6       +3     
Files Changed Coverage Δ
...b/algorithm/strongly_connected_components_test.cpp 98.57% <98.57%> (ø)
...aaflib/algorithm/strongly_connected_components.tpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@bobluppes bobluppes left a 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, LGTM!
I will commit the minor suggestions, after which I will merge the PR. So no need to address them.

Comment on lines +30 to +33
// Lambda function for the strong connect traversal
std::function<void(vertex_id_t)> strong_connect;

strong_connect = [&](vertex_id_t vertex) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[very minor]: Since we are not passing around the lambda in an interface, we can keep it a lambda closure rather than assigning it to a function object:

Suggested change
// Lambda function for the strong connect traversal
std::function<void(vertex_id_t)> strong_connect;
strong_connect = [&](vertex_id_t vertex) {
// Lambda function for the strong connect traversal
const auto strong_connect = [&](vertex_id_t vertex) {

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see now why you did this, since the function object is used in the body the compiler needs to know the type. Reverted this change in 35036c3.

It might also be interesting to see if we can implement this in terms of the existing traversal algorithms in graph_traversal.h, but I will leave this for a follow up.

@bobluppes bobluppes added the enhancement New feature label Aug 19, 2023
@bobluppes bobluppes merged commit 9c90948 into bobluppes:main Aug 19, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants