changement du cout de label du format integer en double pour avoir les memes valeurs avec Bellman Ford et Dijkstra

This commit is contained in:
knzrd 2025-05-26 15:32:52 +02:00
parent a73f89d6db
commit d78019f648
2 changed files with 3 additions and 6 deletions

View file

@ -2,10 +2,8 @@ package org.insa.graphs.algorithm.shortestpath;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.insa.graphs.algorithm.AbstractSolution; import org.insa.graphs.algorithm.AbstractSolution;
import org.insa.graphs.algorithm.ArcInspector; import org.insa.graphs.algorithm.ArcInspector;
import org.insa.graphs.algorithm.ArcInspectorFactory;
import org.insa.graphs.algorithm.utils.BinaryHeap; import org.insa.graphs.algorithm.utils.BinaryHeap;
import org.insa.graphs.algorithm.utils.ElementNotFoundException; import org.insa.graphs.algorithm.utils.ElementNotFoundException;
import org.insa.graphs.model.Arc; import org.insa.graphs.model.Arc;
@ -14,6 +12,7 @@ import org.insa.graphs.model.Node;
import org.insa.graphs.model.Path; import org.insa.graphs.model.Path;
public class DijkstraAlgorithm extends ShortestPathAlgorithm { public class DijkstraAlgorithm extends ShortestPathAlgorithm {
public DijkstraAlgorithm(ShortestPathData data) { public DijkstraAlgorithm(ShortestPathData data) {
@ -137,9 +136,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
// when the algorithm terminates, return the solution that has been found // when the algorithm terminates, return the solution that has been found
return solution; return solution;
} }
} }

View file

@ -20,7 +20,7 @@ public class Label implements Comparable<Label>{
public Label (Node sommet_courant){ public Label (Node sommet_courant){
this.sommet_courant = sommet_courant; this.sommet_courant = sommet_courant;
this.marque = false; this.marque = false;
this.cout_realise = Integer.MAX_VALUE; this.cout_realise = Double.POSITIVE_INFINITY;
this.arcpere_fils = null; this.arcpere_fils = null;
} }
//setter sommet courant //setter sommet courant