début pseudo code Dijkstra et màj BinaryHeap
This commit is contained in:
parent
daf1c415a8
commit
86140f4d3a
2 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
package org.insa.graphs.algorithm.shortestpath;
|
package org.insa.graphs.algorithm.shortestpath;
|
||||||
|
|
||||||
|
import java.util.org.insa.graphs.algorithm.shortestpath.labels;
|
||||||
|
|
||||||
|
|
||||||
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
|
|
||||||
public DijkstraAlgorithm(ShortestPathData data) {
|
public DijkstraAlgorithm(ShortestPathData data) {
|
||||||
|
@ -18,6 +21,16 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
|
|
||||||
// TODO: implement the Dijkstra algorithm
|
// TODO: implement the Dijkstra algorithm
|
||||||
|
|
||||||
|
/*pseudo code :
|
||||||
|
on a à une destination et une origine et un graph pour les appliquer (et arcinspector jsp à quoi sert encore)
|
||||||
|
|
||||||
|
dans graphe y'a la liste de nodes
|
||||||
|
dans chaque node y'a la liste de succesor avec des arcs
|
||||||
|
dans les arcs on peut avoir la destination
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ind == -1) {
|
if (ind == -1) {
|
||||||
throw new ElementNotFoundException(x);
|
throw new ElementNotFoundException(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue