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

feat: add Kosaraju Algoritm #699

Closed
wants to merge 2 commits into from

Conversation

11-aryan
Copy link
Contributor

No description provided.

@11-aryan
Copy link
Contributor Author

11-aryan commented Dec 26, 2023

@raklaptudirm @tjgurwara99 Could you please review it ?

graph/kosaraju.go Show resolved Hide resolved
}
}

func GetStronglyConnectedComponents(n int, adj [][]int) [][]int {
Copy link
Member

Choose a reason for hiding this comment

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

I think it would have been much more easier to understand this algorithm if you had used the Graph data structure defined in the graph.go file. There are already a lot of helpers for that graph as well.

Copy link
Contributor Author

@11-aryan 11-aryan Jan 22, 2024

Choose a reason for hiding this comment

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

I didn't use it because the Graph used in graph.go has a slightly different representation with weighted edges which is not required for current algorithm. Using an adjacency list would make it much simpler.

Copy link
Member

Choose a reason for hiding this comment

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

If you don't need the weighted edges, then don't use the weighted edges part of the graph 😄.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (master@58bb31e). Click here to learn what that means.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #699   +/-   ##
=========================================
  Coverage          ?   87.05%           
=========================================
  Files             ?      194           
  Lines             ?     6241           
  Branches          ?        0           
=========================================
  Hits              ?     5433           
  Misses            ?      677           
  Partials          ?      131           

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

Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Mar 16, 2024
Copy link

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Mar 23, 2024
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.

3 participants