Energy-Constrained Pathfinding Using Dijkstra and A* Search
This project studies energy-constrained pathfinding on weighted grids using Dijkstra's algorithm and A* search. The goal is to find a minimum-energy path from a start position to a goal while staying within a fixed battery limit. The grid contains obstacles and terrain with different energy costs. Three search methods are implemented and compared: Dijkstra's algorithm, A* with the Manhattan heuristic, and A* with a custom Energy-Aware heuristic that also considers terrain costs. The algorithms are tested using different grid sizes, battery limits, and a fixed terrain example. The results show that all three algorithms find the same path costs and have the same feasibility results in the final experiments. Manhattan A* generally explores fewer nodes than Dijkstra, while Energy-Aware A* explores the fewest nodes. However, Energy- Aware A* has a higher total runtime because its heuristic map must be calculated before the main search begins. Overall, the results show that a stronger heuristic can reduce search effort, but the additional calculation needed for the heuristic can increase total runtime.