AI course homework: pathfinding