diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java index 3ca2ab2..86f02d1 100644 --- a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java @@ -49,13 +49,12 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { notifyNodeReached(arc.getDestination()); if (current.isNotMarked() && data.isAllowed(arc)) { - this.updateCost(arc, parent, current, heap); + this.updateCost(arc, parent, current, heap, data); } } } System.out.println("Nb itérations: " + iterationCounter); ShortestPathSolution solution = null; - // Destination has no predecessor, the solution is infeasible... if (labels[destination].getFatherArc() == null) { solution = new ShortestPathSolution(data, AbstractSolution.Status.INFEASIBLE); @@ -81,8 +80,8 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { return solution; } - private void updateCost(Arc arc, Label parent, Label current, BinaryHeap