View the model
Download the model
Generate all permuations of the numbers 1, 2, ..., NPERM; Ref: Heap, B. R. (1963). "Permutations by Interchanges". The Computer Journal. 6 (3): 293–4.. Sedgewick, R. (1977). "Permutation Generation Methods". ACM Computing Surveys. 9 (2): 137–164.;