Add permutation generation algorithm.