The canonical method to generate such a random permutation, which is termed _cyclic_ , is Sattolo's algorithm, a variant of the Fisher-Yates shuffle to generate a random general permutation. Its description is terrifically simple:
> Swap the last unprocessed element of the list with a random element $a$ that lies strictly before it. Mark $a$ as processed.