Python icon indicating copy to clipboard operation
Python copied to clipboard

Add A* (A-Star) Pathfinding Algorithm Implementation

Open vivekkumarrathour opened this issue 1 month ago • 1 comments

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:

  1. Core A algorithm* with configurable heuristic functions
  2. Support for weighted graphs (grid-based and adjacency list representations)
  3. Multiple heuristic functions:
    • Manhattan distance (for grid-based pathfinding)
    • Euclidean distance
    • Chebyshev distance
  4. Comprehensive doctests demonstrating various use cases
  5. Type hints for all function parameters and return values
  6. 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.

vivekkumarrathour avatar Nov 17 '25 16:11 vivekkumarrathour