8Get Them All. Algorithms and Permutations.
8.1 Generating Permutations
8.1.1 Generating All n-Permutations
If we want to write a computer program to test a conjecture concerning permutations, we need to have an efficient method to generate all n-permutations for our machine. If the conjecture only concerns permutations with some restrictions, we can save a lot of time and effort by having a fast way to generate only those permutations with the required property.
One can certainly list all permutations lexicographically. That is, let us define a partial order on the set of all n-permutations as follows. Let if for the smallest index i for which , we have . The total order defined on ...
Get Combinatorics of Permutations, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.