}
}
public void computeShortestPathWithDijkstra() {
Graph g = new Graph(graph);
DijkstraAlgorithm2 dijsktra = new DijkstraAlgorithm2();
for (int i = 0; i < n; i++) {
/* NB: it is safe to update graph and use it for distances
* in the same time since we only lookup the distances of
* directly connected nodes, which are not updated.
*/
double[] cost = dijsktra.apply(g, g.nodes[i], graph);
for (int j = 0; j < n; j++) graph.put(i,j, cost[j]);
}
}