Compare commits
No commits in common. "224ab4a97d70f712c754bd691e774c7c1e7e6423" and "6baec1d7dd53a51e96fccee4d60f05cb279a562a" have entirely different histories.
224ab4a97d
...
6baec1d7dd
1 changed files with 3 additions and 7 deletions
|
|
@ -78,15 +78,11 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
// Si le noeud n'a pas déjà était rajouté au tas, on le rajoute
|
// Si le noeud n'a pas déjà était rajouté au tas, on le rajoute
|
||||||
// isReached permet de vérifier en complexité O(1)
|
// isReached permet de vérifier en complexité O(1)
|
||||||
// C'est un léger coût en mémoire pour un gain en vitesse
|
// C'est un léger coût en mémoire pour un gain en vitesse
|
||||||
if (successor.isReached()) {
|
if (!successor.isReached()) {
|
||||||
// removing then inserting resorts the binary heap
|
tas.insert(successor);
|
||||||
tas.remove(successor);
|
|
||||||
} else {
|
|
||||||
successor.markReached();
|
successor.markReached();
|
||||||
notifyNodeReached(successor.getNode());
|
notifyNodeReached(successor.getNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
tas.insert(successor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +106,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
// current node and add it to the path
|
// current node and add it to the path
|
||||||
if (parent_label != null) {
|
if (parent_label != null) {
|
||||||
for (Arc arc : parent_label.getNode().getSuccessors()) {
|
for (Arc arc : parent_label.getNode().getSuccessors()) {
|
||||||
if (arc.getDestination().getId() == current_label.getNode().getId() && data.isAllowed(arc)) {
|
if (arc.getDestination().getId() == current_label.getNode().getId()) {
|
||||||
arcs_path.add(arc);
|
arcs_path.add(arc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue