working dijkstra and routing by agent!