Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add DFS with parent-completion constraint for DAG traversal #6467

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

Copy link
Contributor

@StathisVeinoglou StathisVeinoglou commented Aug 14, 2025

Description

This PR adds a new GraphTraversal class that implements a modified DFS traversal order for directed graphs, ensuring that a node is only visited if all its parents have already been visited.
This approach is useful in dependency resolution and neural network computation graph execution order.

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Copy link

codecov-commenter commented Aug 14, 2025
edited
Loading

Codecov Report

❌ Patch coverage is 77.77778% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.12%. Comparing base (16345cb) to head (ec54953).

Files with missing lines Patch % Lines
...thealgorithms/graph/PredecessorConstrainedDfs.java 77.77% 6 Missing and 6 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## master #6467 +/- ##
============================================
+ Coverage 75.10% 75.12% +0.02% 
- Complexity 5556 5575 +19 
============================================
 Files 686 687 +1 
 Lines 19264 19318 +54 
 Branches 3719 3732 +13 
============================================
+ Hits 14468 14513 +45 
- Misses 4239 4244 +5 
- Partials 557 561 +4 

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

...raightforward about the implementation.Added full names instead of shortcuts, and included record.
Copy link
Contributor Author

Thanks for all the suggestions! I believe that i implemented the changes.
Please let me know if anything further is needed

@DenizAltunkapan DenizAltunkapan merged commit 2dd6a13 into TheAlgorithms:master Aug 15, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@alxkm alxkm alxkm approved these changes

@DenizAltunkapan DenizAltunkapan DenizAltunkapan approved these changes

@yanglbme yanglbme Awaiting requested review from yanglbme yanglbme is a code owner

@vil02 vil02 Awaiting requested review from vil02

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /