DONE Dijsktra

This commit is contained in:
Sebastien Moll 2026-04-20 06:50:49 +02:00
parent fa87e8d63b
commit d53cc298d9

View file

@ -39,7 +39,6 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
Label destinationNodeLabel = labelsList.get(data.getDestination().getId());
Label concurentNodeLabel = labelsList.get(data.getOrigin().getId());
concurentNodeLabel.setCoutRealise(0);
concurentNodeLabel.setMarque();
notifyOriginProcessed(data.getOrigin());
@ -72,11 +71,11 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
ArrayList<Arc> pathArcs = new ArrayList<Arc>();
concurentNodeLabel = destinationNodeLabel;
while(concurentNodeLabel.getPere() != null) {
pathArcs.add(concurentNodeLabel.getPere());
pathArcs.add(0, concurentNodeLabel.getPere());
concurentNodeLabel = labelsList.get(concurentNodeLabel.getPere().getOrigin().getId());
}
Collections.reverse(pathArcs);
// Collections.reverse(pathArcs);
solution = new ShortestPathSolution(data, Status.OPTIMAL, new Path(graph, pathArcs));