daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Nov 17th, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Scanner scanner = new Scanner(System.in);
  2.        
  3.         System.out.println("Enter departure city: ");
  4.         String depart = scanner.nextLine();
  5.        
  6.         System.out.println("Enter arrival city: ");
  7.         String arrive = scanner.nextLine();
  8.        
  9.         System.out.println("Shortest path from " + depart + " to " + arrive + ":");
  10.        
  11.         // DIJKSTRA
  12.         DijkstraShortestPath<String, DefaultWeightedEdge> dijkstra = new DijkstraShortestPath<>(skyRoutesGraph);
  13.         SingleSourcePaths<String, DefaultWeightedEdge> shortestPath = dijkstra.getPaths(depart);
  14.         System.out.println(shortestPath.getPath(arrive) + "\n");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top