1: \documentclass[12pt]{article}
2: \usepackage{epsfig,latexsym,graphicx}
3:
4: \title{Coin-Moving Puzzles}
5: \author{%
6: Erik D. Demaine%
7: \thanks{Department of Computer Science, University of Waterloo, Waterloo,
8: Ontario N2L 3G1, Canada, email: \{\texttt{eddemaine},
9: \texttt{mldemaine}\}\texttt{@uwaterloo.ca}}
10: \and
11: Martin L. Demaine%
12: \footnotemark[1]
13: \and
14: Helena A. Verrill%
15: \thanks{Institut for Matematiske Fag, Universitetsparken 5,
16: DK-2100 K\o benhavn, Denmark, email: \texttt{verrill@math.ku.dk}}}
17: \date{}
18:
19: % 1-inch margins, from fullpage.sty by H.Partl, Version 2, Dec. 15, 1988.
20: \topmargin 0pt
21: \advance \topmargin by -\headheight
22: \advance \topmargin by -\headsep
23: \textheight 8.9in
24: \oddsidemargin 0pt
25: \evensidemargin \oddsidemargin
26: \marginparwidth 0.5in
27: \textwidth 6.5in
28:
29: % Avoid line breaks before citations (\cite) and references (\ref)
30: \let\latexcite=\cite
31: \def\cite{\nolinebreak\latexcite}
32: \let\latexref=\ref
33: \def\ref{\nolinebreak\latexref}
34:
35: % Set the default figure placement to [!htbp]. Relies on LaTeX internals.
36: {\makeatletter \gdef\fps@figure{!htbp}}
37:
38: % Theorem environments
39: \newtheorem{theorem}{Theorem}
40: \newtheorem{lemma}{Lemma}
41: \newtheorem{corollary}{Corollary}
42: \newtheorem{conjecture}{Conjecture}
43:
44: % Proof environment, with an optional argument to \begin{proof} for specifying
45: % what you are proving. For example: \begin{proof}[Theorem \ref{fermat}].
46: \makeatletter
47: \def\GrabProofArgument[#1]{ (#1): \egroup\ignorespaces}
48: \def\proof{\noindent\textbf\bgroup Proof%
49: \@ifnextchar[{\GrabProofArgument}{: \egroup\ignorespaces}}
50: \def\endproof{\hspace*{\fill}$\Box$\medskip}
51: \makeatother
52:
53: % Complex \xxx for making notes of things to do. Use \xxx{...} for general
54: % notes, and \xxx[who]{...} if you want to blame someone in particular.
55: {\makeatletter
56: \gdef\xxx{\@ifnextchar[\xxx@lab\xxx@nolab}
57: \long\gdef\xxx@lab[#1]#2{{\bf [\marginpar{xxx}{\sc #1}: #2]}}
58: \long\gdef\xxx@nolab#1{{\bf [\marginpar{xxx}#1]}}
59: % This turns them off:
60: \long\gdef\xxx@lab[#1]#2{}\long\gdef\xxx@nolab#1{}%
61: }
62:
63: % Put figures and text together
64: \def\textfraction{0.01}
65: \def\topfraction{0.99}
66: \def\floatpagefraction{0.99}
67: \def\dblfloatpagefraction{0.99}
68:
69: % Customize the fonts in the captions. \def\captionfont to whatever you want,
70: % for example \em, \small, \em\small, \sf, or \sf\small. Ditto for
71: % \captionlabelfont (the Figure or Table part of the caption).
72: % Relies on LaTeX internals.
73: \def\captionfont{\sf\small}
74: \def\captionlabelfont{\bf\small}
75: {\makeatletter
76: \global\let\old@makecaption\@makecaption
77: \long\gdef\@makecaption#1#2{%
78: \old@makecaption{\captionlabelfont #1}{\captionfont #2}}}
79:
80: %--------
81: % Specific to this document
82: \def\span{\mathop{\rm span}}
83: \def\applymove{\,/\,}
84:
85: \def\coinscale{0.75}
86:
87:
88: % Don't want to change all the minus signs to \setminus... xxx
89: \let\setminus=-
90:
91:
92: \begin{document}
93: \maketitle
94:
95: \begin{abstract}
96: We introduce a new family of one-player games, involving the movement of coins
97: from one configuration to another. Moves are restricted so that a coin can be
98: placed only in a position that is adjacent to at least two other coins. The
99: goal of this paper is to specify exactly which of these games are solvable.
100: By introducing the notion of a constant number of extra coins, we give tight
101: theorems characterizing solvable puzzles on the square grid and
102: equilateral-triangle grid. These existence results are supplemented by
103: polynomial-time algorithms for finding a solution.
104: %
105: %---Old:
106: % We analyze a family of one-player games, involving the movement of coins from
107: % one configuration to another. Moves are restricted so that a coin can be
108: % placed only in a position that is adjacent to at least two other coins. The
109: % goal of this paper is to specify exactly which of these games are solvable. We
110: % solve this problem with a polynomial-time algorithm for two boards, the
111: % equilateral-triangle and square grids, and consider the problem on a general
112: % graph.
113: \end{abstract}
114:
115: \section{Introduction}
116:
117: Consider a configuration of coins such as the one on the left of Figure
118: \ref{rhomboid}. The player is allowed to move any coin to a position that is
119: determined rigidly by incidences to other coins. In other words, a coin can be
120: moved to any position adjacent to at least two other coins. The puzzle or
121: 1-player game is to reach the configuration on the right of Figure
122: \ref{rhomboid} by a sequence of such moves. This particular puzzle is most
123: interesting when each move is restricted to \emph{slide} a coin in the plane
124: without overlapping other coins.
125:
126: \begin{figure}
127: \centerline{\includegraphics[scale=\coinscale]{rhomboid.eps}}
128: \caption{\label{rhomboid}
129: Re-arrange the rhombus into the circle using three slides,
130: such that each coin is slid to a position adjacent to two other coins.}
131: \end{figure}
132:
133: This puzzle is described in Gardner's Mathematical Games article on Penny
134: Puzzles \cite{Gardner-1975-penny}, in \emph{Winning Ways}
135: \cite{Berlekamp-Conway-Guy-1982-coins}, in \emph{Tokyo Puzzles}
136: \cite{Fujimura-1978-coins}, in \emph{Moscow Puzzles}
137: \cite{Kordemsky-1972-coins}, and in \emph{The Penguin Book of Curious and
138: Interesting Puzzles} \cite{Wells-1992-coins}. Langman \cite{Langman-1951}
139: shows all 24 ways to solve the puzzle in three moves. Another classic puzzle
140: of this sort \cite{Bolt-1984-pennies, Fujimura-1978-coins, Gardner-1975-penny,
141: Wells-1992-coins} is shown in Figure \ref{upside-down}. A final classic puzzle
142: that originally motivated our work is shown in Figure \ref{original helena};
143: its source is unknown. Other related puzzles are presented by Dudeney
144: \cite{Dudeney-1967-pennies}, Fujimura \cite{Fujimura-1978-coins}, and Brooke
145: \cite{Brooke-1963}.
146: % Brooke covers Figure \ref{rhomboid} and some related puzzles,
147: % but not Figure \ref{upside-down}.
148:
149: \begin{figure}
150: \centerline{\includegraphics[scale=\coinscale]{upside_down.eps}}
151: \caption{\label{upside-down}
152: Turn the pyramid upside-down in three moves,
153: such that each coin is moved to a position adjacent to two other coins.}
154: \end{figure}
155:
156: \begin{figure}
157: \centerline{\includegraphics[scale=\coinscale]{original_helena.eps}}
158: \caption{\label{original helena}
159: Re-arrange the pyramid into a line in seven moves,
160: such that each coin is moved to a position adjacent to two other coins.}
161: \end{figure}
162:
163: The puzzles above always move the centers of coins to vertices of the
164: equilateral-triangle grid. Another type of puzzle is to move coins on the
165: square grid, which appears less often in the literature but has significantly
166: more structure and can be more difficult. The only published example we are
167: aware of is given by Langman \cite{Langman-1953}, which is also described by
168: Brooke \cite{Brooke-1963}, Bolt \cite{Bolt-1991-coins}, and Wells
169: \cite{Wells-1992-coins}; see Figure \ref{HOH}. The first puzzle (H $\to$ O) is
170: solvable on the square grid, and the second puzzle (O $\to$ H) can only be
171: solved by a combination of the two grids.
172:
173: \begin{figure}
174: \centerline{\includegraphics[scale=\coinscale]{HOH.eps}}
175: \caption{\label{HOH}
176: Re-arrange the H into the O in four moves while staying on the square grid
177: (and always moving adjacent to two other coins),
178: and return to the H in six moves using both the equilateral-triangle and
179: square grids.}
180: \end{figure}
181:
182: In this paper we study generalizations of these types of puzzles, in which
183: coins are moved on some grid to positions adjacent to at least two other coins.
184: Specifically, we address the basic algorithmic problem: is it possible to solve
185: a puzzle with given start and finish configurations, and if so, find a
186: sequence of moves. Surprisingly, we show that this problem has a
187: polynomial-time solution in many cases. Our goal in this pursuit is to gain a
188: better understanding of what is possible by these motions, and as a result to
189: design new and interesting puzzles. For example, one puzzle we have designed
190: is shown in Figure \ref{diagonal}. We recommend the reader try this difficult
191: puzzle before reading Section \ref{Re-orienting L's} which shows how to solve
192: it. Figures \ref{spindle}--\ref{tri2oline} show a few of the other puzzles we
193: have designed. The last two puzzles involve labeled coins.
194:
195: \xxx{A variation on `diagonal' is where the extra coins are labeled differently
196: from the others. How much harder does this make the puzzle? Try it and
197: mention it.}
198:
199: \begin{figure}
200: \centerline{\includegraphics[scale=\coinscale]{diagonal.eps}}
201: \caption{\label{diagonal}
202: A difficult puzzle on the square grid.
203: The optimal solution uses 18 moves,
204: each of which places a coin adjacent to two others.}
205: \end{figure}
206:
207: \begin{figure}
208: \centerline{\includegraphics[scale=\coinscale]{spindle.eps}}
209: \caption{\label{spindle}
210: Another puzzle on the square grid.
211: The optimal solution uses 24 moves,
212: each of which places a coin adjacent to two others.}
213: \end{figure}
214:
215: \begin{figure}
216: \centerline{\includegraphics[scale=\coinscale]{vee.eps}}
217: \caption{\label{vee}
218: Another puzzle on the square grid with the same rules.}
219: %Solvable in 21 moves, each of which places a coin adjacent to two others.}
220: \end{figure}
221:
222: \begin{figure}
223: \centerline{\includegraphics[scale=\coinscale]{swap5.eps}}
224: \caption{\label{swap5}
225: A puzzle on the square grid involving labeled coins.
226: Solvable in eleven moves, each of which places a coin adjacent to two
227: others; see Figure \protect\ref{swap5 solution}.}
228: \end{figure}
229:
230: \begin{figure}
231: \centerline{\includegraphics[scale=0.8]{tri2oline.eps}}
232: \caption{\label{tri2oline}
233: A puzzle on the equilateral-triangle grid involving labeled coins.
234: Solvable in eight moves, each of which places a coin adjacent to two others.}
235: \end{figure}
236:
237: This paper studies two grids in particular: the equilateral-triangle grid, and
238: the square grid. It turns out that the triangular grid has a relatively simple
239: structure, and nearly all puzzles are solvable. An exact, efficient
240: characterization of solvable puzzles is presented in Section \ref{Triangular
241: Grid}. The square grid has a more complicated structure, requiring us to
242: introduce the notion of ``extra coins'' to give a partial characterization of
243: solvable puzzles. This result is described in Section \ref{Square Grid} after
244: some general tools for analysis are developed in Section \ref{General Tools}.
245:
246: Before we begin, the next section defines a general graph model of the puzzles
247: under consideration.
248:
249: %We begin in Section \ref{General Theory} with a general graph model of
250: %token-moving puzzles. Section \ref{Square Grid} presents our main result about
251: %the square grid. In Section \ref{Triangular Grid} we describe our result about
252: %the equilateral-triangle grid. We conclude in Section \ref{Conclusion} with
253: %several open problems.
254:
255: %\pagebreak
256: \section{Model}
257: \label{Model}
258:
259: %This section provides some general concepts that we will find useful for
260: %analyzing the games. We begin in Section \ref{Problem Statement} with a formal
261: %problem statement and definitions of terminology. Section \ref{Span} presents
262: %the notion of the span of a configuration, which essentially specifies the
263: %reachable positions given an unlimited supply of extra coins.
264: %
265: %\subsection{Problem Statement}
266: %\label{Problem Statement}
267:
268: We begin by defining ``token-moving'' and ``coin-moving'' puzzles
269: and related concepts.
270: %We begin with some basic concepts generic to token-moving and coin-moving
271: %puzzles.
272: The \emph{tokens} form a finite multiset $T$. We normally think of
273: tokens as unlabeled, modeled by all elements of $T$ being equal, but another
274: possibility is to color tokens into more than one equivalence class (as in
275: Figure \ref{tri2oline}). A \emph{board} is any simple undirected graph
276: $G=(P,E)$, possibly infinite, whose vertices are called \emph{positions}. A
277: \emph{configuration} is a placement of the tokens onto distinct positions on
278: the board, i.e., a one-to-one mapping $C : T \to P$. We will often associate a
279: configuration $C$ with its image, that is, the set of positions \emph{occupied}
280: by tokens.
281:
282: A \emph{move} from a configuration $C$ changes the position of a single token
283: $t$ to an unoccupied position $p$, resulting in a new configuration. This move
284: is denoted $t \mapsto p$, and the resulting configuration is denoted $C
285: \applymove t \mapsto p$. We stress that moves are not required to ``slide''
286: the token while avoiding other tokens (like the puzzle in Figure
287: \ref{rhomboid}); the token can be picked up and placed in any unoccupied
288: position.
289:
290: The \emph{configuration space} (or \emph{game graph}) is the directed graph
291: whose vertices are configurations and whose edges correspond to feasible moves.
292: A typical \emph{token-moving puzzle} asks for a sequence of moves to reach one
293: configuration from another, i.e., for a path between two vertices in the
294: configuration space, subject to some constraints. A \emph{coin-moving puzzle}
295: is a geometric instance of a token-moving puzzle, in which tokens are
296: represented by \emph{coins}---constant-radius disks in the plane, and
297: constant-radius hyperballs in general---and the board is some lattice in the
298: same dimension. If a token-moving or coin-moving puzzle with source
299: configuration $A$ and destination configuration $B$ is solvable, we say that
300: $A$ can be \emph{re-arranged} into $B$, and that $B$ is \emph{reachable} from
301: $A$. This is equivalent to the existence of a directed path from $A$ to $B$
302: in the configuration space.
303:
304: This paper addresses the natural question of what puzzles are solvable, subject
305: to the following constraint on moves which makes the problem interesting. A
306: move $t \mapsto p$ is \emph{$d$-adjacent} if the new position $p$ is adjacent
307: to at least $d$ tokens other than the moved token $t$. (Throughout,
308: \emph{adjacency} refers to the board graph $G$.) This constraint is
309: particularly meaningful for $d$-dimensional coin-moving puzzles, because then a
310: move is easy to ``perform exactly'' without any underlying lattice: the new
311: position $p$ is determined rigidly by the $d$ coin adjacencies
312: (sphere tangencies).
313:
314: The \emph{$d$-adjacency configuration space} is the subgraph of the
315: configuration space in which moves are restricted to be $d$-adjacent.
316: Studying connectivity in this graph is equivalent to studying solvable puzzles;
317: for example, if the graph is strongly connected, then all puzzles are solvable.
318:
319: Here we explore solvable puzzles on two boards, the equilateral-triangle grid
320: and the square grid. Because these puzzles are two-dimensional, in the context
321: of this paper we call a move \emph{valid} if it is 2-adjacent, and a position a
322: \emph{valid destination} if it is unoccupied and adjacent to at least two
323: occupied positions. Thus a valid move involves transferring a token from some
324: source position to a valid destination position. When the context is clear, we
325: will refer to a valid move just by ``move.'' A move is \emph{reversible} if
326: the source position is also a valid destination.
327:
328:
329: \section{Triangular Grid}
330: \label{Triangular Grid}
331:
332: This section studies the equilateral-triangle grid, where most puzzles are
333: solvable. To state our result, we need a simple definition. Associated with
334: any configuration is the subgraph of the board induced by the occupied
335: positions. In particular, a \emph{connected component} of a configuration is a
336: connected component in this induced subgraph.
337:
338: \begin{theorem} \label{triangular grid}
339: On the triangular grid with the 2-adjacency restriction and unlabeled coins,
340: configuration $A$ can be re-arranged into a different configuration $B$
341: precisely if $A$ has a valid move, the number of coins in $A$ and $B$ match,
342: and at least one of four conditions holds:
343:
344: \begin{enumerate}
345: \item $B$ contains three coins that are mutually adjacent (a triangle).
346: \item $B$ has a connected component with at least four coins.
347: \item $B$ has a connected component with at least three coins
348: and another connected component with at least two coins.
349: \item There is a single move from $A$ to $B$.
350: \end{enumerate}
351:
352: \noindent
353: The same result holds for labeled coins, except when there are exactly three
354: coins in the puzzle, in which case the labelings and movements are controlled
355: by the vertex 3-coloring of the triangular grid.
356:
357: Furthermore, there is a polynomial-time algorithm to find a re-arrangement from
358: $A$ to $B$ if one exists. Specifically, let
359: $n$ denote the number of coins and $d$ denote the maximum
360: distance between two coins in $A$ or $B$.
361: Then a solution with $O(n d)$ moves can be found in $O(n d)$ time.
362: \end{theorem}
363:
364: The rest of this section is devoted to the proof of this theorem.
365: We begin in the next subsection by proving necessity of the conditions: if a
366: puzzle is solvable, then one of the conditions holds. Then in the following
367: subsection we prove sufficiency of the conditions.
368:
369: \subsection{Necessity}
370:
371: Of course, it is necessary for $A$ to have a valid move and for $A$
372: and $B$ to have the same number of coins. Necessity of at least one of the
373: four conditions is also not difficult to show, because Conditions 1--3 are so
374: broad, encompassing most possibilities for configuration $B$.
375:
376: Suppose that a solvable puzzle does not satisfy any of Conditions 1--3, as in
377: Figure \ref{condition4}. We prove that it must satisfy Condition 4, by
378: considering play backwards from the goal configuration $B$. Specifically, a
379: \emph{reverse move} takes a coin currently adjacent to at least two others, and
380: moves it to any other location. Because the puzzle is solvable, some coin in
381: configuration $B$ must be reverse-movable, i.e., must have at least two coins
382: adjacent to it. Thus, some connected component of $B$ has at least three
383: coins. Because Condition 2 does not hold, this connected component has exactly
384: three coins. Because Condition 1 does not hold, these three coins are not
385: connected in a triangle. Because Condition 3 does not hold, every other
386: component has exactly one coin.
387:
388: Hence, one component of $B$ is a path of exactly three coins, say $c_1, c_2,
389: c_3$, and every other component of $B$ has exactly one coin, as in the left of
390: Figure \ref{condition4}. Certainly at this moment $c_2$ is the only
391: reverse-movable coin. We claim that after a sequence of reverse moves, $c_2$
392: will continue to be the only reverse-movable coin. If we removed $c_2$, then
393: every coin would be adjacent to no others. Thus, if we reverse move $c_2$
394: somewhere, then every other coin would be adjacent to at most one other
395: ($c_2$). Hence, it remains that only $c_2$ can be reverse moved.
396:
397: \begin{figure}
398: \centerline{\input condition4.pstex_t}
399: \caption{\label{condition4}
400: Reverse-moving a configuration $B$ that does not satisfy any of
401: Conditions 1--3.}
402: \end{figure}
403:
404: Therefore, if we can reach $A$ from $B$ via reverse moves, we can do so in a
405: single reverse move of $c_2$ directly to where it occurs in $A$. Thus
406: Condition 4 holds, as desired.
407:
408: \subsection{Sufficiency}
409:
410: Next we prove the more difficult direction: provided one of Conditions 1--3
411: hold, there is a re-arrangement from $A$ to $B$. (This fact is obvious when
412: Condition 4 holds.) All three cases will follow a common outline: we first
413: form a triangle (Section \ref{Getting Started}), then maneuver this triangle
414: (Section \ref{Triangle Maneuvering}) to transport all other coins (Section
415: \ref{Transportation}), and finally we place the three triangle coins
416: appropriately depending on the case (Section \ref{Finale}).
417:
418: \subsubsection{Getting Started}
419: \label{Getting Started}
420:
421: It is quite simple to make some triangle of coins. By assumption, there is a
422: valid move from configuration $A$. The destination of this move can have two
423: basic forms, as shown in Figure \ref{move tri}. Either the move forms a
424: triangle, as desired, or the move forms a path of three coins. In the latter
425: case, if there is not a triangle already with a different triple of coins, a
426: triangle can be formed by one more move as shown in the right of the figure.
427:
428: \begin{figure}
429: \centerline{\input move_tri.pstex_t}
430: \caption{\label{move tri}
431: Two types of valid destinations for a coin $c$.
432: In the latter case, we show a move to form a triangle.}
433: \end{figure}
434:
435: This triangle $T_0$ suffices for unlabeled coin puzzles. However, for labeled
436: coin puzzles, we cannot use just any three coins in the triangle; we need a
437: particular three, depending on $B$. For example, if $B$ satisfies Condition 1,
438: then the coins forming the triangle in $B$ are the coins we would like in the
439: triangle for maneuvering. To achieve this, we ``bootstrap'' the
440: triangle $T_0$ formed above, using this triangle with the incorrect coins to
441: form another triangle with the correct coins. Specifically, if we desire a
442: triangle using coins $t_1$, $t_2$, and $t_2$, then we move each coin
443: in the difference $\{t_1, t_2, t_3\} \setminus T_0$ to be adjacent to
444: appropriate coins in $T_0$. There are three cases, shown in Figure
445: \ref{bootstrap tri}, depending on how many coins are in the difference. If
446: ever we attempt to move a coin to an already occupied destination, we first
447: move the coin located at that destination to any other valid destination.
448:
449: \begin{figure}
450: \centerline{\input bootstrap_tri.pstex_t}
451: \caption{\label{bootstrap tri}
452: The three cases of building a triangle $\{t_1, t_2, t_3\}$ out of an
453: existing triangle, depending on how many coins the two triangles share.
454: {From} left to right, zero, one, and two coins of overlap.}
455: \end{figure}
456:
457: \subsubsection{Triangle Maneuvering}
458: \label{Triangle Maneuvering}
459:
460: Consider a triangle of coins $t_1$, $t_2$, and $t_3$. The possible positions
461: of this triangle on the triangular grid are in one-to-one correspondence with
462: their centers, which are vertices of the dual hexagonal grid. Moving one coin
463: (say $t_1$) to be adjacent to and on the other side of the others ($t_2$ and
464: $t_3$) corresponds to moving the center of the triangle to one of the three
465: neighboring centers on the hexagonal grid. Thus, without any other coins on
466: the board, the triangle can be moved to any position by following a path in the
467: hexagonal grid.
468:
469: This approach can be modified to apply when there are additional obstacle
470: coins; see Figure \ref{maneuvering triangle} for an example. Conceptually we
471: always move one of the triangle coins, say $t_i$, in order to move the center
472: of the triangle to an adjacent vertex of the hexagonal grid. But if the move
473: of $t_i$ is impossible because the destination is already occupied by another
474: coin $g_i$, then in fact we do not make any move. There will be a triangle in
475: the desired position now, but it will not consist of the usual three coins
476: ($t_1$, $t_2$, and $t_3$); instead, $t_i$ will be replaced by the ``ghost
477: coin'' $g_i$. Such a triangle suffices for our purposes of transportation
478: described in Section \ref{Transportation}. One final detail is how the ghost
479: coins behave: if we later need to move a ghost coin $g_i$, we instead move the
480: original (unmoved) coin $t_i$. Thus ghost coins are never moved; only $t_1$,
481: $t_2$, and $t_3$ are moved during triangle maneuvering (even if coins are
482: labeled).
483:
484: \begin{figure}
485: \centerline{\input maneuvering_triangle.pstex_t}
486: \caption{\label{maneuvering triangle}
487: An example of triangle maneuvering. Dotted arrows denote conceptual moves,
488: and solid arrows denote actual moves.}
489: \end{figure}
490:
491: \subsubsection{Transportation}
492: \label{Transportation}
493:
494: Triangle maneuvering makes it easy to \emph{transport} any other coin to any
495: desired location. Specifically, suppose we want to move coin $c \notin \{t_1,
496: t_2, t_3\}$ to destination position $d$. If $d$ is already occupied by another
497: coin $c'$, we first move $c'$ to an arbitrary valid destination; there is at
498: least one because the triangle can be maneuvered. Now we maneuver the triangle
499: so that the (potentially ghost) triangle has two coins adjacent to $d$, so that
500: the third coin is not on $d$, and so that the triangle does not overlap $c$.
501: This is easily arranged by examining the location of $c$ and setting the
502: destination of the triangle appropriately. For example, if $c$ is within
503: distance two of $d$, then there are four positions for the triangle that are
504: adjacent to $d$ and do not overlap $c$; otherwise,
505: the triangle can be placed in any of the six positions adjacent to $d$.
506: Finally, because $d$ is now a valid destination---it is adjacent to two coins
507: in the triangle---we can move $c$ to $d$.
508:
509: \begin{figure}
510: \centerline{\input transportation_tri.pstex_t}
511: \caption{\label{transportation tri}
512: Transporting coin $c$ to destination $d$ using triangle $\{t_1, t_2, t_3\}$.
513: In both cases, we choose the location of the triangle
514: so that it does not overlap $c$.}
515: \end{figure}
516:
517: By the properties of triangle maneuvering, this transportation process even
518: preserves coin labels: the only actual coins moved are $t_1$, $t_2$, $t_3$,
519: $c$, and possibly a coin at $d$. But any coin at position $d$ must not have
520: already been in its desired position, because $d$ is $c$'s desired position.
521: Thus, applying the transportation process to every coin except $t_1$, $t_2$,
522: and $t_3$ places all coins except these three in their desired locations.
523:
524: \subsubsection{Finale}
525: \label{Finale}
526:
527: Once transportation is complete, it only remains to place the triangle coins
528: $t_1$, $t_2$, and $t_3$ in their desired locations. By the bootstrapping in
529: Section \ref{Getting Started}, we are able to choose the unplaced coins $\{t_1,
530: t_2, t_3\}$ however we like. This property will be exploited differently
531: in the three cases.
532: % For the moment we ignore the labeling of $t_1$, $t_2$, and $t_3$.
533:
534: \paragraph{Property 1.}
535: If there is a triangle in $B$, then we choose these three coins as the unplaced
536: coins $t_1$, $t_2$, and $t_3$, and use them to transport all other coins. Then
537: we maneuver the triangle $\{t_1, t_2, t_3\}$ exactly where it appears in $B$.
538: Because all other coins have been moved to their proper location, in this
539: position the triangle will not have any ghost coins.
540:
541: However, it may be that the coins $\{t_1, t_2, t_3\}$ are labeled incorrectly
542: among themselves, compared to $B$. Assuming there are more than three coins in
543: the puzzle, this problem can be repaired as follows. We maneuver the triangle
544: so that it does not overlap any other coins but is adjacent to at least one
545: coin $c$; for example, there is such a position for the triangle just outside
546: the smallest enclosing hexagon of the other coins. Refer to Figure
547: \ref{relabel tri}. Now two coins of the triangle, say $t_1$ and $t_2$, are
548: adjacent to three other coins each: each other, $t_3$, and $c$. Thus we can
549: move $t_1$ to any other valid destination, and then move $t_2$ or $t_3$ to
550: replace it. Afterwards we can move $t_1$ to take the place of $t_2$ or $t_3$,
551: whichever moved. This procedure swaps $t_1$ and either $t_2$ or $t_3$. By
552: suitable application, we can achieve any permutation of $\{t_1, t_2, t_3\}$,
553: and thereby achieve the desired labeling of the triangle.
554:
555: \begin{figure}
556: \centerline{\input relabel_tri.pstex_t}
557: \caption{\label{relabel tri}
558: Swapping coins $t_1$ and $t_2$ in a triangle, using an adjacent coin $c$.}
559: \end{figure}
560:
561: \paragraph{Property 2 but not Property 1.}
562: Refer to Figure \ref{finale tri 2}. If there is not a triangle in $B$, but
563: there is a connected component of $B$ with at least four coins, then there is a
564: path in $B$ of length four, $(p_1, p_2, p_3, p_4)$. From {B} we reverse move
565: $p_2$ so that it is adjacent to $p_3$ and $p_4$. If this position is already
566: occupied by a coin $c$, we first reverse move $c$ to any other unoccupied
567: position. Now $p_2$, $p_3$, and $p_4$ are mutually adjacent, so we have a
568: new destination configuration $B'$
569: with Property 1. As described above, we can re-arrange $A$ into $B'$.
570: Then we undo our reverse moves: move $p_2$ back adjacent to $p_1$ and $p_3$,
571: and move $c$ back adjacent to $p_3$ and $p_4$. This procedure re-arranges
572: $A$ into $B$.
573:
574: \begin{figure}
575: \centerline{\input finale_tri_2.pstex_t}
576: \caption{\label{finale tri 2}
577: Reverse moving a configuration $B$ with Property 2 into a
578: configuration with Property 1.}
579: \end{figure}
580:
581: \paragraph{Property 3 but not Property 1.}
582: This case is similar to the previous one; refer to Figure \ref{finale tri 3}.
583: There must be a path in $B$ of length three, $(p_1, p_2, p_3)$, as well as a
584: pair of adjacent coins, $(q_1, q_2)$, in different connected components of $B$.
585: If both positions adjacent to both $q_1$ and $q_2$ are already occupied, we
586: first reverse move one such coin (call it $c$) to an arbitrary unoccupied
587: position. This frees up a position adjacent to $q_1$ and $q_2$, to which we
588: reverse move $p_2$. Now $\{q_1, q_2, p_2\}$ form a triangle, so Property 1
589: holds, and we can reach this new configuration $B'$ from $A$. Then we undo our
590: reverse moves: move $p_2$ back adjacent to $p_1$ and $p_3$, and move $c$ back
591: adjacent to $q_1$ and $q_2$. This procedure re-arranges $A$ into $B$.
592:
593: \begin{figure}
594: \centerline{\input finale_tri_3.pstex_t}
595: \caption{\label{finale tri 3}
596: Reverse moving a configuration $B$ with Property 3 into a
597: configuration with Property 1.}
598: \end{figure}
599:
600: This concludes the proof of Theorem \ref{triangular grid}.
601:
602: %--- This is covered in the conclusion instead.
603: % \subsection{Conjectures}
604:
605: % An interesting question is
606:
607: % \begin{conjecture}
608: % On the triangular grid with the 2-adjacency restriction and unlabeled coins, if
609: % there is a re-arrangement from $A$ to $B$ when the coins are unlabeled, then
610: % there is also a re-arrangement consisting of a sequence of \emph{slides}.
611: % \end{conjecture}
612:
613:
614: %--- Old stuff about span:
615: % Coin-moving puzzles have an entirely different structure with the triangular
616: % grid. In particular, we have the following characterization of span:
617:
618: % \begin{lemma}
619: % For a configuration $C$ on the triangular grid, if $C$ has a valid destination
620: % position, then $\span C$ is the entire triangular grid; otherwise, $\span C =
621: % C$.
622: % \end{lemma}
623:
624:
625: \section{General Tools}
626: \label{General Tools}
627:
628: In this section we develop some general lemmas about token-moving puzzles.
629: Although we only use these tools for the square grid, in Section \ref{Square
630: Grid}, they apply to arbitrary boards and may be of more general use.
631:
632: \subsection{Picking Up and Dropping Tokens}
633: \label{Picking Up and Dropping Tokens}
634:
635: First we observe that additional tokens cannot ``get in the way'':
636: %First we observe that, for the purpose of showing connectivity of the
637: %configuration space, tokens can be removed freely because this modification
638: %only makes the puzzle more difficult.
639:
640: \begin{lemma} \label{emulation}
641: If a token-moving puzzle is solvable, then it remains solvable if we add an
642: additional token with an unspecified destination, provided tokens are
643: unlabeled. This result also holds if all moves must be reversible.
644: \end{lemma}
645:
646: \begin{proof}
647: A move can be blocked by an extra token $e$ at position $p$ because $p$ is
648: occupied and hence an invalid destination. But if ever we encounter such a
649: move of a token $t$ to position $p$, we can just ignore the move, and swap the
650: roles of $e$ and $t$: treat $e$ as the moved version of $t$, and treat $t$
651: as an extra token replacing $e$. Thus, any sequence of moves in the original
652: puzzle can be emulated by an equivalent sequence of moves in the augmented
653: puzzle. We are not introducing any new moves, only removing existing moves,
654: so all moves remain reversible if they were originally.
655: \end{proof}
656:
657: This proof leads to a technique for emulating a more powerful model for solving
658: puzzles. In addition to moving coins as in the normal model, we can
659: conceptually \emph{pick up} (remove) a token, and later \emph{drop} (add) it
660: onto any valid destination. At any moment we can have any number of tokens
661: picked up. While a token $t$ is conceptually picked up, we emulate any moves
662: to its actual position $p$ as in the proof of Lemma \ref{emulation}: if we
663: attempt to move another token $t'$ onto position $p$, we instead reverse the
664: roles of $t$ and $t'$. To drop a token onto a desired position $p$, we simply
665: move the actual token to position $p$ if it is not there already.
666:
667: Of course, this process may permute the tokens. Nonetheless we will find this
668: approach useful for puzzles with labeled tokens.
669:
670: One might instead consider the emulation method used implicitly in
671: Section \ref{Triangle Maneuvering} for triangular maneuvering: move original
672: coins instead of ghost coins. This approach has the advantage that it
673: preserves the labels of the coins. Unfortunately, the approach makes it
674: difficult to preserve reversibility as in Lemma \ref{emulation}, and so is
675: insufficient for our purposes here.
676:
677: \subsection{Span}
678: \label{Span}
679:
680: The \emph{span} of a configuration $C$ is defined recursively as follows. Let
681: $d_1, \dots, d_m$ be the set of valid destinations for moves in $C$.
682: %--- Valid destination is now defined, so we don't need this:
683: %For example, under the $k$-adjacency restriction, these
684: %are all unoccupied positions that have at least $k$ occupied neighbors.
685: %--- This is a ``tighter'' definition of span, but is somehow less intuitive:
686: %Let $t_1 \mapsto d_1, \dots, t_m \mapsto d_m$ be the valid moves from
687: %$C$, subject to any restrictions imposed on the puzzle.
688: If $m=0$, the span of $C$ is just $C$ itself. Otherwise, it is the span of
689: another configuration $C'$, defined to be $C$ with additional tokens at
690: positions $d_1, \dots, d_m$. If this process never terminates, the span is
691: defined to be the limit, which exists because it is a countable union of finite
692: sets.
693:
694: \begin{figure}
695: \centerline{\includegraphics[scale=\coinscale]{span_3x3diag.eps}}
696: \caption{\label{3x3 diagonal span}
697: In this example, the span is the smallest rectangle enclosing the
698: configuration.}
699: \end{figure}
700:
701: The span of a configuration lists all the positions we could hope to reach, or
702: more precisely, the positions we could reach if we had an unlimited number of
703: extra tokens that we could drop. In particular, we have the following:
704:
705: \begin{lemma} \label{span monotone}
706: If configuration $A$ can be re-arranged into configuration $B$, then $\span A
707: \supseteq B$ and thus $\span A \supseteq \span B$.
708: \end{lemma}
709:
710: In other words, valid moves can never cause the span of the current
711: configuration to increase. Thus the most connected we could hope the
712: configuration space to be is the converse of Lemma \ref{span monotone}: for
713: every pair of configurations with $\span A \supseteq \span B$, $A$ can be
714: re-arranged into $B$. In words, we want that every configuration $A$ can be
715: re-arranged into any configuration $B$ with the \emph{same or smaller span}.
716:
717: We call a configuration \emph{span-minimal} if the removal of any of its tokens
718: reduces the span. Span-minimal configurations are essentially the ``skeleta''
719: that keep configurations with the same span reachable.
720: %
721: %--- The following is a funny way to put the result... this result is about
722: % the number of coins past span minimality, which is different from ``extra
723: % coins.'' For example, in triangular grid this is meaningless, though the
724: % lemma still holds.
725: %
726: % \subsection{Zero Extra Tokens Can Be Insufficient}
727: %
728: % At this point it is easy to justify having at least one extra token
729: % in the worst case for any board:
730: %
731: One general property of span-minimal configurations is the following:
732:
733: \begin{lemma} \label{span-minimal fragile}
734: If a configuration is span-minimal, any move will reduce the span.
735: \end{lemma}
736:
737: \begin{proof}
738: Suppose to the contrary that there is a move $t \mapsto p$ that does not reduce
739: the span of a span-minimal configuration $C$. In particular, $p$ must be a
740: valid destination position in the subconfiguration $C-t$, because $t$ does not
741: count in the $d$-adjacency restriction. Hence, adding a new token at position
742: $p$ to the configuration $C-t$ has no effect on the span of $C$. But this
743: two-step process of removing token $t$ and adding a token at position $p$ is
744: equivalent to moving $t$ to $p$, so $\span (C \applymove t \mapsto p) = \span
745: (C-t)$. But we assumed that $\span (C \applymove t \mapsto p) = \span C$, and
746: hence $\span C = \span (C-t)$, contradicting that $C$ is span-minimal.
747: \end{proof}
748:
749: Under the 2-adjacency restriction, a \emph{chain} is a sequence of tokens with
750: the property that the distance (in the board graph $G$) between two successive
751: tokens is at most $2$. We will use chains as basic ``units'' for creating a
752: desired span.
753:
754: %----- Probably not useful for general $k$:
755: % Under the $k$-adjacency restriction, a \emph{chain} is a sequence of occupied
756: % positions with the property that the distance between two consecutive positions
757: % (in the board graph $G$) is at most $k$. We will use chains as basic ``units''
758: % for creating a desired span.
759:
760: %--- Old, and pretty useless:
761: %For each type of board, the basic approach of our analysis is as follows.
762: %First, we give some basic properties of the span. Then we determine the
763: %meaning of the span in terms of transferability.
764:
765: Notice that the notion of span is useless for the already analyzed triangular
766: grid: provided there is a valid move, the span of any configuration is the
767: entire grid. Thus, for the triangular grid, a configuration is span-minimal
768: precisely if it has no valid moves. For the square grid, however, the notion
769: of span and span minimality is crucial.
770:
771: \subsection{Extra Tokens}
772: \label{Extra Tokens}
773:
774: As described in the previous section, we can only re-arrange configurations
775: into configurations with the same or smaller span. Unfortunately, the converse
776: is not true. Indeed, the key problem situations are span-minimal
777: configurations; by Lemma \ref{span-minimal fragile}, such configurations
778: immediately lose span when we try to move them. Hence, any two distinct
779: span-minimal configurations with the same span cannot reach each other. An
780: example on the square grid is that the two opposite diagonals of a square are
781: unreachable from each other, as shown in Figure \ref{square grid 0 extra}.
782:
783: \begin{figure}
784: \centerline{\includegraphics[scale=0.55]{sqrgrid_0extra.eps}}
785: \caption{\label{square grid 0 extra}
786: Subgraph of configuration space reachable from full-span configurations
787: (outlined in bold) with no extra coins.}
788: \end{figure}
789:
790: Thus we explore the notion of \emph{extra tokens}, a set of tokens whose
791: removal does not reduce the span of the configuration. Lemma \ref{span
792: monotone} and Figure \ref{square grid 0 extra} shows that we need at least one
793: extra token. In fact, the two opposite diagonals on the square grid shown in
794: Figure \ref{square grid 0 extra} are difficult to reach from each other; as
795: shown in Figure \ref{square grid 1 extra}, even one extra token is
796: insufficient. What is surprising is that a small number of extra tokens
797: seem to be generally sufficient to make the configuration space strongly
798: connected. We prove this for the square grid in the next section.
799:
800: \begin{figure}
801: \centerline{\includegraphics[scale=0.55]{sqrgrid_1extra.eps}}
802: \caption{\label{square grid 1 extra}
803: Subgraph of configuration space reachable from full-span configurations
804: (outlined in bold) with one extra token.}
805: \end{figure}
806:
807: %--- Old view of extra coins; bleh.
808: % This configuration space can easily be disconnected. Thus for the purpose of
809: % analysis we introduce the notion of \emph{extra tokens} or \emph{don't-care
810: % tokens}. A puzzle specifies the initial positions of such tokens, but not
811: % their desired final positions. In other words, configurations are considered
812: % equivalent if they place all \emph{important} tokens (nonextra tokens) in the
813: % same way. Certainly if all tokens are extra, then the configuration space
814: % consists of a single equivalence class. The basic question is this: how few
815: % extra tokens can we get away with while keeping the configuration space
816: % connected? Our motivation is puzzle design: a connected configuration space
817: % means that all puzzles are solvable, even if they do not ``appear'' so.
818:
819: % If there are too few extra tokens, any move of an important token can
820: % immediately make previously reachable configurations unreachable. See Figures
821: % \ref{square grid 0 extra} and \ref{square grid 1 extra} for examples.
822: % Surprisingly, we show in several cases that just a constant number of extra
823: % tokens suffice to make the configuration space (essentially) connected. The
824: % basic idea is that a configuration can be split into two components: the basic
825: % skeleton that keeps other configurations reachable, and some number of extra
826: % tokens that allow motions to be made while maintaining the skeleton.
827: % %If there are too few of these extra tokens, any move can immediately make
828: % %previously reachable configurations unreachable.
829:
830: % %--- This isn't true!
831: % %In fact, extra tokens are not as unrestricted as we have described. We will be
832: % %able to control the final position of an extra token subject to a simple and
833: % %natural restriction.
834:
835: % While we have modeled extra tokens as having unspecified destinations, this is
836: % not necessary, and indeed undesired for real puzzles. A puzzle can specify the
837: % final position of an extra token to be any valid destination position, i.e.,
838: % any position that is adjacent to at least two important tokens or previously
839: % placed extra tokens. This fact is used, for example, in our two square-grid
840: % puzzles in Figures \ref{diagonal}--\ref{vee}.
841: %--- Should have stated it this way upfront.
842:
843: %--- Very old figure:
844: % \begin{figure}
845: % {\tt
846: % \centerline{%
847: % \vbox{\hsize=0.25in
848: % X.\\
849: % X.
850: % }
851: % ~~~
852: % \vbox{\hsize=0.25in
853: % XX\\
854: % ..
855: % }
856: % ~~~
857: % \vbox{\hsize=0.25in
858: % .X\\
859: % .X
860: % }
861: % ~~~
862: % \vbox{\hsize=0.25in
863: % ..\\
864: % XX
865: % }}
866:
867: % \bigskip
868: % \bigskip
869:
870: % \centerline{%
871: % \vbox{\hsize=0.25in
872: % X.\\
873: % XX
874: % }
875: % $\leftrightarrow$
876: % \vbox{\hsize=0.25in
877: % XX\\
878: % .X
879: % }
880: % ~~~
881: % \vbox{\hsize=0.25in
882: % .X\\
883: % XX
884: % }
885: % $\leftrightarrow$
886: % \vbox{\hsize=0.25in
887: % XX\\
888: % X.
889: % }}}
890: % \caption{\label{trivial disconnected}
891: % The 2-adjacency configuration space is disconnected in these
892: % square-grid examples with two and three unlabeled coins.}
893: % \end{figure}
894:
895:
896: \section{Square Grid}
897: \label{Square Grid}
898:
899: % Our main result is about the 2-adjacency configuration space for the square
900: % grid. First note that one extra coin does not suffice to maintain the span,
901: % as shown in Figure \ref{square grid 1 extra}.
902:
903: This section analyzes coin-moving puzzles on the square grid, using the tools
904: from the previous section. In particular, we show that with just two extra
905: coins, we can reach essentially every configuration on the square grid with the
906: same or smaller span. The only restriction is that the extra coins can only
907: be destined for positions that are adjacent to at least two other coins.
908:
909: \begin{theorem} \label{square grid}
910: On the square grid with the 2-adjacency restriction and unlabeled coins,
911: configuration $A$ can be re-arranged into configuration $B$ if there are coins
912: $e_1$ and $e_2$ such that $\span (A \setminus \{e_1, e_2\}) \supseteq \span (B
913: \setminus \{e_1, e_2\})$ and each $e_i$ is adjacent to two other coins in $B$
914: (excluding $e_1$ or $e_2$).
915: Furthermore, there is an algorithm to find such a re-arranging sequence using
916: $O(n^3)$ moves and $O(n^3)$ time, where $n$ is the number of coins.
917: \end{theorem}
918:
919: %--- Old theorem statement:
920: % \begin{theorem} \label{square grid}
921: % For the square grid, any configuration can be re-arranged into any
922: % configuration with the same or smaller span using two extra coins.
923: % There is an algorithm to find such a re-arranging sequence using $O(n^4)$ moves
924: % and $O(n^4)$ time, where $n$ is the number of coins.
925: % %Let the board $G$ be the square grid, and fix the coin set $T$. If two
926: % %configurations $C$ and $C'$ satisfy $\span C \supseteq \span C'$, then $C$ can
927: % %be re-arranged into $C'$ using two extra coins, using $O(|T|^3)$ moves.
928: % %----
929: % %On the square grid, if $A$ and $B$ are configurations with the same span, then
930: % %$A$ is reachable from $B$ using two extra coins.
931: % \end{theorem}
932:
933: We prove this theorem by showing that every configuration (in particular, $A$
934: and $B$) can be brought to a canonical configuration with the same span via a
935: sequence of (mostly) reversible moves. As a consequence, we can move from
936: any configuration $A$ to any other $B$ by routing through this canonical
937: configuration.
938:
939: Our proof uses the model of picking up and dropping coins, which can be
940: emulated as described in Section \ref{Picking Up and Dropping Tokens}.
941: However, we must be careful how we pick up and drop coins, so that the
942: resulting moves are reversible. For example, initially we pick up the extra
943: coins $e_1$ and $e_2$, and then drop them temporarily wherever needed. For
944: re-arranging the source configuration $A$ into the canonical configuration,
945: this step may not result in reversible moves, but fortunately this is not
946: necessary in this case. For re-arranging the destination configuration $B$
947: into the canonical configuration, however, reversibility is crucial, and is
948: guaranteed by the condition in the theorem of each $e_i$ being adjacent to at
949: least two other coins.
950:
951: %--- This is covered below.
952: % For convenience, whenever we find a coin other than $e_1$ or $e_2$ whose
953: % removal does not reduce the span, we pick it up. This rule simply removes
954: % clutter from the board, making it easier to argue about making moves; we can
955: % effectively assume that most destinations are unoccupied. Of course, we must
956: % be careful when we later drop these picked-up coins, so that the resulting
957: % moves are reversible. This problem will be dealt with in Section \ref{Final
958: % Sweep}, after all other coins are in their canonical configuration.
959:
960: \subsection{Basics}
961: \label{Basics}
962:
963: We begin with some preliminary lemmas. A \emph{rectangle} is the full
964: collection of coins between two $x$ coordinates and two $y$ coordinates. The
965: \emph{half-perimeter} of a rectangle is the number of distinct $x$ coordinates
966: plus the number of distinct $y$ coordinates over all coins in the rectangle.
967: The \emph{distance} between two sets of coins is the minimum distance between
968: two coins from different sets.
969:
970: \begin{lemma}
971: For the square grid, the span of any configuration is a disjoint union of
972: (finite) rectangles with pairwise distances at least $3$.
973: \end{lemma}
974:
975: % \begin{proof}
976: % Because a single coin is a rectangle, $\span A$ is certainly a disjoint
977: % union of rectangles. We also want to show that each connected component
978: % is a rectangle, and different connected components are distance $3$ or more
979: % apart.
980:
981: % Suppose $C$ is a connected component of $\span A$.
982: % Define
983: % $(a_0,b_0),(a_1,b_1)$ by
984: % $$a_0=min\left\{a_i|
985: % [a_i,b_i]\in \span A\right\},\>
986: % b_0=min\left\{b_i|
987: % [a_i,b_i]\in \span A\right\}$$
988: % $$a_1=max\left\{a_i|
989: % [a_i,b_i]\in \span A\right\},\>
990: % b_1=max\left\{b_i|
991: % [a_i,b_i]\in \span A\right\}$$
992: % We may assume that $a_0\not=a_1$ and $b_0\not=b_1$, since in these cases
993: % $\span A$ is a rectangle, and the result is easy.
994: % We claim that $C=R_{(a_0,b_0),(a_1,b_1)}$. Suppose not, then there
995: % is a position $(a,b)\in R_{(a_0,b_0),(a_1,b_1)}\setminus C$ with
996: % one of the positions adjacent to $(a,b)$ in $C$. We can follow round
997: % the boundary of $C$ from this position until we reach a position
998: % in $R_{(a_0,b_0),(a_1,b_1)}\setminus C$ with two neighbors in $C$.
999: % But then this position would also be in $C$. Hence we have a
1000: % contradiction, and thus the connected components are rectangles.
1001: % Clearly any two disconnected rectangles must be at least distance
1002: % three apart, or else a coin could be added, contradicting that we have
1003: % added all possible coins in constructing $\span A$.
1004: % \end{proof}
1005:
1006: \begin{lemma} \label{min chain size}
1007: For each rectangle (connected component) of the span,
1008: say with half-perimeter $h$, there must be at least $\lceil h/2 \rceil$ coins
1009: within that rectangle in the configuration.
1010: \end{lemma}
1011:
1012: The following beautiful proof of this lemma has been distributed among several
1013: people, but its precise origin is unknown. We first heard it from Martin
1014: Farach-Colton, who heard it from Peter Winkler, who heard it from Pete Gabor
1015: Zoltan, who learned of it through the Russian magazine \emph{Kvant}
1016: (around 1985--1987).
1017:
1018: \medskip
1019:
1020: \begin{proof}
1021: Consider how the (full) perimeter changes as we compute the span of the coins
1022: within the rectangle. Initially we have $n$ coins, say, so the perimeter is at
1023: most $4n$. Each coin that we add while computing the span satisfies the
1024: 2-adjacency restriction, so the perimeter never increases. In the end we must
1025: have a rectangle with perimeter $2h$. Hence $4n \geq 2h$, i.e., $n \geq h/2$,
1026: and because $n$ is integral, $n \geq \lceil h/2 \rceil$.
1027: \end{proof}
1028:
1029: \subsection{Canonical Configuration}
1030:
1031: Observe that a chain has span equal to its smallest enclosing rectangle. We
1032: define an \emph{L} to be a particular kind of chain, starting and ending at
1033: opposite corners of the rectangular span, and arranged along two edges of this
1034: rectangle, with the property that it has the minimum number of coins. See
1035: Figure \ref{L} for examples. More precisely, if the half-perimeter of the
1036: rectangle (along which the L is arranged) is $2k$, then there must be precisely
1037: $k$ coins, every consecutive pair at distance exactly two from each other. And
1038: if the half-perimeter is $2k+1$, then there must be precisely $k+1$ coins,
1039: every consecutive pair at distance exactly two from each other, except the last
1040: pair which are distance one from each other. In general, for half-perimeter
1041: $h$, an L has $\lceil h/2 \rceil$ coins.
1042:
1043: \begin{figure}
1044: \centerline{\includegraphics[scale=\coinscale]{L.eps}}
1045: \caption{\label{L}
1046: Examples of L's.}
1047: \end{figure}
1048:
1049: While L's can have any orientation, the \emph{canonical L} is oriented
1050: like the letter L, starting at the top-left corner, continuing past the
1051: lower-left corner, and ending at the bottom-right corner.
1052:
1053: Given a configuration, or more precisely, given its span and the number of
1054: coins in each connected component of the span, we define the \emph{canonical
1055: configuration} as follows. Refer to Figure \ref{canonical} for examples.
1056: Within each connected component (rectangle) of the span, say with
1057: half-perimeter $h$, we arrange the first $\lceil h/2 \rceil$ coins into the
1058: canonical L. (Lemma \ref{min chain size} implies that there are at least this
1059: many coins to place.) Any additional coins are placed one at a time, in the
1060: leftmost bottommost unoccupied position.
1061:
1062: \begin{figure}
1063: \centerline{\includegraphics[scale=\coinscale]{canonical.eps}}
1064: \caption{\label{canonical}
1065: Examples of the canonical configuration of $k$ coins within a
1066: rectangular span. (Left) One coin in addition to the canonical L.
1067: (Middle) Four coins in addition to the canonical L.
1068: (Right) All 24 additional coins.}
1069: \end{figure}
1070:
1071: This definition of the canonical configuration is fairly arbitrary, but it has
1072: the useful property that each successive position for an additional coin is a
1073: valid destination, given the previously placed additional coins. This allows
1074: us to focus on forming the canonical L, and then picking up all additional
1075: coins and dropping them in the order shown on the right of Figure
1076: \ref{canonical}.
1077:
1078: \subsection{Canonicalizing Algorithm}
1079:
1080: The main part of proving Theorem \ref{square grid} is to show an algorithm for
1081: converting any configuration into the corresponding canonical configuration,
1082: using a sequence of (mostly) reversible moves. We will apply induction (or,
1083: equivalently, recursion) on the number of coins. That is, we assume that any
1084: configuration with fewer coins can be re-arranged into its canonical
1085: configuration.
1086:
1087: For now, we assume that there are no extra coins in addition to $e_1$ and
1088: $e_2$. For if there were such a coin, we could immediately pick it up. Then
1089: we have a simpler configuration: it has one fewer coin. Thus we can apply the
1090: induction hypothesis, and re-arrange the remaining coins into their canonical
1091: configuration. Finally we must drop the previously picked-up coin in the
1092: appropriate location. This aspect is somewhat trickier than it may seem: if we
1093: are not careful, we may make an irreversible move. We delay this issue to
1094: Section \ref{Final Sweep}.
1095:
1096: The overall outline of the algorithm is as follows:
1097:
1098: \begin{enumerate}
1099: \item Initialize the set of L's to be one for each coin.
1100: \item Until the configuration is canonical:
1101: \begin{enumerate}
1102: \item Pick two L's whose bounding rectangles are distance at most two
1103: from each other.
1104: \item Re-orient the L's so that the L's themselves are distance at most
1105: three from each other.
1106: \item Merge the two L's.
1107: \end{enumerate}
1108: \end{enumerate}
1109:
1110: Normally, each iteration of Step~2 decreases the number of L's by one, so the
1111: algorithm would terminate in at most $n$ iterations. However, at any time we
1112: may find an extra coin in addition to $e_1$ and $e_2$, and pick it up.
1113: Fortunately, this operation can only split one L into at most two L's.
1114: Thus we can charge the cost of creating an extra L to the event of picking up
1115: an extra coin, which can happen at most $n$ times. Hence, the total number of
1116: iterations of Step~2 is $O(n)$.
1117:
1118: In the following two sections, we describe how Steps~2(b) and~2(c) can be done
1119: in $O(n^2)$ moves each. These bounds result in a total of $O(n^3)$ moves. The
1120: running time of the algorithms will be proportional to the number of moves.
1121:
1122: \subsubsection{Re-orienting L's}
1123: \label{Re-orienting L's}
1124:
1125: There are eight possible orientations for an L, depending at which corner it
1126: starts, and whether it hugs the top edge or bottom edge of the rectangular
1127: span. We will only be concerned with four different types of orientations,
1128: depending on whether it looks like the letter L rotated $0$, $90^\circ$,
1129: $180^\circ$, or $270^\circ$. In other words, we are not concerned with the
1130: parity issue of which corner might have two adjacent coins.
1131:
1132: It is relatively easy to \emph{flip} an L about a diagonal, using two extra
1133: coins. Figure \ref{flip 3L} shows how to do this in a constant number of moves
1134: for an L consisting of three coins. Figure \ref{flip L} shows how to use these
1135: subroutines to flip an L of arbitrary size. Basically, we use the flips of
1136: three-coin L's to ``bubble'' the kink in the L up to the top, repeatedly until
1137: it is all the way right. The total number of moves is $O(n^2)$, and they can
1138: easily be computed in $O(n^2)$ time.
1139:
1140: \begin{figure}
1141: \centerline{\includegraphics[scale=\coinscale]{flip_3L.eps}}
1142: \caption{\label{flip 3L}
1143: Flipping an L consisting of 3 coins. Extra coins are shaded.}
1144: \end{figure}
1145:
1146: \begin{figure}
1147: \centerline{\includegraphics[scale=0.6]{flip_L.eps}}
1148: \caption{\label{flip L}
1149: Flipping a general L, using the subroutines in Figure \protect\ref{flip 3L}.}
1150: \end{figure}
1151:
1152: The more difficult re-orientation to perform is a \emph{rotation} of an L by
1153: $\pm 90^\circ$. Perhaps one of the most surprising results of this paper is
1154: that this operation is possible with two extra coins. One way to do it for a
1155: square span, shown in Figure \ref{rotate L 4x4}, is to convert the L into a
1156: diagonal, and then convert more and more of the diagonal into a rotated L.
1157: This is the basis for our ``diagonal-flipping'' puzzle in Figure
1158: \ref{diagonal}.
1159:
1160: \begin{figure}
1161: \centerline{\includegraphics[scale=\coinscale]{rotate_L_4x4.eps}}
1162: \caption{\label{rotate L 4x4}
1163: One method for rotating an L with a square span. Although this example
1164: places the extra coins in the final configuration, this is not necessary.}
1165: \end{figure}
1166:
1167: A simpler way to argue that L's can be rotated is shown in Figure \ref{rotate
1168: L}. Assume without loss of generality that the initial orientation is the
1169: canonical L. First we apply induction to the subconfiguration of all coins
1170: except the top-left coin. Thus all rows except the third row contain at most
1171: one coin each, assuming the L consists of at least three rows. Now we apply
1172: local operations in $3 \times 3$ or $3 \times 2$ rectangles (similar to Figure
1173: \ref{flip 3L}) to move the top-left coin to the far right. (We cannot perform
1174: this left-to-right motion in one step using induction, because there may be
1175: only three rows, and hence all coins may be involved in this motion.) Finally
1176: we flip the L in the top three rows, as described above, thereby obtaining the
1177: desired result. Again the number of moves and computation time are both
1178: $O(n^2)$. Note that the same approach of repeated local operations applies
1179: when the L consists of only two rows.
1180:
1181: \begin{figure}
1182: \centerline{\includegraphics[scale=0.5]{rotate_L.eps}}
1183: \caption{\label{rotate L}
1184: A general method for rotating an L. The first step is to apply induction,
1185: and the remaining steps apply subroutines similar to
1186: Figure \protect\ref{flip 3L}.}
1187: \end{figure}
1188:
1189: \subsubsection{Merging L's}
1190:
1191: %--- Old outline:
1192: % route them close to each other
1193: % if unnecessary coins, done
1194: % else remove an end of an L that matters, apply induction
1195: % how to add a coin back (shift it along using 3-coin subconfigurations)
1196:
1197: Consider two L's $L_1$ and $L_2$ whose bounding rectangles $R_1$ and
1198: $R_2$ are distance at most two from each other. Equivalently, consider two L's
1199: such that $\span (L_1 \cup L_2)$ has a single connected component.
1200: This section describes how to merge $L_1$ and $L_2$ into a single L.
1201: This step is the most complicated part of the algorithm, not because it is
1202: difficult in any one case, but because there are many cases involved.
1203:
1204: First suppose that the rectangles $R_1$ and $R_2$ overlap.
1205: We claim that one of the L's, say $L_1$, can be re-oriented so that one of its
1206: coins is contained in the other L's bounding rectangle, $R_2$. This coin is
1207: therefore in the span of the $L_2$, and hence redundant, so as described above
1208: we can apply induction and finish the entire canonicalization process.
1209:
1210: To prove the claim, there are three cases; see
1211: Figure \ref{merge L overlapping}.
1212: If a corner of one of the bounding rectangles, say $R_1$, is in the other
1213: bounding rectangle, $R_2$, then we can re-orient $L_1$ so that one of its end
1214: coins is at that corner of $R_1$ and hence in $R_2$; see
1215: Figure \ref{merge L overlapping}(a)).
1216: Otherwise, we have rectangles that form a kind of ``thick plus sign''
1217: (Figure \ref{merge L overlapping}(b--c));
1218: we distinguish the two rectangles as according to whether they form the
1219: \emph{horizontal stroke} or \emph{vertical stroke} of the plus sign.
1220: If the vertical stroke has width at least two
1221: (Figure \ref{merge L overlapping}(b)),
1222: then that rectangle already contains a coin of the other L,
1223: because that L cannot have two empty columns.
1224: Similarly, if the horizontal stroke has height at least two,
1225: then that rectangle already contains a coin of the other L, because that L
1226: cannot have two empty rows.
1227: Finally, if both strokes are of unit thickness, and there is not already a coin
1228: in their single-position intersection (Figure \ref{merge L overlapping}(c)),
1229: then we can splice and redefine the L's, so that one L is formed by the top
1230: half of the vertical stroke and the left half of the horizontal stroke, and the
1231: other L is formed by the bottom half of the vertical stroke and the right half
1232: of the horizontal stroke, and then we have the first case in which the bounding
1233: rectangles share a corner.
1234:
1235: \begin{figure}
1236: \centering
1237: \includegraphics[scale=0.425]{merge_L_overlapping.eps}
1238: \caption{\label{merge L overlapping}
1239: Merging two L's with overlapping bounding rectangles (shaded).
1240: (a) The corner of one L is contained in the other L's bounding rectangle.
1241: (b) A ``thick plus sign'' in which at least one stroke has thickness
1242: more than~$1$. (c) A plus sign in which both strokes have thickness~$1$.}
1243: \end{figure}
1244:
1245: Now suppose that the rectangles $R_1$ and $R_2$ do not overlap. Hence, either
1246: they share no $x$ coordinates or they share no $y$ coordinates. Assume by
1247: symmetry that $R_1$ and $R_2$ share no $x$ coordinates. Assume again by
1248: symmetry that $R_1$ is to the left of $R_2$. A \emph{leg} is a horizontal or
1249: vertical segment/edge of an L. Re-orient $L_1$ so that its vertical leg is on
1250: the right side, and re-orient $L_2$ so that its vertical leg is on the left
1251: side. Now $L_1$ and $L_2$ have distance at most three from each other; the
1252: distance may be as much as three because of parity.
1253:
1254: We consider merging $L_1$ with each leg of $L_2$ one at a time.
1255: In other words, we merge $L_1$ with the nearest leg of $L_2$ within distance
1256: three of $L_1$, then we merge the result with the other leg of $L_2$.
1257: The second leg can be treated in the same way as the first leg, by induction.
1258: Thus there are two cases: either the first leg is the horizontal leg of $L_2$,
1259: or it is the vertical leg of $L_2$.
1260: We first show how the latter case reduces to the former case.
1261:
1262: If the vertical leg of $L_2$ is the first leg, it can have only one coin within
1263: the $y$ range of $R_1$ (by the assumption that extra coins are picked up). We
1264: can add this coin separately, as if it were a short horizontal leg of its own
1265: L. This leaves a portion of the vertical leg of $L_2$ outside of the $y$ range
1266: of $R_2$. Thus what remain of $R_1$ and $R_2$ do not share any $y$
1267: coordinates, so we can rotate the picture $90$ degrees and return to a
1268: horizontal problem.
1269:
1270: This argument reduces merging two L's to at most three merges between an L and
1271: a horizontal leg. Still several cases remain, as illustrated in Figure
1272: \ref{merge L I}. Case 1 is when the horizontal leg is aligned with a coin in
1273: the L. Case 2 is when they are out of alignment. Case 3 is a special case
1274: occurring at the corner of the L, where the horizontal legs are aligned but
1275: distances are higher than in Case 1. The above three cases are subdivided into
1276: subcases (a) and (b), depending on how close the horizontal leg is to the L.
1277: Finally, Case 4 is when the L and horizontal leg do not share $x$ or $y$
1278: coordinates.
1279:
1280: \begin{figure}
1281: \centerline{\includegraphics[scale=0.37]{merge_L_I.eps}}
1282: \caption{\label{merge L I}
1283: Merging an L and the horizontal leg of a nearby L.}
1284: \end{figure}
1285:
1286: By the procedures in Figure \ref{merge L I}, in all cases, the merging can be
1287: done in $O(1)$ flips and rotations of L's, $O(1)$ leapfrogs, and $O(n)$
1288: shuffles. In total, $O(n^2)$ moves are required to merge an L and a horizontal
1289: leg, or equivalently to merge two L's.
1290:
1291: %--- Version in original submission: Lacked many details and figures,
1292: % and best analysis I could formalize was O(n^4) in total.
1293: % Now consider a coin $t$ (in $L_2$) that has maximum $x$
1294: % coordinate, and subject to this restriction is farthest from $R_1$ as possible.
1295:
1296: % We claim that $\span (L_1 \cup L_2 - t)$ has a single connected component, just
1297: % like $\span (L_1 \cup L_2)$. There are several cases. If $L_2$ has only one
1298: % coin, then removing $t$ reduces the span to $\span L_1$, which is connected.
1299: % If $R_2$ has more than one column, then $t$ is the only coin in its column, so
1300: % removal of $t$ simply removes the rightmost column from the span. So suppose
1301: % $R_2$ has only one column but that $L_2$ has more than one coin. Thus there
1302: % are several coins in $L_2$ with maximum $x$ coordinate, and we chose $t$ to be
1303: % as far from $R_1$ as possible. If $t$ shares a $y$ coordinate with $R_1$, then
1304: % removal of $t$ will not affect the span because of other coins in $L_2$.
1305: % Otherwise, removal of $t$ removes either the topmost or bottommost row from
1306: % the span. In all cases, the span remains connected.
1307:
1308: % \xxx{The above probably needs a figure to convince the reader.}
1309:
1310: % Now we can apply the induction hypothesis to $L_1 \cup L_2 - t$ and re-arrange
1311: % it into an L. By re-orienting the L, we can arrange for $t$ to be within
1312: % distance two from the L. Using local operations each involving at most three
1313: % coins, we can move $t$ to the end of the L, thereby forming a slightly
1314: % longer chain. Finally, this chain can be re-arranged into an L using
1315: % more local operations.
1316:
1317: % \xxx{Also draw a figure for the above.}
1318:
1319: % Because we may have to re-orient L's, each step in this induction may cost as
1320: % much as $\Theta(n^2)$, for a total cost of $O(n^3)$ per merge.
1321:
1322: % % We first apply the re-orientation method of the previous section so that the
1323: % % two L's have distance at most three, i.e., there are two coins of different L's
1324: % % with distance at most three. If $R_1$ and $R_2$ do not share any $x$ or $y$
1325: % % coordinates, we can orient the L's to have two ends within distance two of each
1326: % % other. If $R_1$ and $R_2$ overlap (have distance two), then we can orient the
1327: % % L's so that they ``overlap'' (have distance at most two). If $R_1$ and $R_2$
1328: % % are distance one or two from each other, say along horizontal edges, then we
1329: % % can orient the L's against these horizontal edges. Because of parity we may
1330: % % end up with every two coins from different L's having distance at least three.
1331: % %
1332: % % [figure abut_L]
1333:
1334: \subsection{Final Sweep}
1335: \label{Final Sweep}
1336:
1337: Thus far we have shown how to reversibly re-arrange a configuration ($A$ or
1338: $B$) into the canonical configuration, using two extra coins. However, during
1339: this process, we may have picked up extra coins, and now need to drop them
1340: appropriately. In reality, these coins sit in arbitrary locations on the
1341: board. For re-arranging the source configuration $A$ into the canonical
1342: configuration, the moves need not be reversible, so we can simply drop the
1343: extra coins in the canonical order, as in Figure \ref{canonical}. For
1344: re-arranging the destination configuration $B$ into the canonical
1345: configuration, we need to effectively drop these coins by a sequence of reverse
1346: moves.
1347:
1348: More directly, starting from the canonical configuration, we need to show how
1349: to distribute the extra coins to arbitrary locations on the board. We
1350: can achieve this effect by making a complete sweep over the board. More
1351: precisely, we flip the L as in Section \ref{Re-orienting L's}, which has the
1352: effect of passing over every position on the board with the operations shown in
1353: Figure \ref{flip 3L}. During this process, we will pass over the extra coins;
1354: at this point we treat them as if they were picked up, applying the emulation
1355: in Section \ref{Picking Up and Dropping Tokens}.
1356: Then we flip the L back to its original orientation.
1357: On the way back, whenever we apply an operation in Figure \ref{flip 3L} and
1358: pass over the desired destination $d$ for one of the extra coins, we move the
1359: extra coin to $d$ while there are at least two adjacent coins from the L.
1360: By monotonicity of the flipping process, this extra coin will not be passed
1361: over later by the flip, so once an extra coin is placed in its desired
1362: location, it remains there.
1363:
1364: \subsection{Reducing Span}
1365:
1366: Now that we know any configuration can be brought to the corresponding
1367: canonical configuration with a sequence of (mostly) reversible moves, it
1368: follows immediately that any configuration can be re-arranged into any
1369: configuration with the same span. More generally, if we are given
1370: configurations $A$ and $B$ satisfying $\span A \supseteq \span B$, we can first
1371: pick up all coins in $A \setminus \span B$, then reversibly re-arrange both
1372: configurations into the same canonical configuration. Putting these two
1373: sequence of moves together, we obtain a re-arrangement from $A \setminus \span
1374: B$ to $B$ with some coins missing. Then we simply drop the previously picked
1375: up coins in the appropriate positions to create $B$.
1376:
1377: Note that these moves need not be reversible, because we are only concerned
1378: with the direction from $A$ to $B$. Indeed, the moves cannot be made
1379: reversible, because the span cannot increase (Lemma \ref{span monotone}).
1380:
1381: This concludes the proof of Theorem \ref{square grid}.
1382:
1383: \subsection{Lower Bound}
1384: \label{Lower Bound}
1385:
1386: The bound on the number of moves in Theorem \ref{square grid} is in fact tight:
1387:
1388: \begin{theorem}
1389: The ``V to diagonal'' puzzle in Figure \ref{lower bound sqr}
1390: requires $\Theta(n^3)$ moves to solve.
1391: \end{theorem}
1392:
1393: \begin{figure}
1394: \centerline{\includegraphics[scale=\coinscale]{lower_bound_sqr.eps}}
1395: \caption{\label{lower bound sqr}
1396: Re-arranging the V-shape in the upper left into the diagonal in the
1397: lower right requires repeated rotations
1398: of diagonals as in Figure \protect\ref{diagonal} (or repeated rotations of
1399: L's).}
1400: \end{figure}
1401:
1402: \begin{proof}
1403: We claim that re-arranging the V shape into a diagonal effectively requires
1404: repeated ``diagonal flipping.'' At any time, only one component of coins can
1405: be actively manipulated (drawn with dotted lines in the figure); all other
1406: coins are isolated from movement. Thus we must repeatedly re-arrange the
1407: active component so that it can reach the nearest isolated coin. More
1408: specifically, we must re-arrange the active component into a chain starting at
1409: the corner of the bounding rectangle that is near the isolated coin, and ending
1410: at the opposite corner of the bounding rectangle of the active component.
1411: These two corners alternate for each isolated coin we pick up, and that is the
1412: sense in which we must ``flip a diagonal.'' It is fairly easy to see that
1413: each diagonal flipping of a chain with $k$ coins takes $\Omega(k^2)$ time.
1414: In total, the puzzle requires $\Theta(\sum_{k=1}^n k^2) = \Theta(n^3)$ moves.
1415: \end{proof}
1416:
1417: This theorem is the motivation for the puzzle in Figure \ref{vee}.
1418:
1419: \subsection{Labeled Coins}
1420: \label{Labeled Coins}
1421:
1422: We conjecture that Theorem \ref{square grid} holds even when coins are labeled,
1423: subject to a few constraints. The idea is that permutation of the coins is
1424: relatively easy once we reach the canonical configuration. Examples of methods
1425: for swapping coins within one L are shown in Figure \ref{swap L}. The top
1426: figure shows how to swap a pair of coins when the canonical configuration is
1427: nothing more than a canonical L. The middle figure shows how to perform the
1428: same swap when there are four additional coins. Note that swapping the corner
1429: coin 3 works in exactly the same way; indeed, this method works whenever the
1430: coins to be swapped have two other coins adjacent to them, and there is another
1431: valid destination. The bottom figure shows how to swap one of the end coins,
1432: which is more difficult. This last method begins with moving the bend of the L
1433: toward the end coin, and then works locally on the coins $1,2,3$.
1434:
1435: \begin{figure}
1436: \centerline{\includegraphics[scale=0.6]{swap_L.eps}}
1437: \caption{\label{swap L}
1438: Three cases of swapping coins in the canonical configuration.
1439: The coins to be swapped have a thick outline.}
1440: \end{figure}
1441:
1442: One obvious constraint for these methods is that if there are no valid moves,
1443: permutation is impossible. Also, if the bounding rectangle of an L has width
1444: or height $1$, then the two end coins of the L cannot be moved. Subject to
1445: these constraints, Figure \ref{swap L} proves that the coins in a single
1446: connected component of the span, other than the extra coins $e_1$ and $e_2$,
1447: can be permuted arbitrarily.
1448:
1449: It only remains to show that a coin can be swapped with $e_1$ or $e_2$, which
1450: implies that coins between different connected components of the span can be
1451: swapped. We have not proved this in general yet, but one illustrating example
1452: is the puzzle in Figure \ref{swap5}, whose solution is shown in Figure
1453: \ref{swap5 solution}. The idea is that coins 2 and 4 are $e_1$ and $e_2$, and
1454: so we succeed in swapping $e_2$ with coin 3. A slight generalization of this
1455: approach may complete a solution to the labeled coins.
1456:
1457: \begin{figure}
1458: \centerline{\includegraphics[scale=\coinscale]{swap5_solution.eps}}
1459: \caption{\label{swap5 solution}
1460: Solution to the puzzle in Figure \protect\ref{swap5}.}
1461: \end{figure}
1462:
1463: \subsection{Fewer Extra Coins}
1464: \label{Fewer Extra Coins}
1465:
1466: We have shown that the configuration space is essentially strongly connected
1467: provided there is a pair of extra coins, i.e., the removal of these two coins
1468: does not reduce the span. This section summarizes what we know about
1469: configurations without this property.
1470:
1471: If we have a span-minimal configuration with no extra coins, Lemma
1472: \ref{span-minimal fragile} tells us that every move decreases the span. With
1473: an overhead of a factor of $n^2$, we can simply try all possible moves, in each
1474: case obtaining a configuration with smaller span, which furthermore must have
1475: an extra coin (the moved coin). Now we only need to recursively check these
1476: configurations.
1477:
1478: Unfortunately, the situation is trickier with one extra coin. The key
1479: difficulty is that multiple coins could individually be considered extra,
1480: but no pair of coins is extra. In other words, there may be two coins such
1481: that removing either one does not reduce the span, but removing both of them
1482: reduces the span. Two simple examples are shown in Figure \ref{two extra}.
1483:
1484: \begin{figure}
1485: \centerline{\includegraphics[scale=\coinscale]{two_extra.eps}}
1486: \caption{\label{two extra}
1487: The shaded coins are individually extra, but do not form a pair of
1488: extra coins suitable for Theorem \protect\ref{square grid}.}
1489: \end{figure}
1490:
1491: This difficulty makes ``one'' extra coin surprisingly powerful. For example,
1492: using one extra coin, an L with odd parity can be flipped, although it cannot
1493: be rotated, and an L with even parity cannot be flipped or rotated.
1494: In Figure \ref{one extra} we exploit this property to make an interesting
1495: solvable puzzle initially with no pair of extra coins; it takes significant
1496: work before a pair of extra coins appears.
1497:
1498: \begin{figure}
1499: \centerline{\includegraphics[scale=\coinscale]{one_extra.eps}}
1500: \caption{\label{one extra}
1501: A puzzle on the square grid with no initial pair of extra coins.}
1502: \end{figure}
1503:
1504: \section{Conclusion}
1505: \label{Conclusion}
1506:
1507: We have begun the study of deciding solvability of coin-moving puzzles and more
1508: generally token-moving puzzles. We gave an exact characterization of solvable
1509: puzzles with labeled coins on the equilateral-triangle grid. By introducing
1510: the notion of a constant number of extra coins, we have given a tight theorem
1511: characterizing solvable puzzles on the square grid. Specifically, we have
1512: shown that any configuration can be re-arranged into any configuration with the
1513: same or smaller span using two extra coins, and that this is best possible in
1514: general. The number of moves is also best possible in the worst case.
1515:
1516: Several open questions remain:
1517:
1518: \begin{enumerate}
1519: \item What is the complexity of solving a puzzle using the fewest moves?
1520: %--- This is flat-out wrong:
1521: %Even the exact combinatorics of turning a general pyramid upside-down
1522: %as in Figure \ref{upside-down} are open \cite{Gardner-1975-penny}.
1523: \item How do our results change if moves are forced to be \emph{slides}
1524: that avoid other coins? We conjecture that Theorem \ref{triangular
1525: grid} still holds for unlabeled coins.
1526: %\item What puzzles on the square grid with zero or one extra coins are
1527: % solvable? Can this be decided in polynomial time?
1528: %\item Can our results about square grids be generalized to labeled
1529: % coins? We outline some approaches to solving this in
1530: % Section \ref{Labeled Coins}.
1531: \item Can we extend our results on the square grid to the hypercube lattice
1532: in any dimension?
1533: \item Can we combine Theorems \ref{triangular grid} and \ref{square grid}
1534: to deal with a mix of the square and equilateral-triangle lattice,
1535: like the second puzzle in Figure \ref{HOH}?
1536: \item Can we prove similar results for general graphs?
1537: \end{enumerate}
1538:
1539:
1540: \section*{Acknowledgments}
1541:
1542: We thank J.\ P.\ Grossman for writing a program to find optimal solutions to
1543: the puzzles in Figures \ref{diagonal} and \ref{spindle}.
1544:
1545: \bibliography{coinsliding}
1546: \bibliographystyle{plain}
1547:
1548: \end{document}
1549: