-
-
Notifications
You must be signed in to change notification settings - Fork 331
Add Breadth-First Search (BFS) algorithm implementation #[HACKTOBERFEST 2025] #152
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
Add Breadth-First Search (BFS) algorithm implementation #[HACKTOBERFEST 2025] #152
Conversation
- Implement BFS with queue-based traversal - Include shortest path finding functionality - Add function to find vertices at specific distances - Comprehensive examples with complex graphs - Create new graph_algorithms directory - Update DIRECTORY.md to include the new algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new Breadth-First Search (BFS) implementation with shortest path and distance-based utilities, plus an index entry in DIRECTORY.md.
- Implements three BFS-related functions (traversal, shortest path, vertices at distance).
- Adds embedded example/demo code executing on load.
- Updates directory listing with a Graph Algorithms section.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.
File | Description |
---|---|
graph_algorithms/breadth_first_search.r | Adds BFS traversal, shortest path, and distance query functions plus inline executable examples. |
DIRECTORY.md | Adds Graph Algorithms section pointing to new BFS implementation. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Please check the comments |
@siriak sir all conflicts has been resolved |
🚀 Overview
This PR adds a comprehensive implementation of the Breadth-First Search (BFS) algorithm with advanced features including shortest path finding and distance-based vertex discovery.
✨ Features
🎯 Why This Matters
BFS is essential for:
📚 Implementation Details
bfs_shortest_path()
- Returns path and distancebfs_vertices_at_distance()
- Finds vertices at exact distance🧪 Testing
Comprehensive examples including:
📁 Files Added
graph_algorithms/breadth_first_search.r
- Complete BFS implementationDIRECTORY.md
with BFS entry🔗 Complements
This pairs perfectly with DFS to provide complete graph traversal coverage for the repository.
🎃 Hacktoberfest 2025
Adds another fundamental algorithm with practical applications, enhancing the repository's educational value for computer science students.