A* pathfinder on the grid coordinate system.
Uses Manhattan distance with corner penalty as heuristic. 4-directional movement only (no diagonals). Previously-routed edges are soft obstacles (cost +2).
Summary
Functions
Find a path from start to end using A*.
Manhattan distance with +1 corner penalty when not axis-aligned.
Remove collinear intermediate points, keeping only corners.
Types
Functions
@spec find_path(integer(), integer(), integer(), integer(), free_fn(), keyword()) :: [coord()] | nil
Find a path from start to end using A*.
Options
:soft_obstacles-MapSetof{col, row}cells occupied by previously-routed edges. Traversable at +2 cost.:max_iterations- maximum iterations before giving up (default: 5000)
Returns a list of {col, row} waypoints, or nil if no path found.
Manhattan distance with +1 corner penalty when not axis-aligned.
Remove collinear intermediate points, keeping only corners.