-
-
Notifications
You must be signed in to change notification settings - Fork 49.4k
Open
@vivekkumarrathour
Description
Feature description
Feature Description
The repository currently contains various graph traversal algorithms (BFS, DFS, Dijkstra) but lacks the A* (A-Star) pathfinding algorithm, which is one of the most widely used pathfinding algorithms in computer science, game development, robotics, and AI applications.
Proposed Implementation
I propose adding an A* pathfinding algorithm implementation in the graphs/ directory with the following features:
- Core A algorithm* with configurable heuristic functions
- Support for weighted graphs (grid-based and adjacency list representations)
- Multiple heuristic functions:
- Manhattan distance (for grid-based pathfinding)
- Euclidean distance
- Chebyshev distance
- Comprehensive doctests demonstrating various use cases
- Type hints for all function parameters and return values
- Clear documentation with examples and complexity analysis
Why This Enhancement?
- A* is a fundamental algorithm taught in AI and algorithms courses
- It's widely used in real-world applications (GPS navigation, game AI, robotics)
- Complements existing graph algorithms in the repository
- Provides educational value for learners understanding informed search algorithms
Example Use Cases
- Grid-based pathfinding (game maps, mazes)
- Route planning in weighted graphs
- Robot navigation
- Comparison with uninformed search algorithms (BFS, DFS)
Benefits
- Educational resource for students learning AI and graph algorithms
- Practical implementation that can be used in real projects
- Demonstrates the difference between informed and uninformed search strategies
I would be happy to implement this feature following the repository's contributing guidelines if approved.