From add3470b718d845dfaa0e392a38ac2ff2cb29f3d Mon Sep 17 00:00:00 2001 From: Clement LACAU Date: Mon, 20 May 2024 01:42:54 +0200 Subject: [PATCH] conflict fix --- .../insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 47c7b0f..785ed6c 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 @@ -73,6 +73,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { // This loop serves to get the length of the arc as // we know its origin and destination for (Arc arc : x.getNode().getSuccessors()) { + if (successor.getNode().equals(arc.getDestination())) { // data.getcost(arc) returns a cost considering the mode chosen: // TIME or LENGTH @@ -82,7 +83,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { } final float possible_path_cost = x.getCost() + arc_cost; - if (successor.getCost() >= possible_path_cost) { + if (successor.getCost() > possible_path_cost) { // Mise à jour du label successor.setPathCost(possible_path_cost); successor.setParentNode(x.getNode());