Advertisement
Guest User

caiobm

a guest
Jan 23rd, 2009
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. /*
  2.  *  Main.java 1.0
  3.  *  Application to SearchGraphAlgorithms
  4.  */
  5.  
  6. /**
  7.  *
  8.  * @author Caio Bomfim Martins
  9.  */
  10. public class Main {
  11.     public static void main(String[] args) throws java.io.IOException {          
  12.         SearchGraphAlgorithms ga = new SearchGraphAlgorithms();
  13.        
  14.         Graph<Double,Double> mg = new MatGraph("graph.txt");
  15.        
  16.         SearchGraphAlgorithms.SearchInfo so = ga.search(TypeSearchEnum.DIJKSTRA, 4, mg);  
  17.        
  18.         System.out.println("A partir do vertice 4: ");
  19.         System.out.println("Menor Caminho para o ");
  20.         for(int i = 0; i < 8; i++) {
  21.             System.out.println("Vertice " + i + " " + so.getPathFrom(i));
  22.         }
  23.        
  24.         System.out.println("\n\nMenor Distancia para o ");
  25.         for(int i = 0; i < 8; i++) {
  26.             System.out.println("Vertice " + i + " " + so.getDistFrom(i));
  27.         }
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement