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 e4d6aa9..28651cf 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 @@ -2,8 +2,6 @@ package org.insa.graphs.algorithm.shortestpath; import java.util.ArrayList; import java.util.Collections; -import java.util.List; -import java.util.org.insa.graphs.algorithm.shortestpath.Label; import org.insa.graphs.algorithm.AbstractSolution.Status; import org.insa.graphs.algorithm.utils.BinaryHeap; @@ -22,127 +20,92 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { @Override protected ShortestPathSolution doRun() { - // retrieve data from the input problem (getInputData() is inherited from the - // parent class ShortestPathAlgorithm) final ShortestPathData data = getInputData(); - - // variable that will contain the solution of the shortest path problem ShortestPathSolution solution = null; + // accès au graphe + Graph graph = data.getGraph(); + int nbNodes = graph.size(); - // TODO: implement the Dijkstra algorithm + // Tableau des labels pour chaque sommet + Label[] labels = new Label[nbNodes]; + // Tableau des arcs prédécesseurs pour reconstruire le chemin + Arc[] predecessorArcs = new Arc[nbNodes]; - /*pseudo code : - on a à une destination et une origine et un graph pour les appliquer (et arcinspector jsp à quoi sert encore) - - dans graphe y'a la liste de nodes - dans chaque node y'a la liste de succesor avec des arcs - dans les arcs on peut avoir la destination - - dans BinaryHeap on a deletemin qu'on fera à chaque itération de dijkstra pour enlever du tas le sommet avec la plus petite distance de l'origine - - */ - - Graph graphe = data.getGraph(); - Node nodeOriginel=data.getOrigin(); - Node nodeDestination=data.getDestination(); - - BinaryHeap