예제 #1
0
  public static void main(String[] args) {

    if (args.length != 1) {
      System.out.println("Usage: java Msp <filename>");
      System.exit(2);
    }
    Graph g = new Graph();
    loadFile(g, args[0]);

    // Calculate locations of nodes
    g.prepareNodes();
    // Perform kruskal algorithm
    g.kruskal();

    // Show results in JFrame
    MainWindow f = new MainWindow(g);
    f.setSize(800, 600);
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }