public void genMSTFast() {
    final long startTime = System.currentTimeMillis();
    long totalTime = 0;
    long tempTime = 0;
    System.out.println("Connecting "+nodes.size()+" nodes optimally");

    // Generate edges for Graph
    if (getCombos()) {
      System.out.println("Using all edge combinations...");
      genComboEdges();
    } else {
      System.out.println("Using BFS to make edges...");
      genBFSEdges();
    }
    tempTime = System.currentTimeMillis() - startTime - totalTime;
    totalTime += tempTime;
    System.out.println("Generated "+edges.length+" edges: " + tempTime/1000.0 + " sec");

    // Generate the edge PriorityQueue
    PriorityQueue<Edge> pq = new PriorityQueue<Edge>();
    for (Edge e : edges)
      pq.add(e);
    tempTime = System.currentTimeMillis() - startTime - totalTime;
    totalTime += tempTime;
    System.out.println("Generated edge priority queue: " + tempTime/1000.0 + " sec");

    // Generate MST
    UnionFind<Node> uf = new UnionFind<Node>();
    uf.makeUnionFind(nodes);

    Edge[] mst = new Edge[nodes.size()-1];
    int i = 0;

    Edge e;
    while (i < mst.length) {
      e = pq.poll();
      if (e == null)
        break;
      if (uf.find(e.from) != uf.find(e.to)) {    // e does not create a cycle
        mst[i++] = e;
        e.addNodes();
        uf.union(e.from, e.to);
      }
    }
    edges = mst;
    tempTime = System.currentTimeMillis() - startTime - totalTime;
    totalTime += tempTime;
    System.out.println("Finished MST: " + tempTime/1000.0 + " sec");
    System.out.println("Total time elapsed: " + totalTime/1000.0 + " sec\n");
  }