Merge branch 'master' of https://git.etud.insa-toulouse.fr/brunetto/BEGraphes
This commit is contained in:
commit
7254b3000e
2 changed files with 13 additions and 43 deletions
|
@ -1,10 +1,5 @@
|
|||
package org.insa.graphs.algorithm.shortestpath;
|
||||
|
||||
import org.insa.graphs.algorithm.utils.BinaryHeap;
|
||||
import java.util.ArrayList ;
|
||||
import org.insa.graphs.model.Node;
|
||||
import org.insa.graphs.model.Arc;
|
||||
|
||||
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||
|
||||
public DijkstraAlgorithm(ShortestPathData data) {
|
||||
|
@ -15,42 +10,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
protected ShortestPathSolution doRun() {
|
||||
final ShortestPathData data = getInputData();
|
||||
ShortestPathSolution solution = null;
|
||||
|
||||
|
||||
int i ;
|
||||
|
||||
/* Taille du graphe */
|
||||
int tailleGraphe = data.getGraph().size() ;
|
||||
|
||||
/* Tableau contenant tous les labels */
|
||||
ArrayList<Label> labelSommets = new ArrayList<Label>() ;
|
||||
|
||||
/* Déclaration du label */
|
||||
Label currentLabel ;
|
||||
|
||||
/* Déclaration du tas */
|
||||
BinaryHeap<Integer> leTas = new BinaryHeap<Integer>() ;
|
||||
|
||||
/* Compte le nombre de sommets marqués */
|
||||
int nbrMarques = 0 ;
|
||||
|
||||
int x ;
|
||||
|
||||
for(i=0;i<tailleGraphe;i++) {
|
||||
/* Initialisation */
|
||||
currentLabel = new Label(data.getGraph().get(i)) ;
|
||||
labelSommets.set(i, currentLabel) ; //On met notre label dans le tableau dédié
|
||||
}
|
||||
|
||||
leTas.insert(data.getOrigin().)
|
||||
|
||||
while (currentLabel.marque = false) {
|
||||
x = leTas.deleteMin() ;
|
||||
for (Arc arc : data.getGraph().getNodes()) {
|
||||
currentLabel = new Label(node) ;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO:
|
||||
return solution;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package org.insa.graphs.algorithm.shortestpath;
|
|||
import org.insa.graphs.model.Arc;
|
||||
import org.insa.graphs.model.Node;
|
||||
|
||||
|
||||
|
||||
public class Label {
|
||||
|
||||
/* ATTRIBUTS */
|
||||
|
@ -57,6 +55,18 @@ public class Label {
|
|||
return this.pere ;
|
||||
}
|
||||
|
||||
/* Setter Pour Marque */
|
||||
public void setMarqueTrue() {
|
||||
this.marque = true;
|
||||
}
|
||||
|
||||
/* Setter Pour Cout et Perer */
|
||||
public void setNouveauChemin(Arc arcPere, double coutRealise){
|
||||
this.pere = arcPere;
|
||||
this.coutRealise = coutRealise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue