Precise Dijkstra to compute travel possibilities

and required optimization to make it work.