| B. Heap, Permutations by interchanges, Computer J., 6 (1963), 293-294. |
....on average. A less trivial problem is whether we can generate those objects in O(1) time per object in the worst case. There are such algorithms with O(1) worst case time. To name just a few, Bitner, Ehrlich and Reingold [5] Ehrlich [6] and Lehmer [7] for combinations, Johnson [8] and Heap [9] for permutations, Korsh and Lipschutz [10] for multiset permutations, and Mikawa and Takaoka [11] for parenthesis strings. Johnson s and Heap s algorithms for permutations take O(n) time from object to object, but it is straightforward to convert to ones with O(1) time as in [6] If we relax the ....
....2. We first define the characteristic sequence of a parenthesis string a = a 1 . a n such that a i is the number of right parentheses between the i th and (i 1)th left parentheses for i n and a n is the number of right parentheses after the n th left parenthesis. This characerization is due to [9] and [19] Example 1. For ( its characteristic sequence is given by (1, 1, 0, 2) Let the sum s be defined by s i = a 1 . a i for i=0, n, where s 0 = 0. Then s n =n and a can take the values 0, 1, i s i 1 , which are called valid values. Note that a n = n s n 1 . ....
Heap, B.R., "Permutations by Interchanges," Computer Journal 6 (1963) pp. 293-294
....each exactly once, in such a way that successive permutations on the list differ only by the exchange of two This work was supported in part by the National Science Foundation Grant No. CCR8906500 1 elements. This was shown to be possible in several papers, including [26] 1] 2] and [9], which are described in [24] In fact, it is possible even if the two elements exchanged are required to be in adjacent positions ( 13] 25] It is interesting to note that in the Wells Boothroyd Heap algorithms, the last permutation differs from the first permutation by a transposition only ....
B. R. Heap, "Permutations by interchanges," Comput. J., 6 (1963), pp. 293-94.
....4 2 1 3 4 4 1 3 2 4 3 2 1 4 2 1 3 3 2 4 1 2 1 4 3 1 3 4 2 2 4 1 3 1 4 3 2 3 4 2 1 Figure 5: Generating permutations by derangements, due to Lynn Yarbrough. 11 differ only by the exchange of two elements. Such a Gray code for permutations was shown to be possible in several papers, including [Boo65, Boo67, Hea63, Wel61], which are described in [Sed77] One disadvantage of these algorithms is that the elements exchanged are not necessarily in adjacent positions. It was shown independently by Johnson [Joh63] and Trotter [Tro62] that it is possible to generate permutations by transpositions even if the two ....
B. R. Heap. Permutations by interchanges. Computer Journal, 6:293--94, 1963.
....1g, if such a v(k) exists; otherwise, vmin(n) minfv(k) j 1 k n Gamma 1g. Beginning with the processor label v = 12 : n, the remaining n Gamma 1 labels are arranged in the order produced by algorithm LABELS (n; j) given below. This algorithm is a modification of a procedure described in [28] (see also [58] for generating permutations. It operates throughout on the array v = v(1)v(2) v(n) Initially, v(i) i, 1 i n, and the algorithm is called with j = 1. A new permutation is produced every time two elements of the array v are swapped. Algorithm LABELS(n; j) Step 1: i ....
B.R. Heap. Permutations by interchanges. The Computer Journal, Vol. 6, 1963, pp. 293--294.
No context found.
B. Heap, Permutations by interchanges, Computer J., 6 (1963), 293-294.
No context found.
B. Heap, Permutations by interchanges, Computer J., 6 (1963), 293-294.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC