Strongly connected components, kth element, kruskal, permutations