Compare commits

..

No commits in common. "45f43559ff223a12f2ca6ab7212a6bdecc0f6947" and "c91585c90d9d1f1b3ee81dfc5723224c519da726" have entirely different histories.

2 changed files with 8 additions and 6 deletions

View file

@ -47,14 +47,16 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
for (Label l : List){ for (Label l : List){
if (l.getSommet()==y){ if (l.getSommet()==y){
if(!l.isMarque()){ if(!l.isMarque()){
double cout = l.getCost();
System.out.println("c = " + cout);
Boolean changé = false; Boolean changé = false;
if (x.getCost()+data.getCost(suivant) < l.getCost()){ l.setCost(Math.min(l.getCost(), x.getCost()+suivant.getLength()));
changé = true; System.out.println("l = " + l.getCost());
} System.out.println("x = " + x.getCost());
if(changé){ if(cout != l.getCost()){
if (arcs.size() < i ){ if (arcs.size() < i ){
System.out.println("arc"); System.out.println("arc");
}else if (l.getCost() < arcs.get(i-1).getLength()){ }else if (cout < arcs.get(i-1).getLength()){
arcs.remove(i-1); arcs.remove(i-1);
} }
Tas.insert(l); Tas.insert(l);
@ -62,7 +64,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
arcs.add(suivant); arcs.add(suivant);
l.setMarque(true); l.setMarque(true);
} }
l.setCost(Math.min(l.getCost(), x.getCost()+data.getCost(suivant)));
} }
} }
} }