DONE Dijsktra
This commit is contained in:
parent
fa87e8d63b
commit
d53cc298d9
1 changed files with 2 additions and 3 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue