Gray Codes and Enumerative Coding for Vector Spaces
Total Page:16
File Type:pdf, Size:1020Kb
1 Gray Codes and Enumerative Coding for Vector Spaces Moshe Schwartz, Senior Member, IEEE Abstract—Gray codes for vector spaces are considered in two [7]. But what has begun as a purely theoretical area of re- graphs: the Grassmann graph, and the projective-space graph, search, has recently found an important application to network both of which have recently found applications in network coding. coding, starting with the work of Koetter and Kschischang For the Grassmann graph, constructions of cyclic optimal codes are given for all parameters. As for the projective-space graph, [19], and continuing with [8], [9], [13], [14], [29]–[31], [33]. two constructions for specific parameters are provided, as well In this work we study q-analogs of Gray codes, which some non-existence results. are Hamiltonian circuits in the projective-space graph, and Furthermore, encoding and decoding algorithms are given for q-analogs for constant-weight Gray codes, which are Hamil- the Grassmannian Gray code, which induce an enumerative- tonian circuits in the Grassmann graph. For the former, we coding scheme. The computational complexity of the algorithms is at least as low as known schemes, and for certain parameter present non-existence results (both for cyclic and non-cyclic ranges, the new scheme outperforms previously-known ones. codes), as well as constructions for specific parameters based on the middle-levels problem discussed in [7]. For the latter, Index Terms—Gray codes, enumerative coding, Grassmannian, projective-space graph we provide constructions for cyclic optimal Gray codes for all parameters, as well as encoding and decoding functions. The construction has many degrees of freedom, resulting a large I. INTRODUCTION number of Gray codes, which we bound from below. As a side effect of the Gray-code construction and the RAY codes, named after their inventor, Frank Gray [16], encoding and decoding algorithms we provide, we obtain an G were originally defined as a listing of all the binary enumerative-coding scheme for the Grassmannian space. A words, each appearing exactly once, such that adjacent words general enumerative-coding algorithm due to Cover [4], was in the list differ by the value of a single bit. Since then, recently used as the basis for an enumerative-coding scheme numerous generalizations were made, where today, a Gray specifically designed for the Grassmannian space q(n, k) by code usually means a listing of the elements of some space, Silberstein and Etzion [28], who provided encodingG and de- such that each element appears no more than once, and coding algorithms with complexity O(M[nk]n), where M[m] adjacent elements are “similar”. What constitutes similarity denotes the number of operations required for multiplying two usually depends on the application of the code. numbers with m digits each. Another work by Medvedeva The use of Gray codes has reached a wide variety of areas, [22] suggested only a decoding algorithm with complexity such as storage and retrieval applications [2], processor allo- O(M[n2] log n). We provide encoding and decoding algo- cation [3], statistics [5], hashing [10], puzzles [15], ordering rithm that not only arrange the subspaces in a Gray code, but documents [20], signal encoding [21], data compression [23], also operate in O(M[nk]n) time, the same complexity as the circuit testing [24], measurement devices [26], and recently algorithms of [28]. We provide another decoding algorithm of arXiv:1305.5765v2 [cs.IT] 11 Jun 2013 also modulation schemes for flash memories [6], [17], [35]. complexity O(M[nk]k log k), which outperforms the decoding For a survey on Gray codes the reader is referred to [25]. algorithm of [28] when k log k = o(n) (for example, when In the past few years, interest has grown in q-analogs of 1 ǫ k = O(n − ) for some 0 < ǫ < 1), and outperforms the combinatorial structures, in which vectors and subsets are decoding algorithm of [22] when k = o(√n). replaced by vector spaces over a finite field. Two prominent ex- The paper is organized as follows: In Section II we provide amples are the Grassmann graph q(n, k), and the projective- the basic definitions and notation used throughout the paper. space graph (n). The former containsG all the k-dimensional Pq In Section III we construct Grassmannian Gray codes, as well subspaces of an n-dimensional vector space over GF(q), and is as provide encoding and decoding functions. We continue in the q-analog of the Johnson graph, whereas the latter contains Section IV by studying subspace Gray codes. We conclude in all the subspaces of an n-dimensional vector space, and acts Section V with a summary and open problems. as the q-analog of the Hamming graph. Examples of such q-analogs structures are codes and anti- codes in the Grassmann graph [11], [27], Steiner systems [1], II. PRELIMINARIES reconstruction problems [34], and the middle-levels problem Throughout the paper we shall maintain a notation consist- ing of upper-case letters for vector spaces, sometimes with a This work was supported in part by ISF grant 134/10. superscript indicating the dimension. We shall denote vectors Moshe Schwartz is with the Department of Electrical and Computer Engineering, Ben-Gurion University of the Negev, Beer Sheva 8410501, Israel by lower-case letters, and scalars by Greek letters. For a vector (e-mail: [email protected]). space W over some finite field GF(q), we let dim(W) denote 2 the dimension of W. For two subspaces, W and W , W + W to be cyclic and P is its period. If P = [n] , then is called 1 2 1 2 k q C will denote their sum. If that sum happens to be a direct sum, optimal. we’ll stress that fact by denoting it as W1 W2. For a vector ⊕ A similar definition holds for the graph q(n). v GF(q)n, we shall denote the space spanned by v as v . P ∈Let Wn be some fixed n-dimensional vector space overh i Definition 4. Let Wn be an n-dimensional vector space over n GF(q). For an integer 0 6 k 6 n, we denote by [W ] the GF(q). An (n; q)-subspace Gray code, , is a sequence of k C set of all k-dimensional subspaces of Wn. distinct subspaces Definition 1. The Grassmann graph q(n, k)=(V, E) is de- = C0, C1,..., CP 1, n G C − W n fined by the vertex set V = [ k ], and two vertices W1, W2 V n W ∈ where Ci k=0 [ k ], and where Ci and Ci+1 are neighbors in are connected by an edge iff dim(W1 W2) = k 1. ∈ ∩ − q(n) for all 0 6 i 6 P 2. We say P is the size of the code P S − The q-number of k is defined as . If C0 and CP 1 are neighbors in q(n) then is said to be C − ∑Pn n C k cyclic and P is its period. If P = k=0 [k]q, then is called 2 k 1 q 1 C [k] = 1 + q + q + + q − = − . optimal. q ··· q 1 − By abuse of notation we denote III. GRASSMANNIAN GRAY CODES In this section we will study Grassmannian Gray codes. [k]q! =[k]q[k 1]q ... [1]q. − We will first describe a construction, and later introduce and The Gaussian coefficient is defined for n, k, and q as analyze encoding and decoding algorithms. These algorithms may be used as an enumerative-coding scheme. n [n] ! = q k q [k]q![n k]q! − A. Construction (qn 1)(qn 1 1) ... (qn k+1 1) = − − − − − . The construction we describe is recursive in nature. We will (qk 1)(qk 1 1) ... (q 1) − − − − be constructing an (n, k; q)-Grassmannian Gray code by com- It is well known that the number of k-dimensional subspaces bining together an (n 1, k; q)-code with an (n 1, k 1; q)- of an -dimensional space over is given by n . code. We start by introducing− two useful lemmas.− − n GF(q) [k]q Furthermore, the Gaussian coefficients satisfy the following Lemma 5. Let Wn be an n-dimensional vector space over recursion n 1 k 1 GF(q). Let W − and W − be (n 1)-dimensional and n − n n 1 n k n 1 (k 1)-dimensional subspaces of W , respectively, where = − + q − − , − k q k q k 1 q k 1 n 1 n − W − W − W . ⊆ ⊂ as well as the symmetry n k n Then there are q vectors v ,..., v n k GF(q) such − 0 q − 1 n n that: − ∈ = , k n k 1) Wk 1 v Wn 1 = Wk 1. q − q − ⊕ h ii ∩ − − k 1 6 6 2) The subspacesW − vi are distinct for all integers 0 k n (for example, see [32]). ⊕ h i Another graph of interest is the following. Proof: To maintain the first requirement it is obvious that v Wn Wn 1. We have Definition 2. The projective-space graph q(n)=(V, E) is i ∈ \ − WnP defined by the vertex set V = n [ ], and two vertices n n 1 n n 1 k=0 k W W − = q q − W , W V are connected by an edge iff \ − 1 2 ∈ S vectors to choose from. However, having chosen a vector dim(W1) + dim(W2) 2 dim(W1 W2) = 1. n n 1 − ∩ v W W − , to maintain the first requirement we cannot choose∈ vectors\ of the form αv + w, where w Wk 1 and Equivalently, two vertices, W1 and W2, are connected in − α (q) .