scholarly journals Binary Gray Codes with Long Bit Runs

10.37236/1720 ◽  
2003 ◽  
Vol 10 (1) ◽  
Author(s):  
Luis Goddyn ◽  
Pavol Gvozdjak

We show that there exists an $n$-bit cyclic binary Gray code all of whose bit runs have length at least $n - 3\log_2 n$. That is, there exists a cyclic ordering of $\{0,1\}^n$ such that adjacent words differ in exactly one (coordinate) bit, and such that no bit changes its value twice in any subsequence of $n-3\log_2 n$ consecutive words. Such Gray codes are 'locally distance preserving' in that Hamming distance equals index separation for nearby words in the sequence.

2002 ◽  
Vol 65 (3) ◽  
pp. 399-406
Author(s):  
Inessa Levi ◽  
Steve Seif

We prove that for positive integers n and r satisfying 1 < r < n, with the single exception of n = 4 and r = 2, there exists a constant weight Gray code of r-sets of Xn = {1, 2, …, n} that admits an orthogonal labelling by distinct partitions, with each subsequent partition obtained from the previous one by an application of a permutation of the underlying set. Specifically, an r-set A and a partition π of Xn are said to be orthogonal if every class of π meets A in exactly one element. We prove that for all n and r as stated, and taken modulo , there exists a list of the distinct r-sets of Xn with |Ai ∩ Ai+1| = r − 1 and a list of distinct partitions such that πi is orthogonal to both Ai and Ai+1, and πi+1 = πiλi for a suitable permutation λi of Xn.


2019 ◽  
Vol 28 (1) ◽  
pp. 109-119
Author(s):  
Ahmad Sabri ◽  
Vincent Vajnovszki

Abstract A generalized (resp. p-ary) ballot sequence is a sequence over the set of non-negative integers (resp. integers less than p) where in any of its prefixes each positive integer i occurs at most as often as any integer less than i. We show that the Reected Gray Code order induces a cyclic 3-adjacent Gray code on both, the set of fixed length generalized ballot sequences and p-ary ballot sequences when p is even, that is, ordered list where consecutive sequences (regarding the list cyclically) differ in at most 3 adjacent positions. Non-trivial efficient generating algorithms for these ballot sequences, in lexicographic order and for the obtained Gray codes, are also presented.


2009 ◽  
Vol 6 (2) ◽  
pp. 12 ◽  
Author(s):  
Afaq Ahmad ◽  
Mohammed M. Bait Suwailam

 The purpose of this paper is to present a new and faster algorithmic procedure for generating the n bi Gray codes. Thereby, through this paper we have presented the derivation, design and implementation of a newly developed algorithm for the generation of an n-bit binary reflected Gray code sequences. The developed algorithm is stemmed from the fact of generating and properly placing the min-terms from the universal set of all the possible min-terms [m0 m1 m2 …. mN] of Boolean function of n variables, where, 0 < N <  2n-1. The resulting algorithm is in concise form and trivial to implement. Furthermore, the developed algorithm is equipped with added attributes of optimizing of time and space while executed. 


1996 ◽  
Vol 06 (01) ◽  
pp. 27-34 ◽  
Author(s):  
IVAN STOJMENOVIC

We present a cost-optimal parallel algorithm for generating n-ary reflected Gray codes, i.e. variations of m elements out of {0, 1,…, n–1} in a Gray code order. It uses a linear array of m processors, each having constant size memory and each being responsible for producing one part of a given variation. The algorithm is simple and uses a weaker model of computation than a recently published algorithm. In addition, it can be made adaptive (i.e. to run on a linear array with an arbitrary number of processors) and can be generalized to produce variations out of an arbitrary set of elements.


2014 ◽  
Vol 06 (04) ◽  
pp. 1450062
Author(s):  
Victoria Horan ◽  
Glenn Hurlbert

A Gray code is a listing structure for a set of combinatorial objects such that some consistent (usually minimal) change property is maintained throughout adjacent elements in the list. While Gray codes for m-ary strings have been considered in the past, we provide a new, simple Gray code for fixed-weight m-ary strings. In addition, we consider a relatively new type of Gray code known as overlap cycles and prove basic existence results concerning overlap cycles for fixed-weight and weight-range m-ary words.


2005 ◽  
Vol 78 (92) ◽  
pp. 87-92
Author(s):  
Seymour Lipschutz ◽  
Jie Gao ◽  
Wang Dianjun

Robert Sedgewick [5] lists various Gray codes for the permutations in Sn including the classical algorithm by Johnson and Trotter. Here we give an algorithm which constructs many families of Gray codes for Sn, which closely follows the construction of the Binary Reflexive Gray Code for the n-cube Qn.


2004 ◽  
Vol 12 (1) ◽  
pp. 47-76 ◽  
Author(s):  
Jonathan Rowe ◽  
Darrell Whitley ◽  
Laura Barbulescu ◽  
Jean-Paul Watson

Representations are formalized as encodings that map the search space to the vertex set of a graph. We define the notion of bit equivalent encodings and show that for such encodings the corresponding Walsh coefficients are also conserved. We focus on Gray codes as particular types of encoding and present a review of properties related to the use of Gray codes. Gray codes are widely used in conjunction with genetic algorithms and bit-climbing algorithms for parameter optimization problems. We present new convergence proofs for a special class of unimodal functions; the proofs show that a steepest ascent bit climber using any reflected Gray code representation reaches the global optimum in a number of steps that is linear with respect to the encoding size. There are in fact many different Gray codes.Shifting is defined as a mechanism for dynamically switching from one Gray code representation to another in order to escape local optima. Theoretical results that substantially improve our understanding of the Gray codes and the shifting mechanism are presented. New proofs also shed light on the number of unique Gray code neighborhoods accessible via shifting and on how neighborhood structure changes during shifting. We show that shifting can improve the performance of both a local search algorithm as well as one of the best genetic algorithms currently available.


10.37236/1235 ◽  
1996 ◽  
Vol 3 (1) ◽  
Author(s):  
Bette Bultena ◽  
Frank Ruskey

A Gray code is a Hamilton path $H$ on the $n$-cube, $Q_n$. By labeling each edge of $Q_n$ with the dimension that changes between its incident vertices, a Gray code can be thought of as a sequence $H = t_1,t_2,\ldots,t_{N-1}$ (with $N = 2^n$ and each $t_i$ satisfying $1 \le t_i \le n$). The sequence $H$ defines an (undirected) graph of transitions, $G_H$, whose vertex set is $\{1,2,\ldots,n\}$ and whose edge set $E(G_H) = \{ [t_i,t_{i+1}] \mid 1 \le i \le N-1 \}$. A $G$-code is a Hamilton path $H$ whose graph of transitions is a subgraph of $G$; if $H$ is a Hamilton cycle then it is a cyclic $G$-code. The classic binary reflected Gray code is a cyclic $K_{1,n}$-code. We prove that every tree $T$ of diameter 4 has a $T$-code, and that no tree $T$ of diameter 3 has a $T$-code.


10.37236/1241 ◽  
1996 ◽  
Vol 3 (1) ◽  
Author(s):  
Matthew B. Squire

For any $q \geq 2$, let $\Sigma_{q}=\{0,\ldots,q\!-\!1\}$, and fix a string $A$ over $\Sigma_{q}$. The $A$-free strings of length $n$ are the strings in $\Sigma_{q}^n$ which do not contain $A$ as a contiguous substring. In this paper, we investigate the possibility of listing the $A$-free strings of length $n$ so that successive strings differ in only one position, and by $\pm 1$ in that position. Such a listing is a Gray code for the $A$-free strings of length $n$. We identify those $q$ and $A$ such that, for infinitely many $n \geq 0$, a Gray code for the $A$-free strings of length $n$ is prohibited by a parity problem. Our parity argument uses techniques similar to those of Guibas and Odlyzko (Journal of Combinatorial Theory A 30 (1981) pp. 183–208) who enumerated the $A$-free strings of length $n$. When $q$ is even, we also give the complementary positive result: for those $A$ for which an infinite number of parity problems do not exist, we construct a Gray code for the $A$-free strings of length $n$ for all $n \geq 0$.


2009 ◽  
Vol Vol. 11 no. 2 (Graph and Algorithms) ◽  
Author(s):  
Darko Dimitrov ◽  
Tomáš Dvořák ◽  
Petr Gregor ◽  
Riste Škrekovski

Graphs and Algorithms International audience A (cyclic) n-bit Gray code is a (cyclic) ordering of all 2(n) binary strings of length n such that consecutive strings differ in a single bit. Equivalently, an n-bit Gray code can be viewed as a Hamiltonian path of the n-dimensional hypercube Q(n), and a cyclic Gray code as a Hamiltonian cycle of Q(n). In this paper we study (cyclic) Gray codes avoiding a given set of faulty edges that form a matching. Given a matching M and two vertices u, v of Q(n), n >= 4, our main result provides a necessary and sufficient condition, expressed in terms of forbidden configurations for M, for the existence of a Gray code between u and v that avoids M. As a corollary. we obtain a similar characterization for a cyclic Gray code avoiding M. In particular, in the case that M is a perfect matching, Q(n) has a (cyclic) Gray code that avoids M if and only if Q(n) - M is a connected graph. This complements a recent result of Fink, who proved that every perfect matching of Q(n) can be extended to a Hamiltonian cycle. Furthermore, our results imply that the problem of Hamilionicity of Q(n) with faulty edges, which is NP-complete in general, becomes polynomial for up to 2(n-1) edges provided they form a matching.


Sign in / Sign up

Export Citation Format

Share Document