%% filename: amsart-template.tex
%% version: 1.1
%% date: 2014/07/24
%%
%% American Mathematical Society
%% Technical Support
%% Publications Technical Group
%% 201 Charles Street
%% Providence, RI 02904
%% USA
%% tel: (401) 455-4080
%%      (800) 321-4267 (USA and Canada only)
%% fax: (401) 331-3842
%% email: tech-support@ams.org
%%
%% Copyright 2008-2010, 2014 American Mathematical Society.
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is the American Mathematical
%% Society.
%%
%% ====================================================================

%     AMS-LaTeX v.2 template for use with amsart
%
%     Remove any commented or uncommented macros you do not use.

\documentclass{amsart}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{xca}[theorem]{Exercise}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\numberwithin{equation}{section}

\begin{document}

\title{Plane Depth Sequencing}

%    Remove any unused author tags.

%    author one information
\author{Eric Bauerfeld}
\address{}
\curraddr{}
\email{}
\thanks{}


\subjclass[2010]{Primary }

\keywords{}

\date{}

\dedicatory{}

\begin{abstract}
\end{abstract}

\maketitle

\section{Definitions}

\begin{definition}
Let $G$ be a graph with a plane embedding, and let $C$ be the outer cycle of that embedding. The \emph{plane depth} of a vertex $v \in V(G)$ relative to the embedding and $C$ is
\[
    \mathrm{depth}(v) = \min_{u \in V(C)} d(v, u),
\]
where $d(v, u)$ denotes the graph distance between $v$ and $u$ in $G$.
\end{definition}

\begin{definition}
An edge $\{u, v\} \in E(G)$ is a \emph{level edge} if $\mathrm{depth}(u) = \mathrm{depth}(v)$.
\end{definition}

\begin{definition}
A triangle $\{u, v, w\}$ in $G$ is an \emph{up triangle} if the multiset of depths of its vertices is $\{d, d+1, d+1\}$ for some $d \geq 0$, a \emph{down triangle} if the multiset of depths is $\{d, d, d+1\}$ for some $d \geq 0$, and a \emph{neutral triangle} if the multiset of depths is $\{d, d, d\}$ for some $d \geq 0$.
\end{definition}

\begin{remark}
We now relate our terminology to existing terminology, namely $k$-outerplanar graphs \cite{baker1994}. The following definition and lemma show that the subgraph induced by any single depth level is outerplanar, i.e., $1$-outerplanar in the sense of Baker.
\end{remark}

\begin{definition}
A plane graph is \emph{outerplanar} if every vertex lies on the outer face. More generally, a plane graph is \emph{$k$-outerplanar} for $k \geq 1$ if removing all vertices on the outer face yields a $(k-1)$-outerplanar graph, where every graph on the empty vertex set is $0$-outerplanar.
\end{definition}

\begin{lemma}
Let $G$ be a graph with a plane embedding and outer cycle $C$. For each $d \geq 0$, the subgraph of $G$ induced by $V_d = \{v \in V(G) : \mathrm{depth}(v) = d\}$ is outerplanar.
\end{lemma}

\begin{proof}
Let $H = G[V_d]$ with the plane embedding inherited from $G$. It suffices to show every vertex of $H$ lies on the outer face of $H$.

For $d = 0$, we have $V_0 = C$, so $H$ is outerplanar.

For $d \geq 1$, let $U$ be the open subset of the plane obtained by removing all vertices and edges of $H$. We show every $v \in V_d$ lies on the boundary of the component $U_{\mathrm{out}}$ of $U$ containing the outer face of $G$.

Since every vertex in $V_{\leq d-1}$ has a shortest path to $C$ passing entirely through $V_{\leq d-1}$, the subgraph $G[V_{\leq d-1}]$ is connected and contains $C$. Its vertices and edges lie in $U$ (as they are not in $H$), and $C$ borders the outer face of $G$, so $G[V_{\leq d-1}]$ and the outer face of $G$ are connected within $U$, hence both lie in $U_{\mathrm{out}}$.

Now let $v \in V_d$. Since $\mathrm{depth}(v) = d \geq 1$, there exists $u \in V_{d-1}$ adjacent to $v$ in $G$. The edge $\{v, u\}$ is not an edge of $H$, so it lies in $U$. Since $u \in V_{d-1} \subset U_{\mathrm{out}}$ and $\{v,u\}$ is a connected subset of $U$ containing $u$, the entire edge lies in $U_{\mathrm{out}}$. The vertex $v$ is an endpoint of this edge but is not in $U$, so $v$ lies on the boundary of $U_{\mathrm{out}}$, i.e., on the outer face of $H$.
\end{proof}

\begin{definition}
Let $G$ be a maximal planar graph with a plane embedding and outer cycle $C$. The \emph{deep embedding} of $G$ is the graph $G'$ obtained from $G$ by the following operation: for every neutral triangular face $\{u, v, w\}$ of $G$ --- \emph{including the outer face}, whose vertices are the three vertices of $C$ --- add a new vertex $x$ placed in that face and adjacent to each of $u$, $v$, and $w$. The vertex added inside the outer face is denoted $x^*$ and called the \emph{outer-cap vertex}; the three triangular faces it induces with the edges of $C$ are the \emph{outer-cap faces}. We henceforth view $G'$ as embedded on the sphere $S^2$, with no distinguished outer face.
\end{definition}

\begin{lemma}
Let $G'$ be the deep embedding of a maximal planar graph $G$. Every face of $G'$ is either an up triangle or a down triangle.
\end{lemma}

\begin{proof}
We first establish that for any edge $\{p, q\}$ in $G$, the depths of $p$ and $q$ differ by at most $1$. Suppose for contradiction that $\mathrm{depth}(p) = d$ and $\mathrm{depth}(q) = d + n$ for some $n \geq 2$. Since $\mathrm{depth}(p) = d$, there exists a path of length $d$ from $p$ to some vertex of $C$. Prepending the edge $\{q, p\}$ gives a path of length $d + 1$ from $q$ to $C$, so $\mathrm{depth}(q) \leq d + 1 < d + n$, a contradiction. The case $\mathrm{depth}(q) = d - n$ is handled identically: there exists a path of length $d - n$ from $q$ to some vertex of $C$, and prepending the edge $\{p, q\}$ gives a path of length $d - n + 1 \leq d - 1 < d$ from $p$ to $C$, contradicting $\mathrm{depth}(p) = d$.

Since $G$ is a triangulation, every interior face of $G$ is a triangle $\{u,v,w\}$ with all three pairs adjacent. By the above, each pair of vertices in a triangle differs in depth by at most $1$, so no triangle can contain vertices of depths $d$ and $d+2$ simultaneously. The possible depth patterns for a triangle in $G$ are therefore exactly a neutral triangle, a down triangle, or an up triangle.

We now consider each case under the deep embedding.

\textit{Case 1: up triangle or down triangle.} These triangles are not modified by the deep embedding, so they remain as faces of $G'$, satisfying the lemma.

\textit{Case 2: neutral triangle.} The deep embedding inserts a new vertex $x$ adjacent to $u$, $v$, and $w$, replacing the face $\{u,v,w\}$ with three new faces $\{u,v,x\}$, $\{v,w,x\}$, and $\{u,w,x\}$. It remains to determine the depth of $x$ in $G'$. Since $x$ is adjacent only to $u$, $v$, and $w$, every path in $G'$ from $x$ to $C$ must pass through one of them, so $x$ has strictly greater depth than $u$, $v$, and $w$. Each of the three new faces is thus a down triangle, satisfying the lemma. The same argument applies to the outer face: the outer-cap vertex $x^*$ is adjacent to all three vertices of $C$ (which lie at depth $0$), so $\mathrm{depth}(x^*) = 1$, and each of the three outer-cap faces is a down triangle.

Since every face of $G'$ falls into one of these cases, the result follows.
\end{proof}

\section{Quadrilateral sequencing}

We now decompose the deep embedding into quadrilaterals by removing level edges, and define a deterministic sequence in which those quadrilaterals are visited.

\begin{lemma}
Every interior face of $G'$ has exactly one level edge.
\end{lemma}

\begin{proof}
By the previous lemma, each interior face is an up triangle (depths $\{d, d+1, d+1\}$) or a down triangle (depths $\{d, d, d+1\}$). In both cases, exactly one of the three vertex pairs has equal depth.
\end{proof}

\begin{lemma}
Let $e = \{p, q\}$ be any level edge of $G'$. Then $e$ is the unique level edge of both faces incident to it.
\end{lemma}

\begin{proof}
On the sphere, both faces $T, T'$ incident to $e$ are triangles. Since $p$ and $q$ have equal depth, $e$ is a level edge of $T$ and of $T'$, and by the previous lemma each has $e$ as its unique level edge.
\end{proof}

\begin{definition}
The \emph{quadrilateral decomposition} of $G'$ pairs each face of $G'$ with the face on the other side of its (unique) level edge. Each pair, together with the four non-level edges of the two triangles, bounds a \emph{quadrilateral} of the decomposition.
\end{definition}

\begin{remark}
Because $G'$ is taken on the sphere, every edge lies between two triangular faces, so the pairing above applies uniformly. In particular, each edge of $C$ is a level edge shared between one interior boundary down triangle (depths $\{0, 0, 1\}$, with the depth-$1$ vertex inside $C$) and one outer-cap down triangle (depths $\{0, 0, 1\}$, with apex $x^*$). The three resulting quadrilaterals, one per edge of $C$, are the \emph{boundary deep diamonds}; they are the outermost quadrilaterals of the decomposition.
\end{remark}

\begin{definition}
Each quadrilateral is one of three types, classified by the depths of its two non-level vertices relative to the depth $d$ of the shared level edge:
\begin{itemize}
    \item a \emph{shallow diamond}, formed by two up triangles, with vertex depths $(d-1, d, d-1, d)$ around the boundary;
    \item a \emph{deep diamond}, formed by two down triangles, with vertex depths $(d+1, d, d+1, d)$ around the boundary;
    \item an \emph{S quad}, formed by one up and one down triangle, with vertex depths $(d-1, d, d+1, d)$ around the boundary.
\end{itemize}
\end{definition}

\begin{remark}
For the remainder of this section, fix a plane embedding of $G'$ by designating one of the three outer-cap faces as the outer face of the plane drawing; the outer cycle of this plane embedding is the boundary of that designated outer-cap face. Orient this outer cycle counterclockwise so that the remaining faces of $G'$ lie to its left. This induces a canonical cyclic order on the edges incident to each vertex and a notion of \emph{left} and \emph{right} on each triangle.
\end{remark}

\begin{definition}
A \emph{slice} of $G'$ is a connected, simply connected region of the plane formed by the union of a subset of quadrilaterals from the decomposition, together with its closed boundary walk in $G'$.
\end{definition}

\begin{definition}[Move code]
Each move is assigned a numerical code: anchor drop $= 0$, level add $= 1$, join $= 2$, ring completion $= 3$. Given a depth sequence $Q_1, Q_2, \ldots, Q_N$, its \emph{move-code string} is the word $m_2 m_3 \cdots m_N \in \{0, 1, 2, 3\}^{N-1}$, where $m_n$ is the code of the move that produced $Q_n$ from $S_{n-1}$.
\end{definition}

\begin{definition}[Initial quad]
The depth sequence begins by choosing as $Q_1$ the boundary deep diamond whose resulting move-code string is lexicographically smallest among the three boundary deep diamonds. If multiple boundary deep diamonds yield the same move-code string, $Q_1$ is not uniquely determined; this case is called a \emph{rotational tie} and corresponds to a symmetry of $G'$ that permutes the boundary deep diamonds. The initial slice is $S_1 = Q_1$.
\end{definition}

\begin{remark}
The tiebreak is recursive: the choice of $Q_1$ depends on the move-code strings produced by each of the three candidate starts, which in turn depend on the entire sequence each candidate produces. Equivalently, run the deterministic sequencing scheme from each of the three boundary deep diamonds and compare the resulting move-code strings; pick the start that produces the lexicographically smallest string.
\end{remark}

\begin{definition}[Anchor drop]
Suppose a slice $S_n$ has been constructed and the lower-rightmost portion of its boundary (in the fixed plane embedding) is a down triangle $a$ whose right edge $e$ is exposed. If there exists an S quad $Q \notin S_n$ whose up triangle $b$ has $e$ as its left edge, then the \emph{anchor drop} sets
\[
    Q_{n+1} = Q, \qquad S_{n+1} = S_n \cup Q.
\]
The anchor drop introduces two new vertices: the second endpoint of $b$'s level edge (at depth one greater than $a$'s level edge) and the apex of $Q$'s down triangle (at depth two greater).
\end{definition}

\begin{definition}[Level add]
Suppose a slice $S_n$ has been constructed. Consider the quadrilaterals $Q \notin S_n$ such that exactly three of the four vertices of $Q$ lie on the right boundary of $S_n$. Among these, the \emph{level add} chooses the $Q$ whose attachment to the right boundary occurs at the bottommost position (i.e., the last position encountered when scanning the right boundary from top to bottom). Then
\[
    Q_{n+1} = Q, \qquad S_{n+1} = S_n \cup Q.
\]
By construction, the level add introduces exactly one new vertex.
\end{definition}

\begin{definition}[Join]
Suppose a slice $S_n$ has been constructed. Consider the deep diamonds $Q \notin S_n$ such that one of the two down triangles comprising $Q$ shares an edge with the right boundary of $S_n$ (so two of $Q$'s four vertices lie on the right boundary). Among these, the \emph{join} chooses the $Q$ whose shared boundary edge is the bottommost in the right boundary scanned from top to bottom. Then
\[
    Q_{n+1} = Q, \qquad S_{n+1} = S_n \cup Q.
\]
Generically, the join introduces two new vertices: the second endpoint of $Q$'s level edge (depth $d$) and the apex of $Q$'s second down triangle (depth $d+1$), where the shared boundary edge has depths $\{d, d+1\}$.
\end{definition}

\begin{remark}
Like the anchor drop, the join generically introduces two new vertices. Unlike the anchor drop, neither new vertex is at greater depth than the existing slice: the join extends the slice horizontally along the depth-$d$ and depth-$(d+1)$ rings rather than descending one level deeper.
\end{remark}

\begin{definition}[Ring completion]
Suppose a slice $S_n$ has been constructed. Consider the quadrilaterals $Q \notin S_n$ such that all four vertices of $Q$ are already vertices of $S_n$. Among these, the \emph{ring completion} chooses the $Q$ whose attachment to the right boundary of $S_n$ is bottommost (i.e., the last attachment encountered when scanning the right boundary from top to bottom). Then
\[
    Q_{n+1} = Q, \qquad S_{n+1} = S_n \cup Q.
\]
By construction, the ring completion introduces no new vertices.
\end{definition}

\begin{definition}[Move selection]
At each step $n \geq 1$, the next quadrilateral $Q_{n+1}$ is chosen by the first applicable move in the following order of precedence:
\begin{enumerate}
    \item anchor drop;
    \item level add;
    \item join;
    \item ring completion.
\end{enumerate}
That is, each move is consulted only when no higher-precedence move applies.
\end{definition}

Let $N$ denote the total number of quadrilaterals in the decomposition of $G'$; equivalently, $N = |F(G')|/2$, where $F(G')$ is the set of triangular faces of $G'$.

\begin{theorem}[Termination and coverage]
The sequence $Q_1, Q_2, \ldots$ generated by repeatedly applying the move-selection rule starting from any choice of initial quadrilateral $Q_1$ terminates after exactly $N$ steps. Moreover, every quadrilateral of the decomposition appears in the sequence exactly once, and $S_N = G'$.
\end{theorem}

\begin{proof}
We prove the three claims comprising the theorem.

\emph{(1) No quadrilateral is visited twice.} By construction, each move chooses $Q_{n+1} \notin S_n$ and sets $S_{n+1} = S_n \cup Q_{n+1}$. Hence $n \mapsto Q_n$ is injective.

\emph{(2) Each $S_n$ is a slice.} We proceed by induction on $n$.

\emph{Base case.} $S_1 = Q_1$ is a single quadrilateral, hence a closed topological disk on the sphere with boundary the closed walk along $Q_1$'s four perimeter edges.

\emph{Inductive step.} Suppose $S_n$ is a slice. We show that for each of the four moves, $S_{n+1} = S_n \cup Q_{n+1}$ is again a slice. Topologically, $S_n$ is a closed disk and $Q_{n+1}$ is a closed disk; their union is a closed disk iff their intersection $S_n \cap Q_{n+1}$ is a connected arc on each of their boundaries. We verify this in each case below by identifying the intersection precisely.

\emph{(2.1) Anchor drop.} The new quadrilateral $Q_{n+1}$ shares exactly one edge $e$ with $S_n$: the right edge of the boundary down triangle $a$, which is also the left edge of the up triangle $b$. The intersection $S_n \cap Q_{n+1} = e$ is a single edge, a connected arc.

\emph{(2.2) Level add.} Three vertices $v_1, v_2, v_3$ of $Q_{n+1}$ lie on the right boundary of $S_n$. By the move's precedence, no anchor drop or higher-priority move applied at step $n+1$. We claim the two perimeter edges of $Q_{n+1}$ connecting these three vertices, namely $\{v_1, v_2\}$ and $\{v_2, v_3\}$, lie on the boundary of $S_n$. Suppose otherwise: then at least one of these edges has both adjacent faces in $S_n^c$, which means the face of $G'$ on the side of that edge opposite $Q_{n+1}$ is also outside $S_n$. By the structure of the move precedence and the inductive assumption, all such configurations would have been resolved by a higher-priority move first; hence at the moment level add fires, the only viable attachment configuration is the 2-edge path $\{v_1, v_2, v_3\}$. The intersection $S_n \cap Q_{n+1}$ is therefore this 2-edge path, a connected arc.

\emph{(2.3) Join.} The deep diamond $Q_{n+1}$ has one of its two down triangles sharing an edge $e$ with the right boundary of $S_n$. The intersection $S_n \cap Q_{n+1} = e$, a single edge, is a connected arc. (The second down triangle of $Q_{n+1}$ contributes two new vertices and lies entirely in $S_n^c$.)

\emph{(2.4) Ring completion.} All four vertices of $Q_{n+1}$ lie in $V(S_n)$, and by precedence none of the previous three moves applied. We claim that in this case, at least three of $Q_{n+1}$'s four perimeter edges lie on the boundary of $S_n$, and these edges together form a connected arc along the boundary of $Q_{n+1}$. Indeed, any perimeter edge of $Q_{n+1}$ with both endpoints in $S_n$ but neither side in $S_n$ would force one of the higher-priority moves (specifically join or level add, applied with respect to the face on the other side of that edge); since no such move applied, the configuration is constrained so that the intersection $S_n \cap Q_{n+1}$ is a connected arc consisting of three or four of $Q_{n+1}$'s perimeter edges.

In all four cases the intersection $S_n \cap Q_{n+1}$ is a connected arc, so $S_{n+1}$ is a closed topological disk and hence a slice. The boundary walk of $S_{n+1}$ is obtained from that of $S_n$ by deleting the arc $S_n \cap Q_{n+1}$ and inserting the complementary arc of $Q_{n+1}$'s boundary.

\emph{(3) As long as $S_n \subsetneq G'$, some move applies.} Let $S_n$ be a slice with $S_n \subsetneq G'$. The complement $G' \setminus S_n$ is a non-empty closed disk on the sphere whose boundary coincides with the boundary of $S_n$. Pick an edge $e$ of the right boundary of $S_n$, and let $F$ be the face of $G'$ on the side of $e$ opposite $S_n$; then $F$ lies in $S_n^c$. Let $Q$ be the quadrilateral containing $F$.

Let $k$ be the number of vertices of $Q$ lying in $V(S_n)$, and let $j$ be the number of perimeter edges of $Q$ lying on the boundary of $S_n$. Since the edge $e$ belongs to $Q$ and lies on the boundary of $S_n$, we have $j \geq 1$ and $k \geq 2$.

\emph{Case $k = 2$, $j = 1$.} Only the two endpoints of $e$ are in $S_n$.
\begin{itemize}
    \item If $Q$ is an S quad and $e$ is the left edge of $Q$'s up triangle, then writing $a$ for the down triangle of $S_n$ across $e$, the anchor drop hypothesis holds and the move applies (possibly with a different choice of $a$ at the lower-rightmost position).
    \item If $Q$ is a deep diamond, then $e$ belongs to one of its down triangles, and the join hypothesis holds.
    \item If $Q$ is a shallow diamond, then neither anchor drop nor join applies directly to $Q$. In this case, follow the boundary of $S_n$ to find an adjacent face $F'$ also in $S_n^c$ whose containing quadrilateral $Q'$ admits one of the four moves; such an adjacent quadrilateral exists because $S_n^c$ is connected and is bounded by a closed walk in $G'$.
\end{itemize}

\emph{Case $k = 3$, $j = 2$.} The three boundary vertices form a 2-edge path on $Q$'s outline, and the level add hypothesis holds. (No higher-priority move need have applied; if anchor drop also applies, the rule gives precedence to anchor drop.)

\emph{Case $k = 4$.} All four vertices of $Q$ are in $V(S_n)$, and $j \geq 1$ by assumption. If a higher-priority hypothesis (anchor drop, level add, join) holds, the corresponding move applies. Otherwise the ring completion hypothesis holds and that move applies.

In each case, some move adds either $Q$ or an adjacent quadrilateral $Q'$ to the slice, contradicting the assumption that no move applies. Hence as long as $S_n \subsetneq G'$, some move applies and $S_{n+1}$ is well-defined.

Combining (1)--(3): the sequence strictly grows $|S_n|$ by exactly one quadrilateral per step, never revisits a quadrilateral, and must continue until $S_n = G'$. The total number of steps is therefore exactly $N$.
\end{proof}

\begin{remark}
Two delicate sub-arguments in the proof of (2) and (3) deserve attention: (a) in (2.2) and (2.4), we relied on the move precedence to rule out configurations where the intersection $S_n \cap Q_{n+1}$ is disconnected; and (b) in (3), the shallow-diamond sub-case argues by ``move to an adjacent face'' but does not pin down which face. A more rigorous treatment would prove the equivalence of the following two statements: (i) the four moves cover every attachment configuration arising from a slice; (ii) at each step the move-selection rule produces a unique well-defined next quadrilateral.
\end{remark}

% TODO: state and prove a uniqueness result that the sequence
% $Q_1, \ldots, Q_N$ is completely determined by the choice of $Q_1$ and the
% plane embedding.

\begin{thebibliography}{9}

\bibitem{baker1994}
B.~S.~Baker,
\emph{Approximation algorithms for {NP}-complete problems on planar graphs},
Journal of the ACM, vol.~41, no.~1, pp.~153--180, 1994.

\end{thebibliography}

\end{document}

%-----------------------------------------------------------------------
% End of amsart-template.tex
%-----------------------------------------------------------------------
