From 4e6be87c683015a28c1325b9139b900c183663e4 Mon Sep 17 00:00:00 2001 From: Favary Pierre Date: Fri, 14 May 2021 12:29:34 +0200 Subject: [PATCH] =?UTF-8?q?pause=20repas=20-=20probl=C3=A8me=20avec=20les?= =?UTF-8?q?=20restrictions=20d'arcs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shortestpath/DijkstraAlgorithm.java | 217 ++++++++++-------- .../shortestpath/DijkstraAlgorithmTest.java | 102 ++++---- 2 files changed, 171 insertions(+), 148 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 61f3028..365a856 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,109 +1,124 @@ -package org.insa.graphs.algorithm.shortestpath; - -import org.insa.graphs.algorithm.AbstractSolution.Status; -import org.insa.graphs.algorithm.utils.BinaryHeap; -import org.insa.graphs.model.Arc; -import org.insa.graphs.model.Node; -import org.insa.graphs.model.Path; -import java.util.ArrayList; -import java.util.Collections;//trier tout ça - -public class DijkstraAlgorithm extends ShortestPathAlgorithm { + package org.insa.graphs.algorithm.shortestpath; - - public DijkstraAlgorithm(ShortestPathData data) { - super(data); - } - - public Label LabelTyped(Node sommet,Arc padre, float prix){ - return new Label(sommet,padre, prix); - } - - @Override - protected ShortestPathSolution doRun() { - - final ShortestPathData data = getInputData(); - ShortestPathSolution solution = new ShortestPathSolution(data,Status.UNKNOWN);//modifié - - //initialisation - BinaryHeap