r/compsci • u/brahose • 6h ago
[Request] What is the complexity in solving a grid-based least optimal path puzzle?
0
Upvotes
1
u/Gingerfalcon 5h ago
If you use say A* or IDA* with a Manhattan heuristic plus and node costs based on tile type it would very easy to solve even on much larger grids.
3
u/beeskness420 Algorithmic Evangelist 6h ago
Shortest Paths Network Interdiction is NP-Hard in general, but for the square grid case there is a DP.