Package dijkstra

Examples of dijkstra.DijkstraShortestPathsAlgorithm


   */
  public static void main(String[] args) throws FileNotFoundException, CloneNotSupportedException {

    Map<Integer, Vertice> graph =
        DijkstraGraphReader.readGraphFromFile("dijkstra/dijkstraData.txt");
    DijkstraShortestPathsAlgorithm dijkstra = new DijkstraShortestPathsAlgorithm(graph);
    List<Vertice> graphshortestPaths = dijkstra.getVerticiesWithShortetPath(graph.get(1));
    Integer[] requiredVerticiesIndexes = {7,37,59,82,99,115,133,165,188,197};
    List<Integer> requiredVerticiesIndexesList = Arrays.asList(requiredVerticiesIndexes);
    for(Vertice vertice: graphshortestPaths) {
      if (requiredVerticiesIndexesList.contains(vertice.getName()))
        System.out.println(vertice);
View Full Code Here

TOP

Related Classes of dijkstra.DijkstraShortestPathsAlgorithm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.