feat : Add Iterative Deepening DFS)#262
Merged
siriak merged 2 commits intoOct 24, 2025
Merged
Conversation
Contributor
Author
|
@siriak please have a look sir. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive implementation of the Iterative Deepening Depth-First Search (IDDFS) algorithm to the R repository. IDDFS combines the space efficiency of DFS with the optimality guarantees of BFS by performing repeated depth-limited searches with increasing depth limits.
- Implements IDDFS with robust graph normalization and cycle detection
- Includes comprehensive documentation, examples, and verbose output options
- Provides production-ready code with proper error handling and input validation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
siriak
approved these changes
Oct 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Iterative Deepening Depth-First Search (IDDFS) in R
This PR introduces a fully documented, optimized, and production-ready implementation of the Iterative Deepening Depth-First Search (IDDFS) algorithm in R.
IDDFS combines the completeness of Breadth-First Search (BFS) with the space efficiency of Depth-First Search (DFS), making it suitable for exploring large or infinite state spaces where depth is unknown.
🔍 Overview
The
iddfs()function repeatedly performs Depth-Limited Search (DLS) from depth0up to a user-definedmax_depth.It halts once the target vertex is found, ensuring the shallowest (shortest depth) solution is discovered efficiently.
✨ Key Features
normalize_graph()ensures robust adjacency handlingexample_iddfs()demonstrating typical graph search cases⚙️ Algorithm Details
🧮 Applications
🧱 Example Usage