Kruskal's O(n*m) alg workspace auto-config