Code for graph/grid construction and pathfinding, for educational purposes.