diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1f4257f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,35 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Current File", + "request": "launch", + "mainClass": "${file}" + }, + { + "type": "java", + "name": "BinaryHeapFormatter", + "request": "launch", + "mainClass": "org.insa.graphs.algorithm.utils.BinaryHeapFormatter", + "projectName": "be-graphes-algos" + }, + { + "type": "java", + "name": "MainWindow", + "request": "launch", + "mainClass": "org.insa.graphs.gui.MainWindow", + "projectName": "be-graphes-gui" + }, + { + "type": "java", + "name": "Launch", + "request": "launch", + "mainClass": "org.insa.graphs.gui.simple.Launch", + "projectName": "be-graphes-gui" + } + ] +} \ No newline at end of file diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/BellmanFordAlgorithm.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/BellmanFordAlgorithm.java index 42986aa..31d88c4 100644 --- a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/BellmanFordAlgorithm.java +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/BellmanFordAlgorithm.java @@ -90,10 +90,11 @@ public class BellmanFordAlgorithm extends ShortestPathAlgorithm { // Reverse the path... Collections.reverse(arcs); + System.out.println(arcs); + // Create the final solution. solution = new ShortestPathSolution(data, Status.OPTIMAL, new Path(graph, arcs)); - } - + } return solution; } diff --git a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java index ef9935e..db02069 100644 --- a/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java +++ b/be-graphes-algos/src/main/java/org/insa/graphs/algorithm/shortestpath/DijkstraAlgorithm.java @@ -1,10 +1,13 @@ package org.insa.graphs.algorithm.shortestpath; +import org.insa.graphs.algorithm.AbstractSolution.Status; import java.util.ArrayList; import java.util.List; import org.insa.graphs.algorithm.utils.BinaryHeap; +import org.insa.graphs.model.Arc; import org.insa.graphs.model.Node; +import org.insa.graphs.model.Path; public class DijkstraAlgorithm extends ShortestPathAlgorithm { @@ -20,17 +23,61 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm { ArrayList