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 d52e3f0..f5208d7 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 @@ -1,8 +1,6 @@ package org.insa.graphs.algorithm.shortestpath; -import org.insa.graphs.model.Node; import org.insa.graphs.model.Arc; import org.insa.graphs.algorithm.AbstractSolution.Status; -import org.insa.graphs.model.Graph; import org.insa.graphs.model.Path; @@ -51,6 +49,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { System.out.println("l'élement n'est pas dans la tas"); } tab.get(index).setCoutmin(x.getCost()+suc.getLength()); + tab.get(index).setPere(suc); /*insertion dans le tas */ tas.insert(tab.get(index)); } @@ -67,7 +66,6 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { // The destination has been found, notify the observers. notifyDestinationReached(data.getDestination()); - // Create the path from the array of predecessors... ArrayList arcs = new ArrayList<>(); Arc arc = label_dest.getPere(); while (arc != null) {