From 1b6ff22b795e38ca3e9721e6440d710b271aaee6 Mon Sep 17 00:00:00 2001 From: Nabzzz Date: Mon, 13 Apr 2020 10:33:09 +0200 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20Dijkstra=20en=20cour?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shortestpath/DijkstraAlgorithm.java | 42 +++++++++++++------ .../graphs/algorithm/shortestpath/Label.java | 19 ++++++++- 2 files changed, 46 insertions(+), 15 deletions(-) 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 f929eea..2c5f944 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 @@ -8,6 +8,7 @@ import java.util.ArrayList; import org.insa.graphs.algorithm.AbstractSolution.Status; import org.insa.graphs.algorithm.utils.BinaryHeap; +import org.insa.graphs.algorithm.utils.ElementNotFoundException; import org.insa.graphs.model.Arc; import org.insa.graphs.model.Graph; import org.insa.graphs.model.Node; @@ -24,32 +25,47 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { ShortestPathSolution solution = null; Graph graph = data.getGraph(); final int nbNodes=graph.size(); - BinaryHeap tas=new BinaryHeap(); + BinaryHeap