Table of Contents
Fetching ...

Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders

Bowie Liu, Dennis Wong, Chan-Tong Lam, Marcus Im

TL;DR

These are the first known Gray codes for stamp foldings and semi-meanders, and they solve an open problem posted by Sawada and Li in [Electron. Comb. 19(2), 2012].

Abstract

We first present a simple recursive algorithm that generates cyclic rotation Gray codes for stamp foldings and semi-meanders, where consecutive strings differ by a stamp rotation. These are the first known Gray codes for stamp foldings and semi-meanders, and we thus solve an open problem posted by Sawada and Li in [Electron. J. Comb. 19(2), 2012]. We then introduce an iterative algorithm that generates the same rotation Gray codes for stamp foldings and semi-meanders. Both the recursive and iterative algorithms generate stamp foldings and semi-meanders in constant amortized time and $O(n)$-amortized time per string respectively, using a linear amount of memory.

Recursive and iterative approaches to generate rotation Gray codes for stamp foldings and semi-meanders

TL;DR

These are the first known Gray codes for stamp foldings and semi-meanders, and they solve an open problem posted by Sawada and Li in [Electron. Comb. 19(2), 2012].

Abstract

We first present a simple recursive algorithm that generates cyclic rotation Gray codes for stamp foldings and semi-meanders, where consecutive strings differ by a stamp rotation. These are the first known Gray codes for stamp foldings and semi-meanders, and we thus solve an open problem posted by Sawada and Li in [Electron. J. Comb. 19(2), 2012]. We then introduce an iterative algorithm that generates the same rotation Gray codes for stamp foldings and semi-meanders. Both the recursive and iterative algorithms generate stamp foldings and semi-meanders in constant amortized time and -amortized time per string respectively, using a linear amount of memory.

Paper Structure

This paper contains 5 sections, 15 theorems, 3 figures, 3 algorithms.

Key Result

lemma 1

lague_stamp If $\alpha = p_1 p_2 \cdots p_n$ is a stamp folding, then $\beta \in \mathrm{Rots}(\alpha)$ is also a stamp folding.

Figures (3)

  • Figure 1.1: Stamp foldings of order four. The stamp with a dot is stamp $1$. Stamp foldings that are underlined (in red color) are semi-meanders.
  • Figure 2.1: Stamp rotation. The stamp folding $6512347$ can be obtained by applying a stamp rotation ${\textrm{rotate}}_\alpha(4, 6, 2)$ on $\alpha = 6345127$.
  • Figure 2.2: Recursive computation tree constructed by our algorithm GenR that outputs stamp foldings and semi-meanders for $n = 4$ in cyclic rotation Gray code order. The nodes at the last level are generated by the PRINT function and carry no sign. For nodes from level $0$ to level $n-2$, the nodes in bold (in blue color) carry a positive sign, and the rest of the nodes (in red color) carry a negative sign. A dashed arrow indicates applying right rotations to generate its neighbors, while a dotted arrow indicates applying left rotations to generate its neighbors. The underlined stamp foldings at the last level of the recursive computation tree are semi-meanders.

Theorems & Definitions (27)

  • lemma 1
  • lemma 2
  • proof
  • corollary 1
  • proof
  • lemma 3
  • proof
  • lemma 4
  • proof
  • lemma 5
  • ...and 17 more