ajoute dans le headrer du dijisktra algo

This commit is contained in:
Al-Akoum Abdelkader 2025-05-20 11:35:18 +02:00
parent 64f785cf07
commit 67d0edeb0d

View file

@ -1,5 +1,13 @@
package org.insa.graphs.algorithm.shortestpath; package org.insa.graphs.algorithm.shortestpath;
import org.insa.graphs.algorithm.AbstractInputData;
import org.insa.graphs.algorithm.utils.BinaryHeap;
import org.insa.graphs.model.Graph;
import org.insa.graphs.model.Node;
import org.insa.graphs.model.Arc;
import org.insa.graphs.model.Path;
public class DijkstraAlgorithm extends ShortestPathAlgorithm { public class DijkstraAlgorithm extends ShortestPathAlgorithm {
public DijkstraAlgorithm(ShortestPathData data) { public DijkstraAlgorithm(ShortestPathData data) {
@ -12,6 +20,12 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
// retrieve data from the input problem (getInputData() is inherited from the // retrieve data from the input problem (getInputData() is inherited from the
// parent class ShortestPathAlgorithm) // parent class ShortestPathAlgorithm)
final ShortestPathData data = getInputData(); final ShortestPathData data = getInputData();
final Graph graph = data.getGraph();
final int nbNodes = graph.size();
final Node destination = data.getDestination();
final Node origin = data.getOrigin();
// variable that will contain the solution of the shortest path problem // variable that will contain the solution of the shortest path problem
ShortestPathSolution solution = null; ShortestPathSolution solution = null;