Documentation of pathfinding (ported from Google docs)