{ Adrian.Matías Quezada }

Pathfinding

AlgorithmCanvasWebpack

Pathfinding (more specifically A*) is an algorithm that finds a path between two points.

In this case an area is drawn with some obstacles in the way (in purple) and two white points are added. The algorithm quickly finds a viable (not necessarily the most efficient) path between both points and paints it yellow.

One of the most difficult aspects of this algorithm is we don't know if there's even a valid path between both points, if there is none we want to know it with the less computational cost possible.