From fefe2d3a629690055c211fbbdb70dcc437668f7d Mon Sep 17 00:00:00 2001 From: knzrd Date: Wed, 21 May 2025 15:07:49 +0200 Subject: [PATCH] ajout de setters pour Label et debut de Dijkstra --- .../shortestpath/DijkstraAlgorithm.java | 10 +++++---- .../graphs/algorithm/shortestpath/Label.java | 21 ++++++++++++++++++- 2 files changed, 26 insertions(+), 5 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 ef5c638..f1e0952 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 @@ -1,11 +1,7 @@ package org.insa.graphs.algorithm.shortestpath; -import org.insa.graphs.algorithm.AbstractInputData; -import org.insa.graphs.algorithm.utils.BinaryHeap; import org.insa.graphs.model.Graph; import org.insa.graphs.model.Node; -import org.insa.graphs.model.Arc; -import org.insa.graphs.model.Path; public class DijkstraAlgorithm extends ShortestPathAlgorithm { @@ -31,7 +27,13 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { ShortestPathSolution solution = null; // TODO: implement the Dijkstra algorithm + // On crée un tableau de label avec un label pour chacun des noeuds :de 0 à N-1 + Label tableau_label[] = new Label[nbNodes] ; + // on commence par mettre tous les label à +inf (soit ici la plus grande valeur possible) + for (int i=0;i