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

    genComboEdges();
    tempTime = System.currentTimeMillis() - startTime - totalTime;
    totalTime += tempTime;
    System.out.println("Generated "+edges.length+" edges: " + tempTime/1000.0 + " sec");

    Arrays.sort(edges);
    tempTime = System.currentTimeMillis() - startTime - totalTime;
    totalTime += tempTime;
    System.out.println("Sorted edges: " + tempTime/1000.0 + " sec");

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

    for (Edge e : edges) {
      if (!nodesConnected(e.from, e.to)) {    // e does not create a cycle
        mst[i++] = e;
        e.addNodes();
      }
      if (i == mst.length) {
        break;
      }
    }
    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");
  }