dimanche 19 juillet 2015

How to force jumps with std::next_permutation

Is it possible to manipulate the current permutation sequence in order to skip (in my case) "useless" sequences?

If that isn't possible, would a custom implementation of a permutation iteration be as fast as std::next_permutation?

An example:

1 2 3 4 5 6 7 ...

1 3 2 4 5 6 7 ...

Detecting that "2" at the 2nd position isn't valid, leads to skipping every permutation which begins with "1, 2".

Aucun commentaire:

Enregistrer un commentaire