combining Dijkstra and the Map