map nodes, breadth first search for shortest path