Morphing Triangle Contact Representations of Triangulations

A morph is a continuous transformation between two representations of a graph. We consider the problem of morphing between contact representations of a plane graph. In an F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {F}}$$\end{document}-contact representation of a plane graph G, vertices are realized by internally disjoint elements from a family F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {F}}$$\end{document} of connected geometric objects. Two such elements touch if and only if their corresponding vertices are adjacent. These touchings also induce the same embedding as in G. In a morph between two F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {F}}$$\end{document}-contact representations we insist that at each time step (continuously throughout the morph) we have an F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {F}}$$\end{document}-contact representation. We focus on the case when F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {F}$$\end{document} is the family of triangles in R2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {R}^2$$\end{document} that are the lower-right half of axis-parallel rectangles. Such RT-representations exist for every plane graph and right triangles are one of the simplest families of shapes supporting this property. Moreover, they naturally correspond to 3-orientations. Thus, they provide a natural case to study regarding morphs of contact representations of plane graphs. We characterize the pairs of RT-representations admitting a morph between each other via the respective 3-orientations. Our characterization leads to a polynomial-time algorithm to decide whether there is a morph between two RT-representations of an n-vertex plane triangulation, and, if so, computes a morph with O(n2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(n^2)$$\end{document} steps. Each of these steps is a linear morph moving the endpoints of each triangle at constant speed along straight-line trajectories. Our characterization also implies that for 4-connected plane triangulations there is a morph between every pair of RT-representations where the “top-most” triangle in both representations corresponds to the same vertex.


Introduction
We consider the morphing problem from the perspective of geometric representations of graphs.While a lot of work has been done to understand how to planarly morph the standard node-link diagrams and to "rigidly" morph1 configurations of geometric objects, comparatively little has been explicitly done regarding (non-rigid) morphing of alternative representations of planar graphs, e.g., contact systems of geometric objects such as disks or triangles.In this case, the planarity constraint translates into the requirement of continuously maintaining a representation of the appropriate type throughout the morph.
More formally, let F be a family of geometric objects homeomorphic to a disk.An F-contact representation of a plane graph G maps vertices to internally disjoint elements of F, where we assume that a plane graph has a fixed set of faces and a fixed outer face (see, e.g., Fig. 1).We denote the geometric object representing a vertex v by (v).Objects (v) and (w) touch if and only if {v, w} is an edge.The contact system of the objects must induce the same faces and outer face as in G.
A morph between two F-contact representations R 0 and R 1 of a plane graph G is a continuously changing family of F-contact representations R t of G indexed by time t ∈ [0, 1] which means in particular that the boundary points of the geometric objects move along continuous trajectories from their starting to their ending position.An implication of the existence of morphs between any two representations of the same type is that the topological space defined by such representations is connected.We are interested in elementary morphs, and in particular in linear morphs, where the boundary points of the geometric objects move at constant speed along straight-line trajectories from their starting to their ending position.A piecewise linear morph of length between two F-contact representations R 0 and R of a plane graph G is a sequence R 0 , . . ., R of F-contact representations of G such that there is a linear morph between R i and R i+1 for i = 0, . . ., − 1.For a background on the mathematical aspects of morphing, see, e.g., [3].

Morphs of Node-Link Diagrams
A node-link diagram is a drawing of a graph in the plane where each vertex is represented as a point and each edge as a Jordan arc connecting its end vertices.In a plane node-link diagram of a plane graph edges do not cross and both the set of faces and the outer face are maintained.Fáry's theorem tells us that every plane graph has a plane node-link diagram where the edges are mapped to line segments.Of course, for a given plane graph G, there can be many such node-link diagrams of G, and the goal of the work in planar morphing is to study how (efficiently) one can create a smooth (animated) transition from one such node-link diagram to another while maintaining planarity.Already in the 1940's Cairns [19] proved that, for plane triangulations, planar morphs exist between any pair of plane node-link diagrams.However, the construction involved exponentially-many morphing steps.Floater and Gotsman [33], and Gotsman and Surazhsky [39,50] gave a different approach via Tutte's graph drawing algorithm [53], but this involves non-linear trajectories of unbounded complexity.Thomassen [51] and Aronov et al. [11] independently showed that two plane node-link diagrams of the same plane graph have a compatible triangulation2 thereby lifting Cairns' result to plane graphs.Of particular interest is the study of linear morphs, where each vertex moves at a uniform speed along a straight-line.After several intermediate results to improve the complexity of the morphs [2,7] and to remove the necessity of computing compatible triangulations [9], an algorithm to construct a planar morph between any pair of plane node-link diagrams of any n-vertex plane graph using (n) linear steps was presented [1].Such a morph can be computed in O(n 2 log n) time [41].For triconnected planar graphs, a different approach to obtain a linear number of linear morphs was recently presented by Erickson and Lin [28].Planar morphs of other specialized plane node-link diagrams have also been considered, e.g., planar orthogonal drawings [15,36,37], convex drawings [8,28,40,41], upward planar drawings [25], small-area drawings of trees [13], and so-called Schnyder drawings [14].In this latter result the lattice structure of all Schnyder woods of a plane triangulation [17,29] is exploited in order to obtain a sequence of linear morphs within a grid of quadratic size.Finally, planar morphs on the surface of the sphere [42] or the torus [20,28] and in three dimensions have been investigated [12].Beyond planarity, morphs have been recently considered for subclasses of 1-planar graphs [6].

Morphs of Contact Representations
Similar to Fáry's theorem, the well-known Koebe-Andreev-Thurston theorem [4,44] states that every plane graph G has a coin representation, i.e., an F-contact representation where F is the set of all disks.Additionally, for the case of triangulated plane graphs, such coin representations of G are unique up to Möbius transformations [18]-see [31] for a modern treatment.There has been a lot of work on how to intuitively understand and animate such transformations (see, e.g., the work of Arnold and Rogness [10]), i.e., for our context, how to morph between two coin representations.Of course, ambiguity remains regarding how to formalize the complexity of such morphs.In particular, this connection to Möbius transformations appears to indicate that a theory of piecewise linear morphing for coin representations would be quite limited.
For this reason, we instead focus on contact representations of convex polygons.These shapes still allow for representing all plane triangulations, as a direct consequence of the Koebe-Andreev-Thurston theorem, but are more amenable to piecewise linear morphs, where the linearity is defined on the trajectories of the corners; see, for example, the morph depicted in Fig. 2. De Fraysseix et al. [35] showed that every plane graph G has a contact representation by triangles, and observed that these trianglecontact representations correspond to the 3-orientations (i.e., the Schnyder woods) of G. Schrenzenmaier [49] used Schnyder woods to show that each 4-connected triangulation has a contact representation with homothetic triangles.Gonçalves et al. [38] extended the triangle-contact results from triangulations [35] to 3-connected plane graphs, by showing that Felsner's generalized Schnyder woods [29] correspond to primal-dual triangle-contact representations.Note that triangles and coins are not the only families of shapes that have been studied from the perspective of contact representations.Some further examples include boxes in R 3 [22,30,52], line segments [34,43], and homothetic polygons [24,32,48].Recently, the problem of morphing restricted contact representations of axis-parallel rectangles, more precisely so called rectangular duals, has been considered [21].
The construction of triangle-contact representations [35] (and the correspondence to 3-orientations) can be adjusted so that each triangle is the lower-right half of an axis-parallel rectangle.These right-triangle representations (RT-representations) are our focus; see Fig. 1.

Our Contribution and Outline
We characterize the pairs of RT-representations of the same plane graph G that admit a morph.This characterization is based on the relationship between (degenerate) RTrepresentations and the Schnyder woods of G, and involves the existence of a special path in the distributive lattice of the Schnyder woods of G.More precisely, we prove that a morph between two RT-representations exists if and only if the corresponding Schnyder woods can be obtained from each other by reversing oriented inner faces of the triangulation only.The characterization leads to an efficient decision algorithm to test for the existence of a morph.Furthermore, in the positive case, the algorithm constructs a piecewise linear morph of quadratic length.This implies that, although elementary, piecewise linear morphs are as "powerful" as general morphs.
The paper is organized as follows.We start with some definitions in Sect. 2 and describe the relationship between (degenerate) RT-representations and Schnyder woods of plane triangulations in Sect.3. In particular, we show that any morph between two RT-representations can be associated with a special sequence of Schnyder woods (Theorem 3.4).In Sect.4, we provide sufficient geometric conditions for a linear morph between two RT-representations.The first condition is that each corner c of a triangle touches the same side s of another triangle in the two representations.By the described relationship, this corresponds to the fact that the morph happens within the same Schnyder wood.The second condition ensures that the contact between c and s is maintained.This is fulfilled if s has the same slope in the two RT-representations or if the point of s hosting c is defined by the same convex combination of the end-points of s in both representations.In Sect.5, we present our morphing algorithm.If the two input RT-representations correspond to different Schnyder woods, we consider a path (if any) between them in the lattice structure of all Schnyder woods, similar to [14], that satisfies the necessary properties stated in Theorem 3.4.When moving along this path, from a Schnyder wood to another, we construct intermediate RT-representations that simultaneously correspond to both woods.We provide an algorithm to construct such intermediate RT-representations that results in a linear morph at each step.Finally, in Sect.6, we show how to decide whether there exists a path in the lattice structure that satisfies the required properties.This results in an efficient testing algorithm for the existence of a piecewise linear morph between two RT-representations of a plane triangulation; in the positive case, the computed piecewise linear morph has at most quadratic length.Consequently, for 4-connected plane triangulations, under a natural condition on the outer face of their RT-representations, the topological space defined by such RT-representations is connected.

Basics
Throughout this paper we consider simple graphs without loops and parallel edges.A plane triangulation is a maximal planar graph with a distinguished outer face.A directed acyclic graph (DAG) is an oriented graph with no directed cycles.A topologi- outer vertices Fig. 3 The two conditions for a Schnyder wood cal ordering of an n-vertex DAG G = (V , E) is a one-to-one map τ : V → {1, . . ., n} such that τ (v) < τ (w) for (v, w) ∈ E. Let p and q be two points in the plane.The line segment pq is the set {(1 − λ) p + λq : 0 ≤ λ ≤ 1} of convex combinations of p and q.Considering pq oriented from p to q, we say that x cuts pq with the ratio λ In the case of polygons, a linear morph is completely specified by the initial and final positions of the corners of each polygon.If a corner p is at position p 0 in the initial representation (at time t = 0) and at position p 1 in the final representation (at time t = 1), then its position at time t during a linear morph is (1 − t) p 0 + t p 1 for any 0 ≤ t ≤ 1.

Schnyder Woods
A 3-orientation [17,29] of a plane triangulation is an orientation of the inner edges such that each inner vertex has out-degree 3 and the three outer vertices have out-degree 0. A Schnyder wood T [47] of a plane triangulation G is a 3-orientation together with a partition of the inner edges into three color classes, such that the three outgoing edges of an inner vertex have distinct colors and all the incoming edges of an outer vertex have the same color.Moreover, the color assignment around the vertices must be as indicated in Fig. 3: The clockwise ordering of the colors of the three outgoing edges is the same for each inner vertex (say red, green, blue) and all incoming edges of a certain color are between the two outgoing edges of the other two colors (e.g. the red incoming edges, if any, are between the blue and the green outgoing edge).We say that a cycle in a Schnyder wood is oriented if it is a directed cycle.
The following well-known properties of Schnyder woods can directly be deduced from the work of Schnyder [47].We call the color classes red (r, ), blue (b, ), and green (g, ).The symbols X r , X b , and X g denote the red, blue, and green outer vertex of G, i.e., the outer vertices with incoming red, blue, and green edges, respectively.For an inner vertex v, let v r , v b , and v g be the respective neighbors of v such that (v, v r ) is red, (v, v b ) is blue, and (v, v g ) is green.Finally, let DAG r (T ) (DAG b (T )) be the directed acyclic graph obtained from G by orienting all red (blue) edges as in T while all blue (red) and green edges are reversed.
Let C be an oriented triangle of a Schnyder wood T .Reversing C yields another 3orientation with its unique Schnyder wood T C .If C is a facial cycle, i.e., the boundary of an internal face, then T differs from T C by recoloring the edges on C only.See Fig. 4 for an example.More precisely, the new outgoing edge of a vertex gets the color of the former outgoing edge of the same vertex.This procedure of reversing and recoloring is called flipping3 an oriented triangle of a Schnyder wood.Any Schnyder wood can be converted into any other Schnyder wood of the same plane triangulation by flipping O(n 2 ) oriented triangles [14,17].For two Schnyder woods T 0 and T , C 1 , . . ., C is a flip sequence between T 0 and T if there are Schnyder woods T 1 , . . ., T −1 such that C i , i = 1, . . ., , is an oriented triangle in T i−1 and T i is obtained from T i−1 by flipping C i .We say that a Schnyder wood T can be obtained from a Schnyder wood T by a sequence of facial flips if there is a flip sequence between T and T that contains only facial cycles.rectangle.We use (u), (u), and (u) to denote the horizontal, vertical, and diagonal side of (u).The topmost vertex of R is the vertex v of G for which the y-coordinate of (v) is maximum.Further, we let (u), (u), and (u) denote the left, right, and top corner of (u), respectively.If two triangles touch each other in their corners, we say that these two corners coincide.We call a face f = u, v, w degenerate if (u), (v), (w) pairwise coincide (in which case f corresponds to a single point), see Fig. 5(b).An RT-representation is degenerate if it contains a degenerate face; otherwise, it is non-degenerate.Let (c, s) be a pair with c ∈ { , , } and s ∈ { , , }, we say that (c, s) is a compatible pair if it belongs to the set {( , ), ( , ), ( , )}.Observe that, if a corner c of a triangle (u) touches the interior of a side s of a triangle (v), with (u, v) ∈ E(G), then (c, s) is a compatible pair.On the other hand, when two corners coincide, there exist four different pairs composed of a corner and a side, two of which are compatible.E.g., if (v) coincides with (u) for two vertices u and v, then the two compatible pairs are ( , ) and ( , )-even though (v) also touches (u) and (u) touches (v).
In the next two subsections, we describe the relationship between RT-representations and Schnyder woods [35] and extend it to the case of degenerate RT-representations.Along the way we will establish a condition on the existence of a morph between RT-representations and prove its necessity (Theorem 3.4).

From RT-Representations to Schnyder Woods
Let G = (V , E) be a plane triangulation with a given RT-representation R. It is possible to orient and color the edges of G in order to obtain a Schnyder wood by considering the types of contacts between triangles in R as follows.
First, consider the non-degenerate case; refer to Fig. 5(a).Let e = {u, v} ∈ E be an inner edge such that a corner c of (u) touches a side s of (v).We use the following rules: We orient e from u to v, and color e blue if c is (u), green if c is (u), red if c is (u).Observe that due to this convention the topmost vertex is X r .Lemma 3.1 [35,Thm. 2.2] The above assignment yields a Schnyder wood.
Assume now that there exist two triangles (u) and (v) whose corners coincide.Observe that the assignment of colors and directions to the edge {u, v} determined by the procedure above would be ambiguous.The next observation will be useful to resolve this ambiguity.

Observation 3.2 Consider an RT-representation of a plane triangulation and an edge
{u, v} that is not on the outer face.If a corner of the triangle (u) coincides with a corner of the triangle (v) in a point p, then {u, v} is incident to a degenerate face.
Proof Let f and f r be the two triangular faces to the left and the right of {u, v}, and let w and w r be the vertex incident to f and f r , respectively, that is different from u and v.Then, (w ) and (w r ) must both touch (u) and (v), and they must be on different sides of p, unless one of f and f r is the outer face.This implies that either (w ) or (w r ) has a corner on p.An immediate consequence of Observation 3.2 is that whenever three triangles intersect in a common point then they bound a degenerate face.Consider now a degenerate face f .For each of the three edges bounding f , a choice of coloring and orientation corresponds to deciding which of the two triangles participates to the touching with its corner and which triangle with an extremal point of one of its sides, which in turn corresponds to choosing one of the two compatible pairs determined by the touching.This yields two options as indicated in Fig. 5(b), both resulting in a Schnyder wood.Note that the face f is cyclic in both these Schnyder woods, and each of them can be obtained from the other by flipping f .Summarizing, we get the following.Observe that there is always a planar morph between two RT-representations of a graph with three vertices.See Fig. 10.This is in general no longer true for triangulations with separating triangles.

Theorem 3.4 (necessary condition)
If there is a (not necessarily piecewise linear) morph between two RT-representations of a plane triangulation G with more than three vertices, then the corresponding Schnyder woods can be obtained from each other by a sequence of facial flips.In particular the topmost vertex is the same in both representations.
Consider moments in time t 1 , . . ., t k defined as follows.Let t 1 = 0 and t k = 1.Given t i < 1, let t i+1 be maximum such that T R t i ∩T R t i+1 = ∅, where T R is the set of Schnyder woods corresponding to an RT-representation R as defined in Observation 3.3.Such a t i+1 > t i exists: First of all, observe that there exists a Schnyder wood T ∈ T R t i that also occurs at a later moment t, i.e., such that T ∈ T R t for some t > t i .More precisely, since morphs are continuous there is always an > t i such that T R t i ∩T R = ∅.Second, we show that such a maximum moment in time exists.Let T ∈ T R t i .The moments in time in which T occurs form closed intervals.The maxima of these intervals form an increasing sequence in a compact subset of the reals and, thus, converge to the supremum t T .Due to continuity there must exist an > 0 such that Then T i+1 and T i are both contained in T R t i+1 .Thus, by Observation 3.3, T i+1 can be obtained from T i by a sequence of edge-disjoint facial flips.Hence, any Schnyder wood of R 1 can be obtained from any Schnyder wood of R 0 by a sequence of facial flips.
The red outer vertex X r cannot be changed by facial flips.Thus, the topmost vertex remains the same throughout the morph.Intuitively, changing the topmost vertex would require collapsing the outer 3-cycle into a single point.
We will show that the necessary condition is also sufficient (Sect.5), and can be tested in quadratic time (Sect.6).

From Schnyder Woods to RT-Representations
Assume now that we are given a Schnyder wood T of a plane triangulation G = (V , E).We describe a technique for constructing an RT-representation of G corresponding to T in which the y-coordinate of the horizontal side of each triangle is prescribed by a function τ : V → R satisfying some constraints.We would like to mention that in the non-degenerate case in [35], the function τ assigning the y-coordinates is a topological ordering of DAG r (T ), also called a canonical ordering of G.
We call τ : V → R an Admissible Degenerate Topological labeling of the graph DAG r (T ), for short ADT-labeling, if for each directed edge (u, v) of DAG r (T ), we have -is green and belongs to a clockwise oriented facial cycle, or -is blue and belongs to a counter-clockwise oriented facial cycle, and see Fig. 7).

Lemma 3.5 Let R be an RT-representation of a plane triangulation G = (V , E), let T be a Schnyder wood corresponding to R, and let τ (v), v ∈ V , be the y-coordinate of (v). Then, τ is an ADT-labeling of DAG r (T ).
Proof Let (u, v) be a directed edge of DAG r (T ).By the definition of T , we get immediately that τ (u) ≤ τ (v) independently of whether (u, v) is red, green, or blue.In fact, if (u, v) is red, then it is oriented from u to v in T r .Thus, the compatible pair corresponding to such an edge in R is ( (u), (v)).Hence, (u) lies strictly below (v).If (u, v) is green (resp., blue), then it is oriented from v to u in T .Thus, the compatible pair corresponding to such an edge in R is ( (v), (u)) (resp., ( (v), (u))).Hence, (u) does not lie above (v).Assume that τ (u) = τ (v), which implies that (u, v) is not red, as observed above.Suppose that (v, u) is a green edge.Then, (v) and (u) coincide.By Observation 3.2, there exists a vertex z such that (z) coincides with (v) and (u).Thus, v, u, z is a clockwise oriented facial cycle.Similarly, when (v, u) is a blue edge, there is a vertex z such that (v), (u), and (z) coincide.Therefore, v, u, z is a counter-clockwise oriented facial cycle. Finally Lemma 3.6 Let T be a Schnyder wood of an n-vertex plane triangulation G, let τ be an ADT-labeling of DAG r (T ), and let R o = (X r ) ∪ (X g ) ∪ (X b ) be an RT-representation of the outer face of G such that (X i ) has y-coordinate τ (X i ), with i ∈ {r , g, b}.Then, there exists a unique RT-representation RT(T , τ, R o ) of G corresponding to T in which (v) has y-coordinate τ (v), for each vertex v of G, and in which the outer face is drawn as in R o .
Proof Let τ : V ↔ {1, 2, . . ., n} be a topological ordering of DAG r (T ).We process the vertices of G according to τ .By the construction of DAG r (T ), we have that Thus, in the first two steps and in the last step, we must draw triangles (X b ), (X g ), and (X r ) as in R o ; see Fig. 6(c).At each of the intermediate steps, we consider a vertex v, with τ (v) = i, 2 < i < n.Let R i−1 be the unique RT-representation of the subgraph G i−1 of G induced by the vertices preceding v in τ under the conditions required in the lemma.Since the ycoordinates of the horizontal sides of the triangles are determined by τ and since (v) must touch (v r ), we must draw (v) so that its horizontal side has y-coordinate τ (v) and its top corner has y-coordinate τ (v r ).It remains to assign the x-coordinates of (v) and (v).We are going to perform this assignment based on (v b ) and (v g ), which have already been drawn in R i−1 .Indeed, since the blue edge (v b , v) and the green edge Before describing the assignment of the x-coordinates of (v) and (v), we discuss some properties of R i−1 .First, by condition (i) of ADT-labeling, we have that τ (v b ) ≤ τ (v) and τ (v g ) ≤ τ (v), and thus the horizontal side of (v) will not lie below the ones of (v b ) and (v g ).Also, we assume that the following two invariants hold in R i−1 and we will show that they also hold in R i after drawing (v): (i) The y-coordinates of (v b ) and (v g ) are both greater than or equal to τ (v).
(ii) Let v 1 = X b , . . ., v q = X g be the path along the outer face of The two invariants imply in particular that the horizontal line y = τ (v) intersects both, (v b ) and (v g ), and that (v b ) is to the left of (v g ).Thus, (v) can only touch (v b ) and (v g ) if (v) and (v) are the intersection point of the line y = τ (v) with (v b ) and (v g ), respectively.This implies the uniqueness of the RT-representation, under the constraints imposed by the function τ and the given RT-representation R o of the outer face.We thus assign the x-coordinates of (v) and (v) accordingly, hence obtaining a representation R i .In the following, we prove that R i is actually an RT-representation of G i corresponding to the Schnyder wood T .
Since R i contains R i−1 , which is an RT-representation of G i−1 , we only need to consider the touchings between v and its neighbors in G i .Since vertices of G are processed according to a topological ordering τ of DAG r (T ), such neighbors of v are exactly v b , v g , and each vertex u such that u r = v.By construction, (v) and (v) touch (v b ) and (v g ), respectively.Next, we prove that (u) touches (v) for each vertex u such that u r = v.Namely, by construction, (u) has y-coordinate equal to τ (v), so it suffices to show that (u) is between (u r ) and (u r ).This is obvious if u r = X r .Otherwise, this directly follows from invariant (ii), since u appears between v b and v g on the X b -X g -path along the outer face of G i−1 .Thus, all corners touch the correct side of another triangle as required by the Schnyder wood T .
Then, we show that the horizontal side of (v) has positive length.This is clear if τ (v) is strictly greater than both τ (v g ) and τ (v b ).So assume first that τ (v b ) < τ(v) = τ (v g ).Then, by condition (ii) of ADT-labeling, there is a vertex u such that v, v g , u is a clockwise facial cycle.It follows that (u, v) is an incoming red edge of v in T and thus (u) lies between (v b ) and (v g ) on the horizontal line y = τ (v), as discussed above.Since the horizontal side of (u) has a positive length in R i−1 and since τ (v b ) < τ(v), the vertical side of (v b ) must be strictly to the left of (u), and thus strictly to the left of (v g ).The case τ (v b ) = τ (v) > τ (v g ) is analogous.Finally, we consider the case τ (v b ) = τ (v) = τ (v g ).By condition (iii) of ADT-labeling, there exist two distinct vertices u 1 and u 2 such that v, v g , u 1 is a clockwise facial cycle and v, v b , u 2 is a counter-clockwise facial cycle.Since the horizontal side of (u 1 ) and (u 2 ) have positive length in R i−1 , the right corner of (v b ) and the left corner of (v g ) cannot coincide.
This concludes the proof that R i is an RT-representation of G i .We conclude by showing that the two invariants are maintained in R i .
Invariant (i) is fulfilled: We show that the top corner of (v b ) has y-coordinate greater than or equal to τ (v).The arguments for (v g ) are analogous.If v b = X b , this follows from the fact that (X b ) has y-coordinate greater than or equal to τ (X r ) in R o .Otherwise, recall that the y-coordinate of (v b ) has been set equal to τ (r ), where r is the neighbor of v b such that edge (v b , r ) of DAG r (T ) is red.Let w 1 , . . ., w k (with w 1 = v and w k = r ) be the neighbors of v b such that edges (v b , w 1 ), . . ., (v b , w k ) appear in this counter-clockwise order around v b .See the figure to the right.Since (v b , w 1 ) is blue and entering v b in T , while (v b , w k ) is red and exiting v b in T , we have that each edge (v b , w i ), with 2 ≤ i ≤ k − 1, is blue and entering v b in T .It follows that the edge e = (w j , w j+1 ), for j = 1, . . ., k − 1 is the next edge incident to w j in clockwise direction after an outgoing blue edge.Thus, e is either red and exiting w j in T or green and entering w j in T .Hence, w 1 , . . ., w k form a directed path from v b to r in DAG r (T ), where red edges maintain their orientation while green edges are reversed.Hence, τ (r ) ≥ τ (v).Thus, (v b ) has y-coordinate larger than or equal to τ (v), as desired.Invariant (ii) is fulfilled: Let P i−1 : v 1 = X b , . . ., v q = X g be the path along the outer face of G i−1 .Since R i−1 satisfies invariant (ii), we have that (v 1 ), . . ., (v q ) have increasing x-coordinates in R i−1 .Let 1 ≤ < k ≤ q be such that v b = v j and v g = v k .Then, the path P i along the outer face of G i is obtained from P i−1 by replacing the sequence v j , . . ., v k by v j , v, v k .Since we place v between v j = v b and v k = v g , the invariant holds in R i .
As both invariants trivially hold in the given drawing of (X b ) and (X g ), the lemma follows.

Geometric Tools
In this section, we provide geometric lemmata that will be exploited in the subsequent sections.We first show that the incidence of a point and a line segment is maintained during a linear morph if the line segment is moved in parallel (with a possible stretch, but keeping the orientation) or the ratio with which the point cuts the segment is maintained; see Fig. 8. Lemma 4.1 For i = 0, 1 let p i , q i be two points in the plane and let x i ∈ p i q i .For 0 < t < 1, further let p t = (1 − t) p 0 + t p 1 and q t = (1 − t)q 0 + tq 1 .Then, (a) segments collinear x t (c) cut ratio maintained Fig. 8 Morphing a segment and a point -p 0 q 0 and p 1 q 1 are parallel with the same direction, or -x 0 cuts p 0 q 0 with the same ratio as x 1 cuts p 1 q 1 .Moreover, in both cases, if x t = p t for some t ∈ [0, 1] then x 0 = p 0 and x 1 = p 1 .
Proof Assume first that p 0 q 0 and p 1 q 1 are parallel.If p 0 q 0 and p 1 q 1 are collinear, we may assume that they are both contained in the x-axis, that p i , q i , i = 0, 1, are real numbers, and that p 0 < q 0 .Since p 0 q 0 and p 1 q 1 have the same direction, this implies that p 1 < q 1 .Since x i , i = 0, 1, is a point in p i q i , it follows that p i ≤ x i ≤ q i .Hence, we get for t ∈ [0, 1] that , where equality holds if and only if x 0 = p 0 and p 1 = x 1 , or x 0 = q 0 and x 1 = q 1 , respectively.
If p 0 q 0 and p 1 q 1 are parallel with the same direction but not collinear, then the polygon p 0 , q 0 , q 1 , p 1 is convex.Thus, x 0 x 1 must intersect p t q t , for any t.Also, p t q t and x t both lie on the same line t .More precisely, let d be the distance between the lines through segments p 0 q 0 and p 1 q 1 .Then, t is the line with distance td from p 0 q 0 .Moreover, due to the convexity of p 0 , q 0 , q 1 , p 1 , we have that x t = p t implies x 0 = p 0 and x 1 = p 1 .
Finally, if x 0 cuts p 0 q 0 with the same ratio λ as x 1 cuts p 1 q 1 , then it follows that Moreover, x t = p t if and only if λ = 0, and, thus, x 0 = p 0 and x 1 = p 1 .Lemma 4.1 implies the following sufficient criterion for a linear morph.For an illustration of the special shape assumed for the outer face in the following lemma see, e.g., Fig. 2. Lemma 4.2 Let R 0 and R 1 be two RT-representations of a triangulation G corresponding to the same Schnyder wood such that the triangles of the outer face pairwise touch in their corners.The pair R 0 , R 1 defines a linear morph if, for any two adjacent vertices u and v such that a corner c i (v), i ∈ {0, 1}, of v touches a side s i (u) of u, where c ∈ { , , } and s ∈ { , , }, one of the following holds: (i) s 0 (u) and s 1 (u) are parallel.z Fig. 9 The three quadrants containing triangles on a red, green, or blue path to z (ii) c 0 (v) cuts s 0 (u) with the same ratio as c 1 (v) cuts s 1 (u).
Proof Let R t be the representation at time instant t of the linear morph from R 0 to R 1 , with t ∈ [0, 1], i.e., the set of triangles obtained by interpolating the corners of each triangle in R 0 to R 1 .It suffices to show that R t is an RT-representation of G.
We start by proving that, for every vertex u of G, the triangle t (u) representing u in R t is the lower-right half of an axis-parallel rectangle with positive area.Consider the triangles 0 (u) and 1 (u) representing u in R 0 and R 1 , respectively.Since 1 (u) and 2 (u) are vertical segments with i (u) lying above i (u), with i = 0, 1, we have that t (u) is a vertical segment with t (u) lying above t (u).A similar argument applies to prove that t (u) is a horizontal segment with t (u) lying to the left of t (u).Since all these segments have positive length, the claim follows.Next, we prove that R t is an RT-representation of G, i.e., we show that any two triangles touch in R t if and only if the corresponding vertices of G are adjacent, and that no two triangles share more than one point.
First, consider two vertices u and w that are adjacent in G.We show that t (u) and t (w) touch in exactly one point.Let c 0 (u) with c ∈ { , , } and s 0 (w) with s ∈ { , , } be the corner of 0 (u) and the side of 0 (w), respectively, that touch in R 0 .Since R 0 and R 1 correspond to the same Schnyder wood, and since the triangles of the outer face pairwise touch in their corners, we have that the corner c 1 (u) of 1 (u) touches the side s 1 (w) of 1 (w) in R 1 .This, together with Lemma 4.1, implies that the corner c t (u) of t (u) touches the side s t (w) of t (w) in R t .The fact that no other points are shared between t (u) and t (w) derives from the possible corner-side pairs (c, s) that may appear in an RT-representation.This also implies that R t induces the same Schnyder wood as R 0 and R 1 .
Second, consider two vertices u and w that are not adjacent in G.We show that t (u) and t (w) do not share any point in R t .We are going to exploit the following property of a Schnyder wood T of G [5,27,46]: Let T r , T g , T b , respectively, be the subtree of T induced by the red, green, and blue edges, respectively.There exists a vertex z, possibly z = w, such that T i contains a path P u,z from u to z and T j contains a path P w,z from w to z, for some i = j ∈ {r , g, b}.We will show that t (u) and t (w) are in different quadrants of t (z).See Fig. 9 for an illustration.Consider a path P to z such that every edge has the same color.Then any cornerside pair determined by any edge in P is of the same type, more precisely, of type ( , ) if P is green, of type ( , ) if P is blue, and of type ( , ) if P is red.Let a be a vertex.If there is a green a-z-path then t (a) is in the upper left quadrant of t (z), including the boundary above t (z) or to the left of t (z).If there is a blue a-z-path then t (a) is in the upper right quadrant of t (z), including the boundary between t (z) and t (z).Finally, if there is a red a-z-path then t (a) is in the lower-left quadrant of t (z), including the boundary between t (z) and t (z).The only three points where triangles of these three regions could intersect are the three corners of t (z).Assume that a corner of t (u) and a corner of t (w) coincide with the same corner of t (z).But then the last statement of Lemma 4.1 would imply that the same corners would also coincide in R 0 and R 1 -contradicting that u and w were not adjacent.

A Morphing Algorithm
In this section, we prove that the necessary conditions in Theorem 3.4 are also sufficient and show how to construct a piecewise linear morph if the conditions are fulfilled.Since there is always a piecewise linear morph between two RT-representations of a plane triangle (see Fig. 10), we will assume that G has at least four vertices.The fact that T 1 can be obtained from T 2 by a sequence of facial flips implies in particular that the topmost vertex, which always coincides with X r , is the same in R 1 and R 2 .
In Sect.5.1, we introduce our main procedure adjust, which moves a triangle in an RT-representation along an incident diagonal and adjusts the remaining triangles so that the result is a linear morph.Repeatedly applying adjust, we first morph R 1 to a nondegenerate RT-representation that still corresponds to T 1 (Sect.5.3); then, we perform a sequence of linear morphs to geometrically realize the facial flips (Sect.5.2), hence obtaining an RT-representation corresponding to T 2 , which we finally morph to R 2 (Sect.5.3).See Fig. 11 for an illustration.

Moving a Triangle Along a Diagonal
Let G = (V , E) be a plane triangulation and let R be an RT-representation of G corresponding to a Schnyder wood T of G. Given an inner vertex σ of G and a real value y with some properties, adjust computes a new RT-representation R of G τ Fig. 12 Moving (σ ) down along (σ g ).The gray triangles are not changed at all, the y-coordinates τ of the bases of the light green triangles is adjusted such that the ratio with which the incident diagonal is cut is maintained.The y-coordinates of the bases of the light blue and light red triangles do not change-however their height (light blue) or width (light red) changes corresponding to T in which (σ ) has y-coordinate y and (σ g ) remains unchanged, such that R, R is a linear morph.
To achieve this goal, the y-coordinate of (v), for some vertex v = σ , may also change; however, the ratio with which (v) cuts (v g ) does not change, thus satisfying (ii) of Lemma 4.2.See Fig. 12 for an illustration.The y-coordinates of the horizontal sides are encoded by a new ADT-labeling τ of G, and R is the unique RT-representation RT(T , τ, R o ) of G that is obtained by applying Lemma 3.6 with input G, T , τ , and the representation R o of the outer face of G in R.
Further, for a vertex v, we consider the ratio λ(v) with which (v) cuts the incident diagonal side, i.e., λ(v) = (τ (v) − τ (v g ))/(top(v g ) − τ (v g )), if either v is an inner vertex or v ∈ {X b , X r }, (v) is on (X g ), and v g := X g .
For the vertex σ and the y-coordinate y that are part of the input of adjust, we assume that moving σ to y respects the order along (σ g ).This allows to set τ (σ ) ← y without changing the contact point between (v) and (σ g ) for any other vertex v such that v g = σ g .On the other hand, setting τ (σ ) ← y may have other implications on the neighbors of σ , as follows: Type 1.For every vertex v such that σ = v g , the value of τ (v) has to be modified to ensure that the ratio λ(v) with which (v) cuts (σ ) is maintained; Type 2. for every vertex u such that σ = u r , we have to set top(u) = y to maintain the contact between (u) and (σ ).
Let v and u be two vertices that have been modified according to Types 1 and 2, respectively.Since these modifications may change the diagonal side of (v) and (u), they may trigger analogous implications for the neighbors of v and u.Observe that, since the y-coordinate of (u) is not changed, only a Type 1 implication may be triggered for the neighbors of u.Further, the two implications correspond to following either a red or a green edge, respectively, in reverse direction with respect to the one in T .Hence, the vertices whose triangles may need to be adjusted are those that can be reached from the vertex σ by a reversed directed path in T using only red and green edges, but no two consecutive red edges; see Fig. 13.Note that, since the green and the red edges have opposite orientation in T and in DAG b (T ), which is acyclic, this implies that adjust terminates.
The procedure adjust (see Algortihm 1 for its pseudo-code and Fig. 12 for an illustration) first finds all the triangles that may need to be adjusted, by performing a simple graph search from σ following the above described paths of red and green edges.In a second pass, it performs the adjustment of each triangle (w), by modifying τ (w) so that λ(w) is maintained for w = σ .We ensure that the new value of τ (w) is computed only after the triangle (w g ) has already been adjusted.

Lemma 5.2 Let R 1 be an RT-representation of a plane triangulation G = (V , E) corresponding to the Schnyder wood T and let the y-coordinate of
Let σ ∈ V be an inner vertex and let y ∈ R be such that moving σ to y respects the order along (σ g ).Let τ 2 be the output of adjust(τ 1 , T , σ, y).The following conditions hold.

an ADT-labeling of DAG r (T ).
Algorithm 1: Pseudo-code of procedure adjust Input : RT-representation R of a plane triangulation G = (V , E) with (v) on τ (v), v ∈ V , and Schnyder wood T .A vertex σ ∈ V , a real number y ∈ R such that moving σ to y respects the order along (σ g ).Output: ADT-labeling τ of DAG r (T ) with (i) τ (σ ) = y, (ii) the ratio λ(v) is maintained for any vertex v = σ , and (iii) the triangle (σ g ) is the same in R and RT(T , τ, R o ), where R o is the representation of the outer face in R. Data: Stack S; Boolean v.red, v.green, for each v ∈ V initialized to false, describing whether v was found by traversing a red edge, or a green edge, or both (true in the first round and false in the second).
adjust(y-coordinates τ , Schnyder wood T , vertex σ , real y)  (iv) The morph between R 1 and R Proof The fact that τ 2 (σ ) = y and that λ(v) is maintained for any vertex v = σ follows by construction.This establishes conditions (i) and (ii).To prove that τ 2 is an ADT-labeling, condition (iii), we first determine a cycle C bounding a subgraph of G containing all the vertices whose τ might be modified by procedure adjust (see Fig. 13).We then prove condition (iii) by induction on a suitable ordering of the edges in DAG r (T ).We finally exploit Lemma 4.2 to establish that R 1 , R 2 is a linear morph, i.e., condition (iv).
A cycle C enclosing all vertices where τ might change.Let u be the neighbor of σ following σ g in clockwise order around σ .Observe that either σ = u r or u = σ b .Consider the blue u-X b -path p b and the red σ -X r -path p r of G (see Fig. 13).Let C be g X b p b X r p r X g un ch an ge d u τ Fig. 13 Let u be the neighbor of σ following σ g in clockwise order.Then, the cycle C composed of the blue u-X b -path p b , the edge {u,σ }, the red σ -X r -path p r , and the edge {X r , X b } encloses all vertices for which τ is changed.Vertex σ is the only vertex on C for which τ is changed the cycle composed by X b , p b , u, σ, p r , X r .Let v = σ be a vertex such that τ 2 (v) = τ 1 (v).We claim that v lies in the interior of C .In fact, adjust sets τ 2 (v) = τ 1 (v) only if there exists in DAG b (T ) a directed red-green-path p with no two consecutive red edges starting at σ and ending with a green edge at v.This is due to the fact that, when processing a vertex w, procedure adjust might choose to process a neighbor v of w only if T contains the green edge (v, w) and then it might choose to process a neighbor u of v only if T contains the red edge (u, v).Recall that green and red edges have opposite orientation in T and DAG b (T ).
Note that p starts at σ , which lies along C and, after possibly reaching u via a red edge, it necessarily enters the interior of C via a green edge.In the following steps p can reach again a vertex z of C ; however this can only happen if z belongs to p b and it is reached via a red edge.This implies that the next edge of p is green and hence p enters again the interior of C .Thus, v lies in the interior of C .τ 2 is an ADT-labeling.If y = τ 1 (σ ) then τ 1 = τ 2 is an ADT-labeling.Otherwise, distinguishing the cases y < τ 1 (σ ) and y > τ 1 (σ ) we will prove by induction on a suitable ordering of the edges in DAG r (T ) the following property.
Property DTL: τ 2 (v) ≤ τ 2 (w) for any edge (v, w) of DAG r (T ) where equality may only hold if This immediately establishes condition (i) of ADT-labeling for τ 2 .In order to prove (ii), let e = (v, w) be an edge of DAG r (T ) with τ 2 (v) = τ 2 (w).We have to show that the edge between v and w in the Schnyder wood T is green and belongs to a clockwise oriented facial cycle, or blue and belongs to a counter-clockwise oriented facial cycle.If τ 1 (v) = τ 1 (w), this follows immediately from the fact that τ 1 is an ADT-labeling of DAG r (T ).Otherwise, conditions (ii) and (iii) of Property DTL immediately guarantee the right color of the edge and the right direction of the facial cycle.Recall that green and blue edges have different directions in T and in DAG r (T ).Finally, we have to prove that condition (iii) of an ADT-labeling is fulfilled.To this end, consider a vertex w with τ 2 (w b ) = τ 2 (w) = τ 2 (w g ) and let u 1 and u 2 be two vertices such that w, w g , u 1 is a clockwise facial cycle and w, w b , u 2 is a counterclockwise facial cycle.We have to show that u 1 = u 2 .If neither (ii) nor (iii) of Property DTL holds for the edges (w b , w) and (w g , w) of DAG r (T ), i.e., if neither w = σ nor w b = σ , then condition (i) of Property DTL implies τ 1 (w b ) = τ 1 (w) = τ 1 (w g ).Since τ 1 is an ADT-labeling, it follows that u 1 = u 2 .So assume that σ ∈ {w, w b }.We distinguish the last two cases of Property DTL (see Fig. 14).
Assume first that σ = w (condition (ii) of Property DTL) and the clockwise facial cycle incident to (w, w g ) in T is w, w g , u 2 = σ, σ g , u 2 for some vertex u 2 .This implies that (σ g , u 2 ) is blue, (u 2 , σ ) is red, and Assume now that σ = w b (condition (iii) of Property DTL) and that w, σ, σ g = w, w b , σ g is the counter-clockwise oriented facial cycle in T incident to the edge (w, w b ), i.e., u 1 = σ g .In this case w and w g are outside the cycle C and, thus, It remains to show Property DTL.In order to do so, we will use induction.Observe that for some already considered edge e = (v, w) of DAG r (T ) the inductive hypothesis implies in particular that τ 1 (v) = τ 1 (w) if τ 2 (v) = τ 2 (w) unless w = σ and e is green, or v = σ and e is blue.This implies in particular that τ 2 (v) < τ 2 (w) if e is red.
Case y < τ 1 (σ ): Note that, in this case, procedure adjust does not increase τ for any vertex, that is, τ 2 (v) ≤ τ 1 (v) for every vertex v.We use induction on the following lexicographical ordering of the edges of DAG r (T ): Consider any ordering ≺ extending the partial order given by DAG r (T ).An edge (v 1 , w 1 ) is considered before an edge (v 2 , w 2 ) if w 1 ≺ w 2 , or w 1 = w 2 =: w and v 1 comes before v 2 in the clockwise order around w starting from (w g , w).Let (v, w) be an edge of DAG r (T ).Since τ 1 is an ADT-labeling of DAG r (T ), it follows that τ 1 (v) ≤ τ 1 (w).Moreover, τ did not increase for any vertex.Thus, if τ (w) does not change then 4 for any descendant v of w.This is especially true if w is the first vertex with incoming edges with respect to ≺, i.e., the first vertex after X b and X g .Let now (v, w) be an edge of DAG r (T ) such that τ (w) changes.Assume first that (v, w) is a green edge, i.e., v = w g .There are two cases.Either w = σ , and where equality is only allowed if (σ ) is the bottommost corner on (σ g ), and (σ g ) and (σ ) are not both on the vertical side of the same triangle, i.e., if σ, σ g , v b is an oriented face in T ).Or τ (w) is changed according to the ratio on (v) and, thus, the relationship τ (v) ≤ τ (w) is maintained.Consider now the case that (v, w) is an incoming red edge of w or an outgoing (in T ) blue edge of w.Let v = v 0 , v 1 , . . ., v k = w g be the neighbors of w in counter-clockwise order from v to w g .Observe that (v i , w), i = 1, . . ., k − 1, (if any) are red.By induction, we have τ 2 (v i ) ≤ τ 2 (w), i = 1, . . ., k. Observe further that for any i = 1, . . ., k either (v i−1 , v i ) is a green edge or (v i , v i−1 ) is a blue edge.See Fig. 15.Assume first that k = 1, i.e., v 1 = w g .First observe that τ 2 (v) ≤ τ 2 (w g ) by induction, if (w g , v) is blue, and by construction, if (v, w g ) is green.If w = σ , then τ 2 (v) ≤ τ 1 (v) < y = τ 2 (σ ), since moving (w) to y must respect the order along w g = σ g and τ 1 (v) < τ 1 (w).If w = σ and (v, w g ) is green, then both τ (v) and τ (w) have been modified according to the ratio on (w g ).Hence, the relationship is blue, then we can apply the inductive hypothesis on both, (v, v 1 ) and the red edge (v 1 , w), and get τ 2 (v) ≤ τ 2 (v 1 ) < τ 2 (w).Finally, if k > 1 and (v, v 1 ) is green, then either σ = v or τ (v) was set according to the ratio on (v 1 ), which implies especially that τ Case y > τ 1 (σ ): Note that, in this case, procedure adjust does not decrease τ for any vertex, that is, τ 2 (v) ≥ τ 1 (v) for every vertex v.We use the following order for the induction.An edge (v 1 , w 1 ) is considered before an edge (v 2 , w 2 ) if v 2 ≺ v 1 , or v 1 = v 2 =: v and w 1 comes before w 2 in the counter-clockwise order around v starting from (v, v g ).Note that y < τ(X r ) and τ is always updated according to the ratio on the incident diagonal.Thus, by induction on the order in which the vertices are processed it follows immediately that τ 2 (v) < τ 2 (X r ) for all vertices v = X r .Hence, this is especially true if v is the last vertex according to ≺ before X r .Further, since τ did not decrease for any vertex, if (v, w) is an edge of DAG r (T ) and τ (v) was not changed, then we have τ 2 (v) = τ 1 (v) ≤ τ 1 (w) ≤ τ 2 (w).Assume now that w = X r and that τ (v) has changed.If (v, w) is a green edge in DAG r (T ), i.e., if v = w g then τ (w) is changed accordingly to the ratio on the diagonal of (v).Thus, the relationship τ (v) ≤ τ (w) is maintained.Consider now the case that (v, w) is an outgoing red edge of v or an incoming (in T ) blue edge of v. Let w = w 0 , w 1 , . . ., w k = v g be the neighbors of v in clockwise order from w to v g -where k = 1 is possible.Observe that (w i , v), i = 1, . . ., k − 1, (if any) are blue.See Fig. 16.Observe further that for any i = 1, . . ., k either (w i−1 , w i ) is a green edge or (w i , w i−1 ) is a red edge.If k = 1 and v = σ then τ 2 (v) = y ≤ τ 1 (w) ≤ τ 2 (w), where y = τ 1 (w) is only possible if (w, v) is blue and (v g , w) is red.We distinguish four more cases: (k = 1 and v = σ ) and k > 1 and for each of them whether the edge between w and w 1 is green or red.We start with k = 1: with equality if and only if τ 1 (v) = τ 1 ((v g ) r ).If (w, v g ) is green then w and v are both neighbors on (v g ) and the relationship τ (v) < τ (w) is maintained.Consider now k > 1: Since w i , i = 1, . . ., k − 1 is before w in the counterclockwise ordering around v after v g , we have by induction that τ 2 (v) ≤ τ 2 (w 1 ) with equality only if τ 1 (v) = τ 1 (w 1 ) or v = σ, v g , w 1 is a counter-clockwise cycle.If (w 1 , w) is red, we observe that v ≺ w 1 and we have again by induction that τ 2 (w 1 ) < τ 2 (w).If (w, w 1 ) is green then the relationship τ (w 1 ) ≤ τ (w) is maintained (even if w = σ , since τ does not decrease).It follows that τ Thus, in both cases, we have that Property DTL holds.This completes the proof that τ 2 is an ADT-labeling (condition (iii)).
2 (σ g ) = 1 (σ g ).Observe that all descendants of σ g in DAG r (T ) are on the blue path p b or in the exterior of the cycle C .Further, observe that the horizontal sides of the vertices in p b can be constructed without knowing anything about the interior of C .Thus (σ g ) does not change.Since (σ g ) r is also in the exterior of C or on C it follows that also the height of (σ g ) remains unchanged.Thus (σ g ) is not changed.R 1 , R 2 is a linear morph.Case (i) in Lemma 4.2 is always fulfilled if the side is vertical or horizontal.Thus it suffices to consider the diagonal sides.The only vertex v for which the ratio λ(v) changed was v = σ .However, since (σ g ) did not change it    follows that 1 (σ g ) and 2 (σ g ) are parallel.Thus, Lemma 4.2 implies that R 1 , R 2 is a linear morph.

A Flipping Algorithm
Recall that, given a Schnyder wood T and an oriented triangle C in T , the Schnyder wood T C is obtained from T by flipping C. In the following theorem we show how to realize this flip geometrically with two linear morphs in the case in which C is a facial cycle.
More precisely, let τ 1 be the y-coordinates of the horizontal sides in R 1 .We first compute τ 2 ← adjust(τ 1 , T , C g , τ 1 (C b )).If C is clockwise oriented, we then compute If C is counter-clockwise oriented, we proceed as follows.
In each case the new y-coordinates y for C g are chosen such that moving C g to y respects the order along the respective incident diagonal.Thus, adjust can be applied.Also, τ 2 is an ADT-labeling of both, DAG r (T ) and DAG r (T C ), and τ 3 is an ADT-labeling of DAG r (T Since τ 2 and τ 3 are produced by adjust, by Lemma 5.2, both R 1 , R 2 and R 2 , R 3 are linear morphs.

Morphing Representations with the Same Schnyder Wood
In this section, we consider RT-representations corresponding to the same Schnyder wood.
Theorem 5. 4 Let R 1 and R 2 be two RT-representations of an n-vertex plane triangulation corresponding to the same Schnyder wood T .Then, there is a piecewise linear morph between R 1 and R 2 of length at most 2n.
The idea is to first transform the outer face to a canonical form, and then to move one vertex v per step to a new y-coordinate y such that the ratio λ(v) is set to how it should be in R 2 .The order in which we process the vertices is such that adjust can be applied to the vertex v and the y-coordinate y.Recall that adjust does not alter the ratio λ, except for the currently processed vertex v.
Lemma 5.5 Let P = {p 1 < . . .< p n } and Q = {q 1 < . . .< q n } be two sets of n reals each.If P = Q then there is an i ∈ {1, . . ., n} such that p i = q i and P has no element between p i and q i .
Proof We prove the lemma by induction on n.There is nothing to show if n = 1.If n > 1 and P and Q only differ in the last element p n and q n then let i = n.Otherwise, we apply the inductive hypothesis to P \ {p n } and Q \ {q n } which yields p i = q i , i < n, such that no element of P \ {p n } is between p i and q i .If p n is not between p i and q i we are done.Otherwise we have . . .< p i < . . .< p n < . . .< q i < . . .< q n .Thus, p n = q n and no element of P can be between p n and q n .Corollary 5.6 Let P and Q each be a set of n points on a segment s.We can move P to Q in n steps by moving one point per step and by maintaining the ordering of the points on s.

Proof of Theorem 5.4 Let τ be a topological ordering of the inner vertices of DAG r (T ).
We extend τ to an ADT-labeling of DAG r (T ) by setting τ (X b ) = 0 = τ (X g ), and τ (X r ) = n − 2. With a sequence of at most n linear morphs we transform R i , i = 1, 2, into an RT-representation R = RT(T , τ , R o ), where R o has the following canonical form: , and each of (X r ) and (X b ) has length one.In the first morph, we cut the extruding parts of the outer triangles.In the second morph, we independently scale the x-and y-coordinates of the corners and translate the drawing, to fit the corners as indicated.In the third step, we adjust the lengths of (X r ) and (X b ).In the first morph the slope of no side is changed, in the second morph no ratio is changed, and in the third morph there are only four sides that are changed, which are not incident to any other triangle.Thus, by Lemma 4.2, the three morphs are linear.Let the resulting RT-representation be R i .
We now process the vertices in a reversed topological ordering on DAG b (T ).This will ensure that once a vertex has been processed, it will not be modified by adjust anymore; this is because the vertices modified by adjust are determined by the red and green edges, which are both reversed in DAG b (T ).We process a vertex w as follows.Let τ be the function describing the current y-coordinates of the horizontal sides.Let G(w) = {v ∈ V : w = v g } and let After processing all vertices w in a reversed topological ordering of DAG b (T ) and all vertices in G(w) in the order given above, we have obtained an RT-representation R in which any right corner cuts its incident diagonal with the same ratio as in R .Since the outer face is fixed, this implies that R = R .Observe that G(w), w ∈ V , is a partition of the set of inner vertices.Hence, we get at most one morphing step for each of the n − 3 inner vertices.This ends the proof.
Combining the results of Sects.5.1, 5.2, and 5.3 yields the main result of the section.
Proof of Theorem 5.1 First, we transform R 1 into a non-degenerate RT-representation R with Schnyder wood T 1 and a canonical form of the outer face in O(n) linear morphing steps, by Theorem 5.4.Then, we perform the facial flips.As described in Theorem 5.3, we can do so using two linear morphs for each flip.This yields an RT-representation R with Schnyder wood T 2 .Finally, we transform R into R 2 in O(n) linear morphing steps, by Theorem 5.4.This yields a total of O(n + ) linear morphs.Each linear morph can be computed by one application of adjust, which runs in linear time.

Finding a Sequence of Facial Flips
It follows from Theorems 3.4 and 5.1 that there is a piecewise linear morph between two RT-representations of a plane triangulation if and only if the respective Schnyder woods can be obtained from each other by flipping internal faces only.Note that this condition is always satisfied if the triangulation is 4-connected and the topmost vertex is the same in both RT-representations.On the other hand, if the graph contains separating triangles, we have to decide whether there is such a sequence of facial flips.We will show in Lemma 6.3 that this can be decided efficiently and that, in the positive case, there exists a sequence whose length is at most quadratic in the number of vertices.In the proof of Lemma 6.4, we then show how such a sequence of facial flips can also be computed in quadratic time.With the run time from Theorem 5.1, this establishes our final result.Theorem 6.1 Let R 1 and R 2 be two RT-representations of an n-vertex plane triangulation.We can decide in O(n 2 ) time whether there is a morph between R 1 and R 2 and, if so, a piecewise linear morph with O(n 2 ) linear morphing steps can be computed in O(n 3 ) time.

Corollary 6.2 There is a piecewise linear morph with O(n 2 ) linear morphing steps between two RT-representations of a 4-connected plane triangulation if and only if the topmost vertex is the same in both RT-representations.
Since there is a one-to-one correspondence between Schnyder woods of a plane triangulation and its 3-orientations, we will omit the colors in the following.A careful reading of Brehm [17] and Felsner [29] reveals the subsequent properties of 3orientations.The set of 3-orientations of a triangulation forms a distributive lattice with respect to the following ordering.T 1 ≤ T 2 if and only if T 1 can be obtained from T 2 by a sequence of flips on some counter-clockwise triangles.The minimum element is the unique 3-orientation without counter-clockwise cycles.Moreover, given a 3-orientation T and a triangle t, the number of occurrences of t in any flip-sequence between T and the minimum 3-orientation is the same-provided that the flip sequence contains only counter-clockwise triangles.Let this number be the potential π T (t).See Fig. 17 for an example.
Observe that π T is distinct for distinct T .Moreover, given a triangle t, the potential of the meet T 1 ∧ T 2 (i.e., the infimum) of two 3-orientations T 1 and T 2 is min(π T 1 (t), π T 2 (t)) while the potential of the join T 1 ∨ T 2 (i.e., the supremum) of T 1 and T 2 is max(π T 1 (t), π T 2 (t)).The potential π T can be computed in quadratic time for a fixed 3-orientation T of an n-vertex triangulation: At most O(n 2 ) flips have to be performed in order to reach the minimum 3-orientation.With a linear-time preprocessing, we can store all initial counter-clockwise triangles in a list.After each flip, the list can be updated in constant time.Lemma 6.3 Let T 1 and T 2 be two 3-orientations of an n-vertex triangulation.T 1 can be obtained from T 2 by a sequence of facial flips if and only if π T 1 (t) − π T 2 (t) = 0 for all separating triangles t.Moreover, if T 1 can be obtained from T 2 by a sequence of facial flips, then any sequence of counter-clockwise flips between T 1 and the meet T 1 ∧ T 2 followed by any sequence of clockwise flips to T 2 consists of O(n 2 ) facial flips.
Assume now that there is a sequence T 1 = T 0 , T 1 , . . ., T , T +1 = T 2 of 3orientations such that T i+1 , i = 0, . . ., , is obtained from T i by a (clockwise or counter-clockwise) facial flip.We show by induction on that π T 1 (t) − π T 2 (t) = 0 for all separating triangles t.If = 0, let t 0 be the triangle that has to be flipped in order to go from T 1 to T 2 .Then, t 0 is a face and π T 1 (t) − π T 2 (t) = 0 for t = t 0 .Assume now that ≥ 1.Let t be a separating triangle.Then While a sequence of counter-clockwise flips from a 3-orientation T 1 to the minimum of the lattice can always be found by iteratively flipping any counter-clockwise triangle, this is no longer true if we want to find a path from T 1 to the meet T 1 ∧ T 2 of two 3-orientations T 1 and T 2 .Here we have to follow the potential difference: Lemma 6.4 Let T 1 and T 2 be two 3-orientations of an n-vertex triangulation.If T 2 can be obtained from T 1 by a sequence of facial flips then such a sequence can be computed in O(n 2 ) time.
Proof We construct the sequence of facial flips as follows: Starting with T 1 we first find a sequence of flips down to the meet and then up again to T 2 .By the proof of Lemma 6.3, this sequence consists of facial flips only.Since π T 1 ∧T 2 (t) = min(π T 1 (t), π T 2 (t)) for all facial triangles and since distinct 3-orientations have distinct potentials, such a path can be found as follows.
Let T = T 1 .While π T (t) > π T 2 (t) for some counter-clockwise facial cycle t, pick such a cycle and flip it.Now T = T 1 ∧ T 2 .While π T (t) < π T 2 (t) for some clockwise facial cycle t, pick such a cycle and flip it.
At most O(n 2 ) flips have to be performed to reach the meet.In the first while-loop, we only store the counter-clockwise facial cycles with π T (t) > π T 2 (t) in a list and in the second while-loop the clockwise facial cycles with π T (t) < π T 2 (t).This list can still be updated in constant time after each flip.
Observe that there might be a piecewise linear morph between two RT-representations even though a separating triangle in the respective Schnyder woods is oriented in opposite directions.E.g., consider the 3-orientations II and III of the graph in Figs. 17 and 18.Moreover, there might be two RT-representations such that any separating triangle is oriented in the same way in the two respective Schnyder woods, however, there is no piecewise linear morph between the two representations.E.g., consider the 3-orientations III and I of the graph in Figs. 17 and 18, every path in the lattice between them passes through a 3-orientation in which the unique separating triangle is flipped.

Conclusions and Open Problems
In this paper, we initiated the study of morphs between contact representations of graphs.In particular, we have studied morphs between RT-representations of plane triangulations.We have shown that if such a morph exists, then there is a piecewise linear morph of length O(n 2 ).It would be interesting to explore lower bounds on the length of a piecewise linear morph.Observe that the worst-case minimum length of a flip sequence containing only facial cycles does not have to be a lower bound for the length of a piecewise linear morph, since some flips could be parallelized.Additionally, bounds on the resolution throughout our morphs would be worth investigating; however, it is unclear whether the "ratio fixing" we use in the procedure adjust would allow nice bounds.A major open direction is whether our results can be lifted to general plane graphs, e.g., through the use of compatible triangulations [11,51].Note that such compatible triangulations would need to be formed while preserving the conditions for the existence of a morph, i.e., without introducing the need to flip a separating triangle.
Finally, beyond the context of RT-representations, many other families of geometric objects could be considered.For example, morphing degenerate contact representations of line segments generalizes planar morphing, by treating contact points as vertices.

Fig. 1
Fig. 1 Two representations of the same plane graph G. a A node-link diagram of G and b a contact representation of G using right-angle triangles, i.e., an RT-representation

R 0 R 1 Fig. 2
Fig. 2 An illustration of a morph between two RT-representations R 0 and R 1 of the same plane triangulation.All the intermediate representations between any two consecutive RT-representations above are obtained by interpolating the corners of each triangle along linear trajectories (i) Every plane triangulation has a 3-orientation.(ii) For each 3-orientation of a plane triangulation there is exactly one partition of the inner edges into three color classes such that the pair yields a Schnyder wood.(iii) Each color class of a Schnyder wood induces a directed spanning tree rooted at an outer vertex.(iv) Reversing the edges of two color classes and maintaining the orientation of the third color class yields a directed acyclic graph.

Fig. 4 A
Fig. 4 A counter-clockwise flip of an oriented facial triangle C in a Schnyder wood

Fig. 5
Fig. 5 From an RT-representation to a Schnyder wood

Observation 3 . 3
Given an RT-representation R of a plane triangulation G, let P be the set of points where three triangles intersect.Then, R corresponds to a set T R of 2 |P| different Schnyder woods on G, the points of P correspond to |P| edge-disjoint oriented faces, and the Schnyder woods in T R differ in flipping some of them.
5(b) and 6(c)) the edge between u and v

Fig. 6 Fig. 7
Fig. 6 (a) A Schnyder wood T of a plane triangulation G; the edges connecting v with vertices v r , v g , and v b are dashed.(b) Graph DAG r (T ) with ADT-labeling τ .(c) An RT-representation of G constructed from T , τ , and an RT-representation R o of the outer face

Fig. 10
Fig.10 Morphing an RT-representation of a triangle to a labeled canonical form: First, cut the extruding parts of the triangles, maintaining the slopes of the diagonal sides.Then, scale the triangles such that the horizontal and vertical sides have length one.Finally, keep rotating the triangles until the topmost vertex is as desired

Theorem 5 . 1 (
sufficient condition) Let R 1 and R 2 be two RT-representations of an n-vertex plane triangulation G corresponding to the Schnyder woods T 1 and T 2 , respectively.If T 2 can be obtained from T 1 by a sequence of facial flips, then there exists a piecewise linear morph between R 1 and R 2 of length O(n + ).Such a morph can be computed in O(n(n + )) time, provided that the respective sequence of facial flips is given.

2 Fig. 11
Fig. 11 Construction pipeline: First, (b) we trim the outer face into a canonical form (three steps) and (c) make the inner faces non-degenerate (one step per face).Then, (d) + (e) we perform the facial flips on the faces indicated by striped triangles (two steps per flip).Finally, (f) we morph to the target RTrepresentation (linear number of steps)

Fig. 14 Fig. 15
Fig. 14 If the horizontal sides of the solid triangles are on one line in R 2 then the two dashed triangles closing a counter-clockwise facial cycle with (w, w b ) and a clockwise facial cycle with (w, w g ), respectively, are distinct.Situation drawn with respect to R 1 . . .τ(v)  τ (w1 ) by induction.

Theorem 5 . 3
Let R 1 be a non-degenerate RT-representation of a plane triangulation G corresponding to a Schnyder wood T .Let C be an oriented facial cycle in T .We can construct a sequence of two linearmorphs R 1 , R 2 , R 3 such that R 3is a non-degenerate RT-representation of G corresponding to a Schnyder wood T C .Proof For the oriented facial cycle C, let C r , C g , and C b be the vertices with outgoing red, green, and blue edge, respectively, in C. In order to flip C, we move C g along the respective incident diagonal sides as sketched in the following figure.

Fig. 17
Fig.17 The lattice of all 3-orientations of a graph.The whole graph is only drawn in the minimum 3orientation.The dashed edges are not repeated in the other drawings-they do not change their direction.Face labels indicate potentials.Observe that the inner solid face is actually a separating triangle (there are not-drawn dashed edges inside)