Browse Source

Dijkstra fonctionnel, enfin

Favary Pierre 3 years ago
parent
commit
91e3152d6d

+ 4
- 4
be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java View File

@@ -54,12 +54,12 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
54 54
 	        			
55 55
 	        			if (tablabel[y].cout>tablabel[x].cout+(float)data.getCost(arcy)) {
56 56
 	        				
57
-	        				tablabel[y].cout=tablabel[x].cout+(float)data.getCost(arcy);
58
-	        				tablabel[y].pere=arcy;//ligne non dans le poly
59
-	        				
60 57
 	        				if (tablabel[y].cout!=Float.MAX_VALUE)
61 58
 	        					tas.remove(tablabel[y]);
62
-	        				//méthode à vérifier pour opérer update ou insert
59
+	        				
60
+	        				tablabel[y].cout=tablabel[x].cout+(float)data.getCost(arcy);
61
+	        				tablabel[y].pere=arcy;//ligne non dans le poly
62
+	        				//méthode à vérifier pour opérer update ou insert (avec le if float.max plus haut)
63 63
 	        				tas.insert(tablabel[y]);
64 64
 	        				
65 65
 	        			}

Loading…
Cancel
Save