Results 1  10
of
11
A Survey of Combinatorial Gray Codes
 SIAM Review
, 1996
"... The term combinatorial Gray code was introduced in 1980 to refer to any method for generating combinatorial objects so that successive objects differ in some prespecified, small way. This notion generalizes the classical binary reflected Gray code scheme for listing nbit binary numbers so that ..."
Abstract

Cited by 81 (2 self)
 Add to MetaCart
The term combinatorial Gray code was introduced in 1980 to refer to any method for generating combinatorial objects so that successive objects differ in some prespecified, small way. This notion generalizes the classical binary reflected Gray code scheme for listing nbit binary numbers so that successive numbers differ in exactly one bit position, as well as work in the 1960's and 70's on minimal change listings for other combinatorial families, including permutations and combinations. The area of combinatorial Gray codes was popularized by Herbert Wilf in his invited address at the SIAM Discrete Mathematics Conference in 1988 and his subsequent SIAM monograph in which he posed some open problems and variations on the theme. This resulted in much recent activity in the area and most of the problems posed by Wilf are now solved. In this paper, we survey the area of combinatorial Gray codes, describe recent results, variations, and trends, and highlight some open problems. ...
Generating Linear Extensions Fast
"... One of the most important sets associated with a poset P is its set of linear extensions, E(P) . "ExtensionFast.html" 87 lines, 2635 characters One of the most important sets associated with a poset P is its set of linear extensions, E(P) . In this paper, we present an algorithm to generate all of t ..."
Abstract

Cited by 36 (6 self)
 Add to MetaCart
One of the most important sets associated with a poset P is its set of linear extensions, E(P) . "ExtensionFast.html" 87 lines, 2635 characters One of the most important sets associated with a poset P is its set of linear extensions, E(P) . In this paper, we present an algorithm to generate all of the linear extensions of a poset in constant amortized time; that is, in time O(e(P)) , where e ( P ) =  E(P) . The fastest previously known algorithm for generating the linear extensions of a poset runs in time O(n e(P)) , where n is the number of elements of the poset. Our algorithm is the first constant amortized time algorithm for generating a ``naturally defined'' class of combinatorial objects for which the corresponding counting problem is #Pcomplete. Furthermore, we show that linear extensions can be generated in constant amortized time where each extension differs from its predecessor by one or two adjacent transpositions. The algorithm is practical and can be modified to efficiently count linear extensions, and to compute P(x < y) , for all pairs x,y , in time O( n^2 + e ( P )).
Generating Linear Extensions of Posets by Transpositions
 J. Combinatorial Theory (B
, 1992
"... This paper considers the problem of listing all linear extensions of a partial order so that successive extensions differ by the transposition of a single pair of elements. A necessary condition is given for the case when the partial order is a forest. A necessary and sufficient condition is given f ..."
Abstract

Cited by 27 (2 self)
 Add to MetaCart
This paper considers the problem of listing all linear extensions of a partial order so that successive extensions differ by the transposition of a single pair of elements. A necessary condition is given for the case when the partial order is a forest. A necessary and sufficient condition is given for the case where the partial order consists of disjoint chains. Some open problems are mentioned. 1 Introduction Many combinatorial objects can be represented by permutations subject to various restrictions. The set of linear extensions of a poset can be viewed as a set of permutations of the elements of the poset. If the Hasse diagram of the poset consists of two disjoint chains, then the linear extension permutations correspond to combinations. If the poset consists of disjoint chains, then the linear extension permutations correspond to multiset permutations. The extensions of the poset that is the product of a 2element chain with an nelement chain correspond to "ballot sequences" of ...
Simple combinatorial Gray codes constructed by reversing sublists
, 1993
"... . We present three related results about simple combinatorial Gray codes constructed recursively by reversing certain sublists. First, we show a bijection between the list of compositions of Knuth and the list of combinations of Eades and McKay. Secondly, we provide a short description of a list of ..."
Abstract

Cited by 22 (7 self)
 Add to MetaCart
. We present three related results about simple combinatorial Gray codes constructed recursively by reversing certain sublists. First, we show a bijection between the list of compositions of Knuth and the list of combinations of Eades and McKay. Secondly, we provide a short description of a list of combinations satisfying a more restrictive closeness criteria of Chase. Finally, we develop a new, simply described, Gray code list of the partitions of a set into a fixed number of blocks, as represented by restricted growth sequences. In each case the recursive definition of the list is easily translatable into an algorithm for generating the list in time proportional to the number of elements in the list; i.e., each object is produced in O(1) amortized time by the algorithm. 1 Introduction Frank Gray patented the Binary Reflected Gray Code (BRGC) in 1953 for use in "pulse code communication", but the underlying construction of the code existed for centuries as the solution of a puzzle th...
Generating Binary Trees by Transpositions
 Journal of Algorithms
, 1995
"... Let T(n) denote the set of all bitstrings with n 1's and n 0's that satisfy the property that in every prefix the number of 0's does not exceed the number of 1's. This is a well known representation of binary trees. We consider algorithms for generating the elements of T(n) that satisfy one of the f ..."
Abstract

Cited by 19 (4 self)
 Add to MetaCart
Let T(n) denote the set of all bitstrings with n 1's and n 0's that satisfy the property that in every prefix the number of 0's does not exceed the number of 1's. This is a well known representation of binary trees. We consider algorithms for generating the elements of T(n) that satisfy one of the following constraints: (a) successive bitstrings differ by the transposition of two bits, or (b) successive bitstrings differ by the transposition of two adjacent bits. In case (a) a constant average time generation algorithm is presented. In case (b) we show that such generation is possible if and only if n is even or n ! 5. A constant average time algorithm is presented in this case as well. 1 Introduction Binary Trees are of fundamental importance in computer science. In recent years there has been some interest in algorithms that generate all binary trees with a fixed number of nodes (for example, Ruskey and Hu [17], Proskurowski [10], Zaks [20], Pallo [9], Zerling [21]) or restricted cl...
Generating Combinations by Prefix Shifts
 Proc. 11th Annual International Computing and Combinatorics Conference (COCOON’2005), LNCS 3595
, 2005
"... We present a new Gray code for combinations that is practical and elegant. We represent combinations as bitstrings with s 0’s and t 1’s, and generate them with a remarkably simple rule: Identify the shortest prefix ending in 010 or 011 (or the entire bitstring if no such prefix exists) and then rota ..."
Abstract

Cited by 6 (2 self)
 Add to MetaCart
We present a new Gray code for combinations that is practical and elegant. We represent combinations as bitstrings with s 0’s and t 1’s, and generate them with a remarkably simple rule: Identify the shortest prefix ending in 010 or 011 (or the entire bitstring if no such prefix exists) and then rotate (shift) it by one position to the right. Since the rotated portion of the string consists of at most four contiguous runs of 0’s and 1’s, each successive combination can be generated by transposing only one or two pairs of bits. This leads to a very efficient loopless implementation. The Gray code also has a simple and efficient ranking algorithm that closely resembles that of combinations in colex order. For this reason, we have given a nickname to our order: coollex! 1 Background and motivation An important class of computational tasks is the listing of fundamental combinatorial structures such as permutations, combinations, trees, and so on. Regarding combinations, Donald E. Knuth [8] writes “Even the apparently lowly topic of combination generation turns out to be surprisingly rich,.... I strongly believe in building up a firm foundation, so I have discussed this topic much more thoroughly than I will be able to do with material that is newer or less basic.” The applications of combination generation are numerous and varied, and Gray codes for them are particularly valuable. We mention as application areas cryptography (where they have been implemented in hardware at NSA), genetic algorithms, software and hardware
AN EXPLICIT UNIVERSAL CYCLE FOR THE (n − 1)PERMUTATIONS OF AN nSET
"... Abstract. We show how to construct an explicit Hamilton cycle in the directed Cayley graph Cay({σn, σn−1} : Sn), where σk is the rotation (1 2 · · · k). The existence of such cycles was shown by Jackson (Discrete Mathematics, 149 (1996) 123–129) but the proof only shows that a certain directed gra ..."
Abstract

Cited by 5 (2 self)
 Add to MetaCart
Abstract. We show how to construct an explicit Hamilton cycle in the directed Cayley graph Cay({σn, σn−1} : Sn), where σk is the rotation (1 2 · · · k). The existence of such cycles was shown by Jackson (Discrete Mathematics, 149 (1996) 123–129) but the proof only shows that a certain directed graph is Eulerian, and Knuth (Volume 4 Fascicle 2, Generating All Tuples and Permutations (2005)) asks for an explicit construction. We show that a simple recursion describes our Hamilton cycle and that the cycle can be generated by an iterative algorithm that uses O(n) space. Moreover, the algorithm produces each successive edge of the cycle in constant time; such algorithms are said to be loopless. Finally, our Hamilton cycle can be used to construct an explicit universal cycle for the (n − 1)permutations of a nset, or as the basis of an efficient algorithm for generating every npermutation of an nset within a circular array or linked list. 1. Introduction and
The coolest way to generate combinations
 Discrete Mathematics
"... Abstract. We present a practical and elegant method for generating all (s, t)combinations (binary strings with s zeros and t ones): Identify the shortest prefix ending in 010 or 011 (or the entire string if no such prefix exists), and rotate it by one position to the right. This iterative rule give ..."
Abstract

Cited by 5 (5 self)
 Add to MetaCart
Abstract. We present a practical and elegant method for generating all (s, t)combinations (binary strings with s zeros and t ones): Identify the shortest prefix ending in 010 or 011 (or the entire string if no such prefix exists), and rotate it by one position to the right. This iterative rule gives an order to (s, t)combinations that is circular and genlex. Moreover, the rotated portion of the string always contains at most four contiguous runs of 0s and 1s, so every iteration can be achieved by transposing at most two pairs of bits. This leads to an efficient loopless and branchless implementation that consists only of two variables and six assignment statements. The order also has a number of striking similarities to colex order, especially its recursive definition and ranking algorithm. In light of these similarities we have named our order coollex!
Generating Permutations With kDifferences
 SIAM Journal on Discrete Mathematics
, 1989
"... Given (n; k) with n k 2 and k 6= 3, we show how to generate all permutations of n objects (each exactly once) so that successive permutations differ in exactly k positions, as do the first and last permutations. This solution generalizes known results for the specific cases where k = 2 and k = ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
Given (n; k) with n k 2 and k 6= 3, we show how to generate all permutations of n objects (each exactly once) so that successive permutations differ in exactly k positions, as do the first and last permutations. This solution generalizes known results for the specific cases where k = 2 and k = n. When k = 3, we show that it is possible to generate all even (odd) permutations of n objects so that successive permutations differ in exactly 3 positions. Keywords. permutations, Gray codes, combinatorial algorithms, Cayley graphs, Hamilton cycles AMS(MOS) subject classifications. 05A15, 05C45 1 Introduction The problem of generating permutations of n distinct objects is of fundamental importance both in Computer Science and in Combinatorics. Many practical problems require for their solution a sampling of random permutations or, worse, a search through all n! permutations. In order for such a search to be possible, even for moderate size n, permutation generation methods must be e...
An EadesMcKay Algorithm for WellFormed Parentheses Strings
 Information Processing Letters
, 1998
"... Let T(n) be the set of all wellformed parentheses strings of length 2n. We show that the elements of T(n) can be listed so that successive strings differ by the transposition of a left and a right parenthesis. Furthermore, between the two parentheses that are transposed, only left parentheses occur ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Let T(n) be the set of all wellformed parentheses strings of length 2n. We show that the elements of T(n) can be listed so that successive strings differ by the transposition of a left and a right parenthesis. Furthermore, between the two parentheses that are transposed, only left parentheses occur. Our listing is a modification of the wellknown EadesMcKay [4] algorithm for generating combinations. Like that algorithm, ours generates strings from the lexicographically greatest string to the lexicographically least and can be implemented so that each string is generated in constant time, in an amortized sense. 1 Introduction Among the classes of strings studied by mathematicians and computer scientists, perhaps none has been examined so intensely as the class of wellformed parentheses strings. There is a natural correspondence, right parentheses to internal nodes and left parentheses to leaves, between these strings and extended binary trees. As a consequence, one representation is...