This is an example of the A star algorithm.
For a more genaral A star algorithm see my other PathFinder A Star on gitHub.
Note
This algorithm can only be used in a grid ([[node1, node2, ...], [node3, node4, ...], ...]
).
- Gray: This node is a normal node that can be used.
- yellow: This node is active, it can be part of the final path.
- red: Node that represent the end.
- pink: This node can be part of the path but all of his neighbors are used.
- blue: Node that represent a wall or an obstacle.
- green: Final path.