-
Notifications
You must be signed in to change notification settings - Fork 20.4k
Implement topological sort with DAG validation and cycle detection #6568
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
Implement topological sort with DAG validation and cycle detection #6568
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #6568 +/- ## ============================================ + Coverage 75.19% 75.22% +0.03% - Complexity 5614 5625 +11 ============================================ Files 690 691 +1 Lines 19407 19445 +38 Branches 3755 3763 +8 ============================================ + Hits 14593 14628 +35 - Misses 4247 4250 +3 Partials 567 567 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Looks like this is already in the repository, but in the wrong package it is definitely related to the graph
@siriak, @DenizAltunkapan, Could you please help clarify our approach here?
There are already several implementations of this algorithm in the repository:
The previous implementation follows a more traditional pattern as it operates directly on color values.
The current implementation also good and it has test coverage.
From my perspective, the optimal solution would be to:
- Migrate the old implementation here
- Make it generic
- Clean up the code (e.g., implement specialized exceptions which already presented here)
- Maintain test suites for both variants
What are your thoughts on this approach?
@alxkm Let’s first align on the right strategy and once confirmed, we can proceed with the necessary implementation.
@the-yash-rajput, you can proceed with the following approach as I described - creating a generic implementation of the algorithm.
- Migrate the existing implementation to the correct package location
- Refactor it to be generic and reusable
- Implement the specialized exceptions that are already present in the your version
- And generic tests for it with Integer and String values
This approach will provide the traditional algorithm that uses color values.
What do you think about this?
@alxkm I agree with the proposed approach, I think both implementations should be stored together.
P.S. I reviewed this 2 days ago, but forgot to write a reply and then lost the tab -_-
Uh oh!
There was an error while loading. Please reload this page.
clang-format -i --style=file path/to/your/file.java