1 Introduction

Computing morphs between geometric objects is a fundamental problem that has been well studied, with many applications in graphics, animation, modeling, and more. A particularly well-studied setting is that of morphing between planar straight-line graphs. Formally, a morph between two isomorphic planar straight-line graphs \(\varGamma _0\) and \(\varGamma _1\) consists of a continuous family of planar straight-line graphs \(\varGamma _t\) starting at \(\varGamma _0\) and ending at \(\varGamma _1\).

We describe an extremely simple morphing algorithm for planar graphs, which simultaneously obtains properties of two earlier approaches: Floater and Gotsman’s barycentric interpolation method [24, 26, 43,44,45] results in morphs that are natural and visually appealing but are represented implicitly; variations on Cairns’ edge-collapse method [1, 7, 8, 31, 46] result in efficient explicit representations of morphs that are not useful for visualization. Our new algorithm efficiently computes an explicit piecewise-linear representation of a morph between drawings of the same 3-connected planar graph, that are potentially more useful for visualization than morphs based on Cairns’ method.

We also extend Floater and Gotsman’s planar morphing algorithm to geodesic graphs on the flat torus. Recent results of Luo et al. [37] imply that Floater and Gotsman’s method directly generalizes to morphs between geodesic triangulations on surfaces of negative curvature, but a direct generalization to the torus generically fails [42]. Our extension is based on simple scaling strategy, and it yields more natural morphs than previous algorithms based on edge collapses [9]. Finally, our arguments yield a straightforward proof of a conjecture of Connelly et al. [15] about the deformation space of geodesic triangulations.

1.1 Related Work

Planar Morphs. Cairns [7, 8] was the first to prove the existence of morphs between arbitrary isomorphic planar straight-line triangulations, using an inductive argument based on the idea of collapsing an edge from a low-degree vertex to one of its neighbors. Thomassen [46] extended Cairns’ proof to arbitrary planar straight-line graphs. Cairns and Thomassen’s proofs are constructive, but yield morphs consisting of an exponential number of steps.

Floater and Gotsman [24] proposed a more direct method to construct morphs between planar graphs, based on an extension by Floater [22] of Tutte’s classical spring embedding theorem [49]. Let \(\varGamma \) be a straight-line drawing of a planar graph G, such that the boundary of every face of \(\varGamma \) is a strictly convex polygon. Then every interior vertex in \(\varGamma \) is a strict convex combination of its neighbors; that is, we can associate a positive weight with each half-edge or dart in G, such that the vertex positions \(p_v\) in \(\varGamma \) satisfy the linear system

(1)

Floater [22] proved that given arbitraryFootnote 1 positive weights and an arbitrary convex outer face, solving linear system (1) yields a straight-line drawing of G with convex faces. Tutte’s original spring-embedding theorem [49] is the special case of this result where every dart has weight 1, but his proof extends verbatim to arbitrary symmetric weights, where for every edge uv [29, 41, 47].

Floater and Gotsman [24] construct a morph between two convex drawings of the same planar graph G, with the same outer face, by linearly interpolating between weights consistent with the initial and final drawings. Appropriate initial and final weights can be computed in O(n) time using, for example, Floater’s mean-value coordinates [23, 30]. The resulting morphs are natural and visually appealing. However, the motions of the vertices are only computed implicitly; vertex positions at any time can be computed in \(O(n^{\omega /2})\) time by solving a linear system via nested dissection [4, 34], where \(\omega < 2.37286\) is the matrix multiplication exponent [3, 33]. Gotsman and Surazhsky generalized Floater and Gotsman’s technique to arbitrary planar straight-line graphs [26, 43,44,45].

Alamdari et al. [1] describe an efficient algorithm to construct planar morphs with explicit piecewise-linear vertex trajectories, based on Cairns’ inductive edge-collapsing strategy. Given any two isomorphic straight-line drawings (with the same rotation system and nesting structure) of the same n-vertex planar graph, the algorithm constructs a morph consisting of O(n) unidirectional morphing steps, in which all vertices move along parallel lines at fixed speeds. Thus, each vertex moves along a piecewise-linear path of complexity O(n), and the entire morph has complexity \(O(n^2)\). Recent results of Klemz [32] imply that this algorithm can be implemented to run in \(O(n^2\log n)\) time. The resulting morph contracts all vertices into an exponentially small neighborhood and then expand them again, so it is not useful for visualization.

Angelini et al. [5] consider the setting of convexity-preserving morphs between convex drawings; Kleist et al. [31] consider morphing to convexify any 3-connected planar drawing. Both describe algorithms that produce piecewise-linear morphs consisting of O(n) steps, and that can be implemented to run in time \(O(n^{1+\omega /2})\). (Klemz [32] conjectures that both running times can be improved to \(O(n^2\log n)\).) Combining these algorithms results in an alternative piecewise-linear morph between 3-connected planar drawings.

Toroidal Morphs. Until recently, very little was known about morphing graphs on the torus or other more complex surfaces.

Tutte’s spring-embedding theorem was generalized to simple triangulations of surfaces with non-positive curvature by Colin de Verdière [14] and independently by Hass and Scott [27]. Delgado-Friedrichs [19], Lovász [35], and Gortler et al. [25] also independently proved an extension of Tutte’s theorem to graphs on the flat torus whose universal covers are simple and 3-connected. For any toroidal graph and any assignment of positive symmetric weights to the darts, solving a linear system similar to (1) yields vertex positions of a geodesic drawing with strictly convex faces [20, 25]; see Sect. 2 for details. Thus, if two isotopic geodesic torus graphs \(\varGamma _0\) and \(\varGamma _1\) can both be described by symmetric dart weights, linearly interpolating those weights yields a morph from \(\varGamma _0\) to \(\varGamma _1\) [13].

The restriction to symmetric weights is both nontrivial and significant. In a torus graph with convex faces, every vertex can be described as a convex combination of its neighbors, but not necessarily with symmetric weights. Moreover, the linear system expressing vertex positions as convex combinations of its neighbors is rank-deficient, and therefore is not solvable in general; see the full version [21] for an example. Thus, Floater’s asymmetric extension of Tutte’s theorem does not directly generalize to the flat torus.

For similar reasons, Floater and Gotsman’s planar morphing algorithm also does not generalize. Suppose we are given two isotopic geodesic torus graphs \(\varGamma _0\) and \(\varGamma _1\), each with dart weights that express their vertices as convex combinations of their neighbors. Unfortunately, in general, interpolating those weights yields linear systems that have no solution; we give a simple example in the full version [21].

Steiner and Fischer [42] modify the system by fixing a single vertex, restoring full rank. However, solving the modified system does not necessarily yield a crossing-free drawing, because the fixed vertex may not lie in the convex hull of its neighbors. Moreover, even though the initial and final weights are consistent with crossing-free drawings, averages of those weights may not be. We give an example of this bad behavior in the full version [21].

Chambers et al. [9] described the first algorithm to morph between arbitrary essentially 3-connected geodesic torus graphs. Their algorithm uses a combination of Cairns’ edge-collapsing strategy and spring embeddings to construct a morph consisting of O(n) unidirectional morphing steps, in \(O(n^{1+\omega /2})\) time. Like planar morphs built from edge collapses, these toroidal morphs contract vertices into small neighborhoods and thus are not suitable for visualization.

Recently, Luo et al. [37] generalized Floater’s theorem to geodesic triangulations of arbitrary closed Riemannian 2-manifolds with strictly negative curvature, extending the spring-embedding theorems of Colin de Verdière [14] and Hass and Scott [27] to asymmetric weights. Their result immediately implies that if two geodesic triangulations of such a surface are homotopic, then linearly interpolating the dart weights yields a continuous family of crossing-free geodesic drawings, or in other words, a morph. Their result applies only to surfaces with negative Euler characteristic; the torus has Euler characteristic 0.

1.2 New Results

We describe two applications of Floater and Gotsman’s barycentric interpolation strategy, which yield simpler algorithms for morphing planar and toroidal graphs.

First we describe a very simple algorithm to construct piecewise-linear morphs between planar straight-line graphs. Given two isomorphic planar straight-line graphs \(\varGamma _0\) and \(\varGamma _1\) with strictly convex faces and the same outer face, we construct a morph from \(\varGamma _0\) to \(\varGamma _1\) that consists of O(n) unidirectional morphing steps, in \(O(n^{1+\omega /2})\) time. Our morphing algorithm computes barycentric weights for the darts in \(\varGamma _0\) and \(\varGamma _1\) in a preprocessing phase, and then for each morphing step, interpolates only the pair of weights associated with a single edge. Our key observation is that changing the weights for a single edge e moves all vertices in the Floater drawing along lines parallel to e. (The same observation was made for symmetric edge weights by Chambers et al. [9].) Our algorithm is significantly simpler than that of Angelini et al. [5] for computing convexity-preserving morphs. We then extend our algorithm to drawings with non-convex faces, using a simpler approach than Kleist et al. [31]. Figure 1 shows a morph computed by our algorithm; in each frame, the weights of the bold edge are about to change.

Fig. 1.
figure 1

Incrementally morphing between planar graphs.

Next, we describe a natural extension of Floater and Gotsman’s method to geodesic graphs on the flat torus. Our key observation is that barycentric dart weights can be scaled so that barycentric interpolation works. Specifically, we call a weight assignment morphable if every column of the resulting Laplacian linear system sums to zero; averages of morphable weights are morphable. Given any weight assignment consistent with any convex drawing, we can guarantee morphability by scaling the weights of all darts leaving each vertex v—or equivalently, scaling each row of the linear system—by a common positive scalar \(\alpha _v\). This scaling obviously has no effect on the solution space of the system. Positivity of the scaling vector \(\alpha \) follows from a weighted directed version of the matrix-tree theorem [6, 17, 48]. We can computing the appropriate scaling in \(O(n^{\omega /2})\) time, after which we can compute any intermediate drawing in \(O(n^{\omega /2})\) time, matching the performance of Floater and Gotsman exactly. The resulting morphs are natural and visually appealing, and our proofs of correctness are considerably simpler than those of Chambers et al. [9]. However, unlike Chambers et al., our new morphing algorithm does not compute explicit vertex trajectories. Figure 2 shows a morph computed by our algorithm between two randomly shifted \(6\times 6\) toroidal grids. (The authors’ Python implementation is available on request.)

Fig. 2.
figure 2

Morphing between randomly shifted toroidal grids.

It remains an open question whether our results can be combined to compute explicit low-complexity piecewise-linear toroidal morphs without edge collapses. We offer some preliminary observations in the full version [21].

2 Definitions and Notation

2.1 Planar Graphs

Any planar straight-line drawing \(\varGamma \) can be represented by a position matrix \(P \in \mathbb {R}^{n\times 2}\), each row \(p_v\) of which gives the location of some vertex v. Thus, each edge uv is drawn as the straight-line segment \(p_up_v\). We call a planar drawing convex if it is crossing-free, every bounded face is a convex polygon, and the outer face is the complement of a convex polygon.

Formally, we regard each edge of any graph as a pair of opposing half-edges or darts, each directed from its tail to its head. We write \({{\boldsymbol{\textit{rev}}}(d)}\) to denote the reversal of any dart d. For simple graphs, we write to denote the dart with tail u and head v. A barycentric weight vector for \(\varGamma \) assigns a positive real number to every dart of a graph, so that the vertex positions \(p_v\) satisfy Floater’s linear system (1). Conversely, for a fixed graph G with a fixed convex outer face, the Floater drawing \(\varGamma ^\lambda \) of G with respect to a positive weight vector \(\lambda \) is the unique drawing whose vertex positions \(p_v\) satisfy system (1).

A morph between two planar drawings \(\varGamma _0\) and \(\varGamma _1\) is a continuous family of crossing-free drawings \(\varGamma _t\) parametrized by time, starting at \(\varGamma _0\) and ending at \(\varGamma _1\). A morph is linear if each vertex moves along a straight line at uniform speed, and piecewise-linear if it is the concatenation of linear morphs. Any piecewise-linear morph can be described by a finite sequence of straight-line drawings. A linear morph is unidirectional if vertices move along parallel lines.

2.2 Torus Graphs

The flat torus is the quotient space \(\mathbb {T}= \mathbb {R}^2 / \mathbb {Z}^2\), also obtained by identifying opposite sides of the unit square \([0,1]^2\). A geodesic on the flat torus is the image of a line segment in \(\mathbb {R}^2\) under the projection map \(\pi :\mathbb {R}^2 \rightarrow \mathbb {T}\) where \(\pi (x,y) = (x\bmod 1, y\bmod 1)\).

A (crossing-free) geodesic torus drawing \(\varGamma \) of a graph G maps its vertices to distinct points in \(\mathbb {T}\) and its edges to simple, interior-disjoint geodesics. We explicitly consider graphs containing loops and parallel edges. We write to declare that d is a dart (possibly one of many) with tail u and head v.

Every geodesic torus drawing \(\varGamma \) of a graph G is the projection of an infinite, doubly-periodic planar straight-line graph \(\widetilde{\varGamma }\), called the universal cover of \(\varGamma \) [9]. We call \(\varGamma \) essentially simple if its universal cover \(\widetilde{\varGamma }\) is simple, and essentially 3-connected if \(\widetilde{\varGamma }\) is 3-connected [39, 40]. Finally, we call \(\varGamma \) a convex drawing if every face of \(\widetilde{\varGamma }\) is strictly convex. Every convex torus drawing is both essentially simple and essentially 3-connected, since every infinite planar graph with strictly convex faces is 3-connected [18].

Coordinate Representations. Following Chambers et al. [9], we use a coordinate representation \((P, \tau )\) for geodesic torus drawings that records

  • a position vector \(p_v \in \mathbb {R}^2\) for each vertex v, and

  • a translation vector \(\tau _d \in \mathbb {Z}^2\) for each dart d, such that \(\tau _{\textit{rev}(d)} = -\tau _d\).

These vectors indicate that each dart is drawn as the projection of a line segment from \(p_u\) to \(p_v+\tau _d\) in the universal cover \(\widetilde{\varGamma }\). In particular, if we normalize all vertex positions to the half-open unit square \([0,1)^2\), then each translation vector \(\tau _d\) indicates the number of times d crosses the vertical boundary of the unit square to the right, and the number of times d crosses the horizontal boundary of the unit square upward.

Two crossing-free drawings of the same graph on the torus are isotopic if one can be deformed into the other through a continuous family of (not necessarily geodesic) crossing-free drawings; such a deformation is called an isotopy. Two crossing-free drawings are isotopic if and only if their coordinate representations can be normalized so that their translation vectors agree; this condition can be tested in O(n) time [9, Theorem A.1], [12]. A geodesic isotopy or morph is an isotopy in which all intermediate drawings are geodesic.

Barycentric Weights. In any convex torus drawing \(\varGamma \), the position \(p_v\) of each vertex v can be expressed as a convex combination of its neighbors, as follows. We can assign a weight \(\lambda _d > 0\) to each dart d such that any coordinate representation \((P, \tau )\) of \(\varGamma \) satisfies the linear system

(2)

We can express this linear system in matrix notation as \(L^{\lambda }P = H^{\lambda }\), where

figure l

The (unnormalized, asymmetric) Laplacian matrix \(L^\lambda \) has rank \(n-1\) [42]. We call any positive weight vector \(\lambda \) satisfying system (2) barycentric for \(\varGamma \). Barycentric weights for any convex torus drawing can be computed in O(n) time using, for example, Floater’s mean-value coordinates [23, 30].

On the other hand, suppose we fix the graph G and translation vectors \(\tau _d\) consistent with an essentially 3-connected (but not necessarily geodesic) drawing of G. Then for any positive weight vector \(\lambda \), any solution to linear system (2) gives the vertex positions \(p_v\) of a convex drawing \(\varGamma ^\lambda \) of G [25]. In this case, we say that the Floater drawing \(\varGamma ^\lambda \) realizes the weight vector \(\lambda \), and we call the weight vector \(\lambda \) realizable for the graph G. Every realizable weight vector is realized by a two-dimensional family of drawings that differ by translation.

Every symmetric positive weight vector (where \(\lambda _d = \lambda _{\textit{rev}(d)}\)) is realizable: for any assignment of positive weights to the edges of G, there is a corresponding convex torus drawing [14, 19, 25, 27, 35]. Realizable weights are not necessarily symmetric: there are convex torus drawings with only asymmetric barycentric weights. Conversely, positive asymmetric weights are not always realizable.

3 Morphing Planar Graphs Edge by Edge

We describe a very simple algorithm to morph planar straight-line graphs that combines the benefits of both the Floater and Gotsman approach [24, 26, 43,44,45] and the Cairns approach [1, 7, 8, 31, 46]. Our algorithm constructs a morph consisting of O(n) unidirectional morphing steps, in \(O(n^{1+\omega /2})\) time. Because our morphs do not use edge collapses, they are also potentially good for visualization.

Fix a planar graph G and a convex outer face. Let \(p^\lambda _v\) denote the position of vertex v in the Floater drawing \(\varGamma ^\lambda \) with respect to weight vector \(\lambda \). The following lemma is a planar asymmetric version of Lemma 5.1 of Chambers et al. [9]. Intuitively, it states that changing the weights of the darts of a single edge e moves each vertex in the Floater drawing along lines parallel to e.

Lemma 1

Let \(\lambda \) and \(\mu \) be arbitrary positive weight vectors such that \(\lambda _{d} \ne \mu _{d}\) or \(\lambda _{\textit{rev}(d)} \ne \mu _{\textit{rev}(d)}\) for some dart d, but \(\lambda _{d'} = \mu _{d'}\) for all darts \(d' \notin \left\{ d,\textit{rev}(d) \right\} \). For each vertex w, the vector \(p^\mu _w - p^\lambda _w\) is parallel to the drawing of d in \({\varGamma }^{\lambda }\).

Proof:

Suppose d has tail u and head v, and (by rotating the drawing if necessary) that d is drawn parallel to the x-axis. For each vertex i, let \(y^\lambda _i\) and \(y^\mu _i\) be the y-coordinates of points \(p^\lambda _i\) and \(p^\mu _i\), respectively, so that \(y^\lambda _u = y^\lambda _v\). We need to prove that \(y^\lambda _w = y^\mu _w\) for every vertex w.

Projecting linear system (1) for \(\lambda \) onto the y-axis gives us

(3)

Swapping entries of \(\lambda \) with corresponding entries of \(\mu \) in the system (3) changes at most two constraints, corresponding to the two endpoints u and v of d. Moreover, in each changed constraint, the single changed coefficient is multiplied by \(y^\lambda _u - y^\lambda _v = y^\lambda _v - y^\lambda _u = 0\), so the \(y^\lambda _i\)’s also solve the corresponding system for \(\mu \). Since the system (3) and its counterpart for \(\mu \) each have a unique solution, we conclude that \(y^\lambda _w = y^\mu _w\) for every vertex w.    \(\Box \)

Under the assumptions of Lemma 1, linearly interpolating the vertex positions from \(\varGamma ^\lambda \) to \(\varGamma ^\mu \) yields a unidirectional linear morph [1, Corollary 7.2], [9, Lemma 5.2]. It follows that we can morph between isomorphic convex drawings through a sequence of at most \(3n-9\) unidirectional linear morphing steps, one for each internal edge, following the algorithm in Fig. 3. Initial and final barycentric weight vectors can be found in O(n) time using, for example, Floater’s mean-value method [23, 30]. Each intermediate drawing can be computed in \(O(n^{\omega /2})\) time using nested dissection [4, 34], for a total running time of \(O(n^{1+\omega /2})\).

Fig. 3.
figure 3

Algorithm for morphing between convex planar drawings.

Because all Floater drawings are convex, Lemma 5.2 of Chambers et al. [9] implies that MorphConvex actually produces a convexity-preserving piecewise-linear morph; all faces remain convex throughout the morph. Our algorithm is significantly simpler than that of Angelini et al. [5].

We can extend the previous algorithm to non-convex drawings by first morphing to convex drawings, as follows. We first add edges to the initial and final drawings to decompose every face into convex polygons, compute barycentric weights for the resulting drawing, and then reduce the weights of each added edge (one-by-one) to zero, effectively deleting that edge. Dropping the added edges yields a piecewise-linear morph from each input drawing to a convex drawing. Again, each intermediate drawing can be computed in \(O(n^{\omega /2})\) time. Our complete morphing algorithm is shown in Fig. 4. Our algorithm Convexify is considerably simpler than that of Kleist et al. [31]; however, unlike Kleist et al., our algorithm is not necessarily convexity-increasing.

Fig. 4.
figure 4

Algorithm for morphing between general planar straight-line drawings.

In total, we perform one morphing step for each internal edge of G, plus at most \(2(k-3)\) morphing steps for each bounded face with degree k. Euler’s formula implies that a 3-connected planar graph has between 1.5n and \(3n - 6\) edges, and thus at most \(3n - 9\) internal edges. Thus, we need to add at most \(1.5n - 6\) edges to convexify the initial and final faces, so our morph consists of at most \(4.5n - 15\) linear morphing steps. In summary:

Theorem 1

Given any two isomorphic 3-connected planar straight-line drawings with n vertices and the same convex outer face, we can compute a morph between them consisting of at most \(4.5n - 15\) unidirectional linear morphing steps, in \(O(n^{1+\omega /2})\) time.

4 Morphable Weight Vectors on the Flat Torus

As observed by Steiner and Fischer [42], Floater and Gotsman’s morphing algorithm does not directly generalize to the toroidal setting, since not all positive weight vectors \(\lambda \) are realizable. In particular, given arbitrary barycentric weights \(\lambda (0)\) and \(\lambda (1)\) of two isotopic convex torus drawings, intermediate weights \(\lambda (t) := (1-t)\lambda (0) + t\lambda (1)\) are not necessarily realizable; see the full version [21].

To bypass this issue, we identify a subspace of morphable weight vectors, such that every convex torus drawing has a morphable barycentric weight vector, every morphable weight vector is realizable, and convex combinations of morphable weights are morphable. Specifically, a positive weight vector \(\lambda \) is morphable if each column of the matrices \(L^\lambda \) and \(H^\lambda \) sums to 0. The following lemma is immediate:

Lemma 2

Convex combinations of morphable weight vectors are morphable.

Lemma 3

Every morphable weight vector is realizable.

Proof:

If \(\lambda \) is a morphable weight vector, then the nth row of the linear system \(L^\lambda P = H^\lambda \) is implied by the other \(n-1\) rows, so we can remove it. The resulting abbreviated linear system still has rank \(n-1\), so it has a (unique) solution.    \(\Box \)

Lemma 4

Given a barycentric weight vector \(\lambda \) for a convex torus drawing \(\varGamma \), a morphable barycentric weight vector for \(\varGamma \) can be computed in \(O(n^{\omega /2})\) time.

Proof:

The matrix \(L^{\lambda }\) has rank \(n-1\), so there is a one-dimensional space of (row) vectors \(\alpha = (\alpha _1,\dots ,\alpha _n)\) such that \(\alpha L^\lambda = (0,\dots ,0)\). We can compute a non-zero vector \(\alpha \) in \(O(n^{\omega /2})\) time using nested dissection [2, 4, 34].

A directed version of the matrix tree theorem [6, 17, 48] implies that we can choose all \(\alpha _i\) to be positive. Specifically, let \(G^\pm \) be the weighted directed graph whose weighted arcs correspond to the weighted darts of G. An inward directed spanning tree is an acyclic spanning subgraph of \(G^\pm \) where every vertex except one (called the root) has out-degree 1. The weight of an inward directed spanning tree is the product of the weights of its arcs. For each i, let \(\alpha _i\) be the sum of the weights of all inward directed spanning trees rooted at vertex i; we have \(\alpha _i>0\) because all dart weights are positive. The directed matrix tree theorem implies that \(\alpha L = 0\), as required; for an elementary proof, see De Leenheer [17, Theorem 3]. (See also Cohen et al. [11, Lemma 1].)

Define a new weight vector \(\mu \) by setting \(\mu _d := \alpha _{\textit{tail}(d)}\lambda _d\) for each dart d. For each index i, we immediately have \(L^{\mu }_i P = \alpha _i L^\lambda _i P = \alpha _i H^\lambda _i = H^{\mu }_i\), where P is the position matrix for \(\varGamma \), so \(\mu \) is in fact a barycentric weight vector for \(\varGamma \). Finally, we observe that \( (1,\dots ,1) L^\mu = \alpha L^\lambda = (0,\dots ,0) \) and \( (1,\dots ,1) H^\mu = \alpha H^\lambda = \alpha L^\lambda P = (0,\dots ,0)P = (0,0), \) which imply that \(\mu \) is morphable.    \(\Box \)

Theorem 2

Given coordinate representations of two isotopic essentially 3-connected geodesic torus drawings \(\varGamma _0\) and \(\varGamma _1\), we can efficiently compute a morph from \(\varGamma _0\) to \(\varGamma _1\). Specifically, after \(O(n^{\omega /2})\) preprocessing time, we can compute any intermediate drawing during the morph in \(O(n^{\omega /2})\) time.

Proof:

Suppose \(\varGamma _0\) and \(\varGamma _1\) are convex drawings. First, if necessary, we normalize the given coordinate representations so that their translation vectors agree, in O(n) time [9, Theorem A.1]. Then we find barycentric weight vectors \(\lambda (0)\) and \(\lambda (1)\) for \(\varGamma _0\) and \(\varGamma _1\), respectively, in O(n) time, for example using Floater’s mean-value coordinates [23, 30]. Following Lemma 4, we derive morphable weights \(\mu (0)\) and \(\mu (1)\) from \(\lambda (0)\) and \(\lambda (1)\), respectively, in \(O(n^{\omega /2})\) time. Finally, given any real number \(0< t < 1\), we set \(\mu (t) := (1-t)\mu (0) + t\mu (1)\) and solve the linear system \(L^{\mu (t)} P^{(t)} = H^{\mu (t)}\) for the position matrix \(P^{(t)}\) of an intermediate drawing \(\varGamma ^{\mu (t)}\); Lemmas 2 and 3 imply that this system is solvable. The function \(t \mapsto \varGamma ^{\mu (t)}\) is a convexity-preserving morph between \(\varGamma _0\) and \(\varGamma _1\).

If the faces of \(\varGamma _0\) or \(\varGamma _1\) are not convex, we morph through an intermediate convex drawing, similarly to Chambers et al. [9, Theorem 8.1]. Let \(\varGamma _*\) be the Floater drawing of G obtained by setting every dart weight to 1. Compute any triangulation \(T_0\) of \(\varGamma _0\), and then triangulate the convex faces \(\varGamma _*\) using the same diagonals, to obtain a triangulation \(T_*\) isotopic to \(T_0\). Assign weight 0 to the darts of the diagonals in \(T_*\setminus \varGamma _*\) to obtain a barycentric weight vector \(\mu _*\) for \(T_*\), which is symmetric and therefore morphable. Derive morphable weights \(\mu _0\) for \(T_0\) using mean-value coordinates [23, 30] and Lemma 4. Then we can morph from \(T_0\) to \(T_*\) by weight interpolation, using the weight vector \(\mu (t) := (1-2t)\mu _0 + 2t\mu _*\) for any \(0\le t\le 1/2\). Ignoring the diagonal edges gives us a morph from \(\varGamma _0\) to \(\varGamma _*\). A symmetric procedure yields a morph from \(\varGamma _*\) to \(\varGamma _1\).    \(\Box \)

In the full version [21], we use morphable weights to prove a conjecture of Connelly et al. [15] about the deformation space of geodesic torus triangulations.

5 Open Questions

It is natural to ask whether our “best-of-both-worlds” planar morph can be extended to graphs on the flat torus. In the full version [21], we prove a toroidal analog of Lemma 1 for realizable weight vectors; unfortunately, the main roadblock is that not all weight vectors are realizable. In particular, given a realizable weight vector (morphable or not), it is not clear when changing the weights for a single edge results in another realizable weight vector.

Several previous planar morphing algorithms [1, 5, 16, 31] rely on a certain convexifying procedure [10, 28, 31, 32], and are (potentially) faster than our algorithm via the implementation recently described by Klemz [32]. It is an open question whether the procedure can be extended to geodesic torus graphs.

One can also ask if the result can be extended to surfaces of higher genus. The recent results of Luo et al. [37] imply that Floater and Gotsman’s planar morphing algorithm [24] extends to geodesic triangulations on higher-genus surfaces of negative curvature; however, the existence of (any reasonable analog of) piecewise-linear morphs on such surfaces remains unknown.