back
$
./pathfinding
--advanced
A*
Dijkstra
BFS
DFS
Greedy
BiDir
Lee
run
clear
|
|
slow
fast
|
[READY]
Algo
Terrain
Maze
WP
Stats
A* Search
Expands by f = g + h. g = accumulated cost, h = Manhattan heuristic.
Time
O(b^d)
Space
O(b^d)
Optimal
Yes
Heuristic
Yes
insight
Gold standard for grid pathfinding. Finds optimal path while exploring fewer nodes than Dijkstra.
cost function
Distance only
Edge length (1 or √2)
Terrain cost
dist × terrain type multiplier
Elevation / Slope
dist × slope factor (uphill costly, downhill cheap)
Combined (realistic)
dist × terrain × slope — cliffs impassable
compare all
A*
opt
h
O(b^d)
Dijkstra
opt
—
O(V+E·logV)
BFS
opt
—
O(V+E)
DFS
—
—
O(V+E)
Greedy
—
h
O(b^d)
BiDir
opt
—
O(b^(d/2))
Lee
opt
—
O(V)
draw:
Artificial Wall
Erase
Mud
Water
Swamp
WP
diag
S
E
wall
visited
path
wp
mud×2
water×3
swamp×5
hide [P]