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);
}
Aggregations