Search in sources :

Example 1 with DijkstraShortestPath

use of org.jgrapht.alg.shortestpath.DijkstraShortestPath in project tutorials by eugenp.

the class DirectedGraphTests method givenDirectedGraph_whenGetDijkstraShortestPath_thenGetNotNullPath.

@Test
public void givenDirectedGraph_whenGetDijkstraShortestPath_thenGetNotNullPath() {
    DijkstraShortestPath dijkstraShortestPath = new DijkstraShortestPath(directedGraph);
    List<String> shortestPath = dijkstraShortestPath.getPath("v1", "v4").getVertexList();
    assertNotNull(shortestPath);
}
Also used : DijkstraShortestPath(org.jgrapht.alg.shortestpath.DijkstraShortestPath) Test(org.junit.Test)

Aggregations

DijkstraShortestPath (org.jgrapht.alg.shortestpath.DijkstraShortestPath)1 Test (org.junit.Test)1