Journal of Graph Algorithms and Applications Hamilton Cycles in Restricted and Incomplete Rotator Graphs

The nodes of a rotator graph are the permutations of n, and an arc is directed from u to v if the first r symbols of u can be rotated one position to the left to obtain v. Restricted rotator graphs restrict the allowable rotations to r ∈ R for some R ⊆ {2, 3,. .. , n}. Incomplete rotator graphs only include nodes whose final symbol is i ≤ m for a fixed maximum value m ∈ {1, 2,. .. , n}. Restricted rotator graphs are directed Cayley graphs, whereas incomplete rotator graphs are not Cayley graphs. Hamilton cycles exist for rotator graphs (Corbett 1992), restricted rotator graphs with R = {n−1, n} (Ruskey and Williams 2010), and incomplete rotator graphs for all m (Ponnuswamy and Chaudhary 1994). These previous results are based on sequence building operations that we name 'reusing', 'recycling', and 'rewinding'. In this article, we combine these operations to create Hamilton cycles in rotator graphs that are (1) restricted by R = {2, 3, n}, (2) restricted by R = {2, 3, n−1, n} and incomplete for any m, and (3) restricted by R = {n−2, n−1, n} and incomplete for any m. Result (1) is 'optimal' since restricted rotator graphs are not strongly connected for R = {3, n} when n is odd, and do not have Hamilton cycles for R = {2, n} when n is even (Rankin 1944, Swan 1999). Similarly, we prove (3) is 'op-timal'. Our Hamilton cycles can be easily implemented for potential applications , and we provide O(1)-time algorithms that generate successive rotations for (1)–(3).


Introduction
The rotator graph G n is the directed graph whose nodes are the permutations of n symbols written as strings, and whose arcs travel between nodes whose strings differ by the rotation of a prefix.More precisely, the nodes are the strings in Π n , which is the set of strings representing the permutations of {1, 2, . . ., n} written in one-line notation.For example, Π 3 = {123, 132, 213, 231, 312, 321}.The prefix-rotation of length r cyclically moves the first r symbols of a string one position to the left and is denoted σ r .For example, 541362 σ 4 = 413562 since 413 is moved one position to the left and 5 "wraps around" into the fourth position.We frequently refer to prefix-rotations simply as rotations.The arcs in G n are directed from α ∈ Π n to β ∈ Π n when β = α σ r for some r ≥ 2, and such an arc is labeled σ r .Figure 1 (a) shows the rotator graph for n = 3 (with arc labels omitted).The rotator graph G n can also be described as − − → Cay({σ 2 , σ 3 , . . ., σ n }, S n ), the directed Cayley graph on the symmetric group generated by prefix-rotations.The literature has considered two natural subgraphs of the rotator graph.First, a restricted rotator graph R n (R) for R ⊆ {2, 3, . . ., n} is obtained by only including arcs labelled σ r for r ∈ R. Figure 2 shows the restricted rotator graph for n = 4 and R = {3, 4}.Second, an incomplete rotator graph M n (m) for some fixed maximum value m ∈ {1, 2, . . ., n} is the induced subgraph using the nodes whose final symbol is i for i ≤ m.In particular, M n (1) is isomorphic to G n−1 , and M n (n) = G n .Figure 3 shows the incomplete rotator graph for n = 4 and m = 3.The restricted rotator graph R n (R) with R = {r 1 , r 2 , . . ., r k } is the directed Cayley graph − − → Cay({σ r1 , σ r2 , . . ., σ r k }, S n ), whereas the incomplete rotator graph M n (m) is not isomorphic to a Cayley graph when 1 < m < n.
We define a restricted incomplete rotator graph B n (R, m) as the subgraph of G n that takes into account both of the prior generalizations.That is, B n (R, m) only includes arcs labelled σ r for r ∈ R and nodes endings with i ≤ m.In particular, B n ({2, 3, . . ., n}, n) = G n .Figure 5 shows the restricted incomplete rotator graph for n = 4, R = {3, 4}, and m = 3.
Rotator graphs are discussed by Corbett [3], restricted rotator graphs with R = {n − 1, n} are discussed by Ruskey and Williams [18], and incomplete rotator graphs for all m are discussed by Ponnuswamy and Chaudhary [15].In each case, the authors construct Hamilton cycles and discuss their applications.For example, Corbett proposed rotator graphs as a topology for point-to-point multiprocessor networks, where Hamilton cycles establish indexing schemes for sorting and for mapping rings and linear arrays.In this context, Ponnuswamy and Chaudhary generalize the size of the networks from n! to m • (n − 1)! for all m ∈ {1, 2, . . ., n} at the expense of node-transitivity when m = n.On the other hand, the result by Ruskey and Williams provides a construction for "shorthand universal cycles for permutations", which answered a challenge posed by Knuth in The Art of Computer Programming [11] (exercise 112 of section 7.2.1.2).Holroyd, Ruskey, and Williams [8,9] extended this work by maximizing the number of σ n used by Hamilton cycles of R n ({n − 1, n}).Other applications of rotator graphs include fault-tolerant file transmission by Hamada et al [7] and parallel sorting by Corbett and Scherson [4].Additional properties of rotator graphs have been examined including minimum feedback sets by Kuo et al [12] and node-disjoint paths by Yasuto, Ken'Ichi, and Mario [25].Additional variations of rotator graphs include bi-rotator graphs introduced by Lin and Hsu [13].
In these aforementioned articles, the authors provide efficient algorithms for generating a Hamilton sequence r 1 , r 2 , . .., meaning that σ r1 , σ r2 , . . .are the arcs of a Hamilton cycle.For example, 3, 3, 2, 3, 3, 2 is Corbett's Hamilton sequence in G 3 as seen in Figure 1 (b).We express this Hamilton cycle as follows where the values represent successive nodes and arcs, and the final node is omitted since it equals the first.Thus, the Hamilton cycle in 1 could have 'started' at any node.On the other hand, incomplete rotator graphs are not node-transitive when 1 < m < n.For this reason, we must specify a 'start' node when discussing their Hamilton sequences.In this article we use the convention that all of our Hamilton cycles 'start' at the node n n−1 • • • 1.Another consequence of Remark 1 is that any 'shift' of a Hamilton sequence in R n (R) is also a Hamilton sequence.A shift of sequence S = r 1 , r 2 , . . ., r k is shift(S) = r 2 , r 3 , . . ., r k , r 1 , and more generally, shift i (S) = r i+1 , r i+2 , . . ., r k , r 1 , r 2 , . . ., r i for i ∈ {1, 2, . . ., k}.
Remark 2 If S is a Hamilton sequence for the restricted rotator graph R n (R), then so is shift i (S) for any i ∈ {1, 2, . . ., n!−1}.
When studying the Hamilton results of [3], [18], and [15], it is interesting to note that all three algorithms are based on repeating a simple "sequence building" operation.We refer to these operations as 'reusing' (from [3]), 'recycling' (from [18]), and 'rewinding' (from [15]).In this article we mix the three sequence building operations in new ways to create Hamilton cycles for several restricted and incomplete rotator graphs.Our three main results are simple constructions for Hamilton sequences in B n (R, m) when Our motivation for targeting these special cases is simple: In applications, there is often special significance to the rotations σ r where r is as small or as large as possible.For example, if the sequences are used to generate successive permutations stored in an array, then σ 2 and σ 3 are the two most efficient operations.On the other hand, in the setting of universal cycles, σ n is the most efficient operation, as discussed in [9].
Our notation is described in Section 2. The 'optimality' of our main results is discussed in Section 3 by giving non-existence results for Hamilton cycles in various rotator graphs.Section 4 describes the three sequence building operations, and then we combine these operations to obtain our three main results in Section 5. Efficient algorithms for generating these Hamilton sequences appear in Section 6. Section 7 concludes with open problems.
A preliminary version of this article appeared at iwoca 2011 [20].The earlier version focused only on Hamilton cycles in restricted rotator graphs, while the results on incomplete rotator graphs and 'rewinding' are new to this version.The discussion of non-existence results is also new.We have changed our notation to accommodate the increased breadth.We have also streamlined our presentation by omitting the results on recycling Corbett's reuse sequence in Theorems 2 and 5 of [20], and by using an alternative to Algorithm 1 of [20].

Notation
Throughout this article we will be applying permutations to strings.There are different conventions for this in the literature, and in this article we follow those used in [9].For example, suppose a = a 1 a 2 • • • a n and b = b 1 b 2 • • • b n are strings, and π = (π 1 π 2 • • • π k ) is a permutation in cycle notation.The result of applying π to a is denoted a π.If b = a π, then b πi = a πi+1 for all 1 ≤ i ≤ k (where the index k + 1 is treated as 1).In other words, the permutation (π 1 π 2 • • • π k ) causes the π i th symbol of b to be assigned the π i+1 st symbol of a.Given this convention, the prefix-rotation of length r is σ r = (1 2 • • • r) since b = a σ r implies that b i = a i+1 for 1 ≤ i ≤ r − 1 and b r = a 1 .For convenience, the specific permutations used in this article are summarized below: In each case, exponentiation denotes repeated multiplication of permutations, so π 2 = ππ.When applying multiple permutations to a string, we proceed from left-to-right.For example, 1234567 σ 5 σ 4 = 2345167 σ 4 = 3452167. (2) We use three pieces of notation to refer to multiple prefix-rotations applied to a string.In each case, our terminology is based on the associated rotator graphs.
Given sequence S = r 1 , r 2 , . . ., r t and a ∈ Π n , the entire path is path(a, S) (where the final string is omitted if the path is a cycle), the set of nodes visited on the path is nodes(a, S), and the final node visited on the path is node(a, S).In keeping with our graph-based terminology, we refer to nodes and strings interchangeably, and to arcs and rotations interchangeably.

Non-Existence Results
In this section we prove several results on the non-existence of Hamilton cycles in certain restricted and restricted incomplete rotator graphs.In each case we relate these non-existence results to the new results we prove in Section 5.
The non-existence results also add merit to the previous positive results on incomplete rotator graphs [15] and restricted rotator graphs [18].We begin with a simple remark.Given a string a = a 1 a 2 • • • a n ∈ Π n , an inversion is a pair of indices (i, j) such that i < j and p i > p j .The parity of a is even or odd when its number of inversions is even or odd, respectively.
Remark 3 If a ∈ Π n , then b = a σ i has the same parity as a when i is odd.
If R consists only of odd values, then Remark 3 implies that there are no directed paths between permutations of opposite parity in R n (R).For example, this is verified below for the trivial case of n = 3 and R = {3}, where the odd and even permutations appear on the left and right, respectively.Remark 4 proves that the restricted rotator graphs do not always have Hamilton cycles when they allow only the rotation σ n and the "second smallest" rotation σ 3 .Similarly, there is not always a Hamilton cycle when allowing σ n and the 'smallest' rotation σ 2 .This follows from a general result by Rankin [16] whose proof was simplified by Swan [21] (also see Theorem R in [11]).
Remark 5 ([16, 21]) The restricted rotator graph R n (R) does not have a Hamilton cycle when n is even and R = {2, n}.
The restricted rotator graph R n (R) for R = {2, n} is known in the literature as the directed σ-τ graph, where σ = σ n and τ = τ 2 = σ 2 .Remark 5 implies that the directed σ-τ graph does not have a Hamilton cycle for even n.On the other hand, it may have a Hamilton path, as illustrated for n = 4 by Figure 4. Determining the existence of Hamilton paths and cycles in the directed σ-τ graph is considered an interesting and difficult open problem.In particular, Knuth rates the difficulty of finding a Hamilton cycle in R n (2, n) (for odd n) as 48 out of 50 [11] (see exercise 71 in section 7.2.1.2).Ruskey, Jiang, and Weston [17] investigated this problem using backtracking algorithms and were able to find all five non-isomorphic Hamilton cycles for n = 5, as well as Hamilton paths for n = 4 and n = 6.
The undirected σ-τ graph also includes arcs for the inverse operations τ −1 2 = τ 2 and σ −1 n = σ n .Compton and Williamson provide the only known Hamilton cycle in the undirected σ-τ graph.The special structure of their solution also provides a "doubly-adjacent Gray code" for Π n but requires 50 pages to prove [2].The undirected σ-τ graph can also be described as the undirected Cayley graph Cay({σ 2 , σ n }, S n ), where S n is the symmetric group corresponding to Π n .A well-known conjecture is that a Hamilton cycle exists in every connected undirected Cayley graph.This conjecture is often referred to as the Lovász conjecture, although the reader should refer to the survey by Pak and Radoicić for a more detailed historical account [14].Additional surveys on the Hamiltonicity of Cayley graphs are due to Witte and Gallian [24], and Curran and Gallian [5].In this setting, the rotator graph G n is the directed Cayley graph − − → Cay({σ 2 , σ 3 , . . ., σ n }, S n ) with generators σ r for r ∈ {2, 3, . . ., n}, and the restricted rotator graph R n (R) limits the generators to σ r for r ∈ R.
Remarks 4 and 5 indicate that our first main result -a Hamilton cycle for the restricted rotator graph R n (R) with R = {2, 3, n} -is 'optimal' in the sense that the result is not possible when any rotation from R is removed.
Next we consider the 'optimality' of our third main result: A Hamilton cycle for the restricted incomplete rotator graph From Remark 4, the restricted rotator graph R n (R) is not strongly connected for R = {n−2, n} when n is odd.Thus, we need to consider R = {n−1, n} to prove our third main result is 'optimal'.Although the restricted rotator graph R n (R) with R = {n−1, n} has a Hamilton cycle [18], Proposition 1 proves that there is no Hamilton cycle when these rotations are used in restricted incomplete rotator graphs.In fact, these directed graphs are not strongly connected unless m ∈ {n−1, n}.This is illustrated for n = 4 and m = 2 by Figure 6 (a Observe that the underlined symbol 4 has periodicity 3 in the above Hamilton cycle, since it appears cyclically in positions 3, 2, 1, 3, 2, 1, . . .(starting at position 1 in 4321).This is due to the fact that strings beginning with 4 are followed by applying σ 3 , and otherwise 4 is moved once to the left regardless of whether σ 3 or σ 4 is applied.The proof of Proposition 1 uses the fact that exhaustive lists of Π n,m cannot have two symbols with periodicity n−1 when n ≥ 4.
Proof: Assume the values of R, m, and n satisfy the stated conditions.We assume n ≥ 4 since otherwise the proposition is vacuously true by m ∈ {2, 3, . . ., n− 2}.Therefore, there is a node Observe that the symbols n and n−1 have periodicity n−1 in any directed path of B n (R, m).Therefore, there is no directed path from a to any node Therefore, the graph is not strongly connected.Proof: Assume the values of R and m satisfy the stated conditions.Let X be the subset of strings in Π n that have suffix Observe that a 1 / ∈ {1, 2, . . ., m} since m < n.Now consider arcs of the form ab in B n (R, m).Notice that ab is not an arc for b = a σ n since b is not a node in B n (R, m).Thus, if ab is an arc, then b = a σ i where i ∈ {2, 3, . . ., n − m}.However, this implies that b also has suffix 1 2 ••• m.More generally, there is no arc from a node inside X to a node outside X.Therefore, B n (R, m) is not strongly connected.

Sequence Building
This section describes the three sequence building operations: reuse, recycle, and rewind.For each operation we state the original theorems using these operations, and discuss generalizations.

Reusing and Rotator Graphs
The reuse operation takes each integer r in a sequence and replaces it by n, . . ., n, n + 1 − r, where n is repeated n − 1 times.We visualize this operation below.
The value of n is in parentheses since if it is not explicitly provided, then it is implicitly set to the largest value in S plus one.We subscript the operation as reuse n (S) when n is explicitly provided.To describe repeated applications of the operation, let U 1 = 1 and U k = reuse(U k−1 ) for k > 1.For example, the first few reuse sequences appear below.Notice that every string in Π 4 appears once and that the list is cyclic.Thus, U 4 is a Hamilton sequence for G 4 .Also notice that U 4 contains at least one copy of each symbol in {2, 3, 4}.More generally, a simple inductive argument proves that U n contains at least one copy of every symbol in {2, 3, . . ., n}, and thus U n is not the Hamilton sequence of any (strictly) restricted rotator graph.
To understand how Theorem 1 works in general, we present one remark and one lemma.To illustrate the remark, observe that every fourth string in (3) is followed by its three "full rotations".For example, 4231 is followed by 4231 σ 4 = 2314, 4231 σ 2 4 = 3142, and 4231 σ 3 4 = 1423.In general, this immediately follows from the fact that reuse n (r) begins with n − 1 copies of n.
Remark 6 For any sequence S, if b ∈ nodes(a, reuse(S)), then for all 1 ≤ i ≤ n − 1 it is also true that b σ i n ∈ nodes(a, reuse(S)).In other words, reused sequences create lists of strings that are closed under full rotations.
To describe the lemma, let Notice that (4) contains the strings in Π 4 starting with 4 in the same order they appear in (3).Furthermore, the sequence of suffix-rotations between these strings is 3, 3, 2, 3, 3, 2 and this sequence is precisely U 3 .Thus, U 4 = reuse(U 3 ) has converted the prefix-rotations of U 3 into suffix-rotations.Lemma 1 states this result formally.
Proof: The proof is obtained from the following derivation where the last two equalities reflect the "reusing identity" in [20].
These two ingredients allow the reuse operation to be effectively applied to any Hamilton sequence of a rotator graph.Furthermore, if the initial Hamilton sequence is for a restricted rotator graph, then the reused sequence will be restricted in a natural way.
Theorem 2 If S is a Hamilton sequence for the restricted rotator graph R n−1 (X), then reuse(S) is a Hamilton sequence for the restricted rotator graph R n (R), where r ∈ R if and only if r = n or r = n − x + 1 for some x ∈ X.
Proof: Since S is a Hamilton sequence for G n−1 , every string of Π n−1 appears in nodes(n−1 n−2 ••• 1, S).Therefore, Lemma 1 implies that every string in Π n that begins with the symbol n appears in nodes(n n−1 ••• 1, reuse(S)).However, every string in Π n is a full rotation of one of these strings in Π n that begins with the symbol n.Therefore, Remark 6 implies that every string of Π n appears in nodes(n n−1 ••• 1, reuse(S)).Furthermore, Lemma 1 also implies that the resulting list of strings is cyclic since node(n n−1

Recycling and Restricted Rotator Graphs
The recycle operation takes each integer r in a sequence and replaces it by n, n, n−1, n−1, . . ., n−1, n, n, . . ., n where n − 1 is repeated r − 1 times, and n is repeated n − r − 1 times at the end.Observe that recycling is similar to reusing in the sense that each value is mapped to n new values, however, in this case the new values always consist of n and n−1.We visualize this operation below.
The value of n is again in parentheses since if it is not explicitly provided, then it is implicitly set to the largest value in S plus one.We subscript the operation as recycle n (S) when n is explicitly provided.To describe repeated applications of the operation, let For example, the first few recycle sequences appear below.
Notice that (6) contains the strings in Π 4 starting with 4 in the same order they appear in (5).Furthermore, the sequence of modified prefix-rotations between these strings is 3, 3, 2, 3, 3, 2 and this sequence is precisely C 3 .Thus, C 4 = recycle(C 3 ) has converted the prefix-rotations of C 3 into modified prefixrotations.Lemma 2 states this result formally; it was proven in a slightly different form as the second identity of Lemma 2 in [9].
Proof: The proof is obtained from the following derivation where the last equality is known as the "recycling identity" in [20].
While Lemma 2 gives a concise expression for every nth string in lists of the form path(n n−1 ••• 1, recycle(S)), the intermediate strings are more difficult to describe.In other words, there is no simple recycling analogue to Remark 6 on reusing.For this reason, additional results on recycling have been handled on a case-by-case basis.For example, the preliminary version of this article proved that Corbett's canonical reuse sequences are recyclable.

Theorem 4 ([20]
) If S = U n−1 is the canonical reuse sequence, then recycle(S) is a Hamilton sequence for the restricted rotator graph R n (R) with R = {n−1, n}.
Theorem 4 was proven in [20] to answer a conjecture in [9] involving shorthand universal cycles of permutations.It also provided the basis for the main algorithm presented in [20].In this version of the article we simplify the presentation by instead basing our main algorithm on Theorem 3. We return to the question of recycling Hamilton sequences in the open problems of Section 7.1.

Rewinding and Incomplete Rotator Graphs
The reuse and recycle operations are similar in the sense that they transform each individual value into n values.On the other hand, the rewind operation repeats an entire sequence m times, but each time it leaves off one or two symbols, and inserts n in appropriate positions to make up for loss.
To define the operation, suppose S = r 1 , r 2 , . . . is a sequence in which the largest symbol n − 1 appears in the last two positions.For convenience, we let T denote the remaining sequence in S. That is, S = T, n − 1, n − 1 where max(S) = n − 1.The rewind operation creates a sequence according to the following subsequences along with a finishing 'tail': • The first subsequence is T, n − 1, n.
• The second through (m − 1)st subsequences are T, n.
• The last subsequence is T, n − 1, n.
Observe that each subsequence omits the last one or two symbols of S, and the tail inserts copies of n to ensure the resulting sequence has length m • |S|.We visualize this operation below.
Notice that the first row of ( 7) starts with a string ending in 1 and then contains every other string ending in 1.Similarly, the fourth row starts with a string ending in 4 and then contains every other string ending in 4. On the other hand, the second and third rows start with strings ending in 2 and 3, respectively, and then contain all but one of the other strings ending in 2 and 3, respectively.The fact that these rows contain all strings in Π 4,1 and Π 4,4 , and all but one string in Π 4,2 and Π 4,3 , follows from the initial string of the respective rows and the following remark.Observe that the second point of Remark 7 explicitly states the string that is 'lost' when applying the intermediate subsequence.For example, the second row of ( 7) begins with 4312, and 4312 σ 3 = 1432 is lost.Similarly, the third row begins with 1423, and 1423 σ 3 = 2143 is 'lost'.In both cases, these lost strings are crossed out in (7).
While Remark 7 describes the set of strings obtained from each subsequence, Remark 8 explicitly states the last string obtained by applying each subsequence.In this remark we let τ i = (i−1 i) be permutation that swaps the ith and (i−1)st of a string.Observe that if a is a string of length n, then a σ n−1 σ n = a τ n .
To see Remark 8 in action, note that the first strings in each row of ( 7 Besides Remarks 7 and 8 there are three 'tricks' to Ponnuswamy and Chaudhary's order.First, each successive subsequence is applied to a string whose last symbol is one larger than for the previous subsequence.For example, the first four rows in (7) begin with strings ending in 1, 2, 3, and 4, respectively.Second, the strings that are 'lost' while applying the rotations in the intermediate subsequence are 'found' when applying the rotation in the tail.For example, 1432 and 2143 appear in the last row of (7).Third, the order can be finished 'early'.For example, if σ 3 , σ 4 is applied at the end of the second row in (7) instead of σ 4 , then the cyclic order finishes with 1432, thereby avoiding all strings ending in 3 or 4. Similarly, if σ 3 , σ 4 , σ 4 is applied at the end of the third row in (7) instead of σ 4 , then the cyclic order finishes with 2143, 1432, thereby avoiding all strings ending in 4.
Using this outline we generalize Theorem 5 to any Hamilton sequence ending with two copies of its largest symbol.Furthermore, if the Hamilton sequence is for a restricted rotator graph on strings of length n − 1, then rewinding only adds σ n to the set of rotations used.
Towards our goal, let us focus on the last string obtained by applying each successive subsequence.Let n are the subsequences.By Remark 8 we have Observe that a x ends with i for 1 ≤ x ≤ m.Therefore, by Remark 7, each of our desired strings are in nodes(n n−1 ••• 1, rewind m (S)) except possibly for the 'lost' strings.The second point of Remark 7 allows us to give an expression for the 'lost' strings.We provide this expression below and then compare to the strings obtained by applying the m − 2 copies of n in the tail of rewind m (S) as rotations to a m+1 Therefore, all of the 'lost' strings are 'found'.Furthermore, node(a m+1 , n, n, . . ., n) = n n−1 ••• 1, so the tail finishes at the starting node to complete the cycle.

New Sequences
In this section we combine our results from Section 4 in several ways.As in Section 4 we visualize sequence building by using small diagrams.In particular, we let recycle k denote k successive applications of the recycle operation.Thus, In each of our results we use the above sequence as our "base sequence".This results in a presentation that is slightly simpler than our preliminary article which used Theorem 4 in this capacity.Now we present our three main results.Theorem 7 proves that the following sequence gives a Hamilton sequence using only the rotations σ 2 , σ 3 , and σ n .Before providing our next two results, we must address a minor issue between reusing and recycling on one side, and rewinding on the other side.Recall that Theorem 6 requires a sequence to end in two copies of the largest symbol before it can be properly rewound.Unfortunately, this precondition is not always met after recycling a sequence, nor is it ever met after reusing a sequence.To bridge this incompatibility, we take advantage of Remark 2 from Section 1. Recall that every shift of a Hamilton sequence in a restricted rotator graph is also a Hamilton sequence.Furthermore, it is easy to observe that both reusing and recycling result in sequences that begin with two copies of the largest symbol.Thus, we can shift these sequences twice so that they meet the necessary condition.
Remark 9 If S is a sequence, then reuse(S) and recycle(S) begin with two copies of the largest symbol max(S)+1.Thus, shift 2 (reuse(S)) and shift 2 (recycle(S)) end with two copies of the largest symbol max(S) + 1.
Visually, we denote this double-shift by shift 2 .Theorem 8 proves that the following sequence gives a Hamilton sequence for any incomplete rotator graph using only the rotations σ n−2 , σ n−1 , and σ n .

Algorithms
In this section we describe how each of the sequences in Section 5 can be generated by a loopless algorithm.In this context, a loopless algorithm creates each successive symbol in a sequence in worst-case O(1)-time, where the hidden constant is independent of n and m.As is customary, the algorithms call a visit routine each time the next symbol in the sequence is created.To clarify an important point, a loopless algorithm can take more than O(1)-time to initialize itself and visit the first symbol in the sequence.As a starting point, observe that Theorems 7, 8, and 9 all involve canonical recycle sequences.A loopless algorithm for generating these sequences was presented in [18], where 0 and 1 were used to represent n and n − 1, respectively.Besides this minor difference, we also use the opportunity to slightly simplify the algorithm and correct a problem with its last iteration.The result is RecycleSequence found in Algorithm 1.In the algorithm, the Iverson bracket on line 6 converts a boolean value into an integer as follows: a j ← 0 10: To adapt Theorem 10 for the sequences in Section 5, we must reuse and rewind the recycle sequence.To reuse a sequence we can replace the visit calls in its associated algorithm with calls to the following reuse procedure.
Procedure reuse(n, r) Let RecycleSequence (n) be the result of replacing each visit(x) by reuse(n+1, x) on lines 6 and 14 of RecycleSequence(n).Thus, a call to RecycleSequence (n−1) generates reuse(C n−1 ), which is the sequence from Theorem 7.
To rewind a sequence we can call its associated algorithm m times.More precisely, if S = T, n−1, n−1 is a sequence where n−1 = max(S), and A(n−1) is an algorithm that generates T , then the following procedure will generate rewind m (S).visit(n) 13: end The above procedure is loopless, so long as A(n−1) is loopless and initially calls visit in O(1)-time.At first glance, this is not true of RecycleSequence(n) since its initialization on lines 1 and 2 takes O(n)-time.However, this initialization does not need to be repeated on successive calls to RecycleSequence(n) since the two arrays are reset to their initial values after line 15 is executed.This fact is stated in Remark 10, and can be understood by referring to Algorithm M and Algorithm H for generating multi-radix numbers in Knuth [11].
Remark 10 When RecycleSequence(n) terminates, its array variables are set to a The desired portion of shift 2 (C n−1 ) is generated by RecycleSequence(n − 1), so long as we 'skip' the first two visited values.Let RecycleSequence (n) denote this necessary modification of RecycleSequence(n), with the understanding that successive calls also skip over lines 1 and 2. The result is that a call to rewind(n, m, A) for A = RecycleSequence will generate rewind m (shift 2 (C n−1 )), which is the sequence from Theorem 8. Similarly, these ideas can be used to generate the sequence from Theorem 9. Collectively, these results imply the following theorem.

Theorem 11
The sequences in Theorems 7, 8, and 9 can be generated by a loopless algorithm.
Theorem 11 can be strengthened in the sense that multiple symbols can be visited at the same time.To clarify this point, consider an algorithm that maintains an array of length n that holds the next n symbols in the sequence of length n! it is generating.In this situation, the algorithm would visit (n − 1)! subsequences of n symbols, instead of n! individual symbols.The goal in this situation is to update the entire array in worst-case O(1)-time.This can goal can only be accomplished if successive subsequences differ in a constant number of positions.For an example of how this situation applies to the sequences in this article, notice that each subsequence of n symbols in reuse(C n−1 ) has the Therefore, successive subsequences of length n differ in at most one position, and so the associated array of length n can be updated worst-case O(1)-time.See [20] for further details on this type of optimization.

Final Remarks
In this article we have considered the reuse operation by Corbett, the recycle operation by Ruskey and Williams, and the rewind operation by Ponnuswamy and Chaudhary.We have shown that these operations can be combined to create Hamilton sequences for restricted and incomplete rotator graphs using a limited number of prefix-rotations σ i for 'small' and 'large' values of i.In two cases our set of rotations is 'optimal' in the sense of providing minimal sets of operations that ensure the existence of Hamilton cycles.Furthermore, we have provided loopless algorithms for generating these Hamilton sequences.We would like to determine necessary and sufficient conditions on S for answering this question.As mentioned in Section 4.2, the answer to Question 1 is 'yes' for the canonical reuse U n−1 and recycle sequence C n−1 .We conjecture this is also true for the canonical rewind sequence W n−1 .

The Recycling Question
Conjecture 1 If S = W n−1 is the canonical rewind sequence, then recycle(S) is a Hamilton sequence for the restricted rotator graph R n (R) with R = {n−1, n}.
Question 1 also has an affirmative answer for any Hamilton sequence using the two 'largest' rotations.This result was proven as Theorem 13 in the context of shorthand universal cycles for permutations in [9].The two underlined copies of node 15423 imply that recycle(S) is not a Hamilton sequence, and thus the answer to Question 1 is 'no' for this choice of S. The reader can also verify that the answer to Question 1 is 'no' for reuse(S) and rewind(S).In other words, Theorem 4 and Conjecture 1 suggest there is something special about the canonical reuse and rewind sequences, as opposed to individual applications of the reuse and rewind operation.
5. There are a number of factors involved when choosing the 'best' topology for a given type of computer network.For interconnection networks, a partial list of relevant factors includes connectivity, diameter, symmetry, degree, bisection width, narrowness, expansion increments and the existence of Hamilton cycles, and proposed topologies include meshes, rings, hypercubes, shuffle exchange networks, butterfly networks, pancake graphs, star graphs and rotator graphs (see Siegel [19] and Hsu and Lin [10] for textbooks in this area).Further study of restricted incomplete rotator graphs will reveal if they offer any advantages in this area.

Figure 1 :
Figure 1: (a) The rotator graph G 3 , and (b) a Hamilton cycle in G 3 .The bidirectional arcs are two σ 2 arcs, and the unidirectional arcs are σ 3 arcs.

Figure 3 :Remark 1
Figure 3: The incomplete rotator graph M n (m) for n = 4 and m = 2.The bidirectional arcs represent two σ 2 arcs, the circular unidirectional arcs represent σ 3 arcs, and the remaining unidirectional arcs represent σ 4 arcs.

Remark 4
The restricted rotator graph R n (R) is not strongly connected when R only contains odd values.In particular, R n (R) is not strongly connected when n is odd and R = {3, n} or R = {n − 2, n}.
is a Hamilton sequence for G n .More precisely, reuse(S) is a Hamilton sequence for R n (R) where R includes n and the following values by the definition of reuse: n − x + 1 for all x ∈ X.

Theorem 6
Hamilton sequences for restricted rotator graphs can be rewound into Hamilton sequences for incomplete rotator graphs.More specifically, if S is a Hamilton sequence for R n−1 (R) whose last two symbols are n − 1, then rewind m (S) is a Hamilton sequence for B n (R∪{n}, m) for any m ∈ {2, 3, . . ., n}.JGAA, 16(4) 785-810 (2012) 801 Proof: Following our earlier conventions, let S = T, n − 1, n − 1.Since S only contains symbols in R, it follows that rewind m (S) only contains symbols in R ∪ {n} by the definition of rewind.Also, |rewind m (S)| = m|S| = m • (n − 1)!.Thus, we need to prove that nodes(n n−1 • • • 1, rewind m (S)) contains every string in Π n,x for each x satisfying 1 ≤ x ≤ m, and that the resulting path is a Hamilton cycle by showing node

Algorithm 1
[[true]] = 1 and [[false]] = 0.The purpose of line 15 is explained later in this section.RecycleSequence generates the recycle sequence C n , which is a Hamilton sequence for the restricted rotator graph R n
While the reuse and rewind operations have been made fairly transparent by the results of Section 4, the recycling operation remains somewhat mysterious.In general, we are interested in the following open problem.Question 1 If S is a Hamilton sequence for the rotator graph G n−1 , then under what conditions on S is recycle(S) a Hamilton sequence for the restricted rotator graph R n ({n − 1, n})?