Determining triangulations and quadrangulations by boundary distances

We show that if a disc triangulation has all internal vertex degrees at least 6, then the full triangulation may be determined from the pairwise graph distance between boundary vertices. A similar result holds for quadrangulations with all internal degrees at least 4. This confirms a conjecture of Itai Benjamini. Both degree bounds are best possible, and correspond to local non-positive curvature. However, we show that a natural conjecture for a"mixed"version of the two results is not true.


Introduction
Let T be a planar triangulation with a simple closed boundary of length n, and suppose that all distances in T between boundary vertices are known. Under what conditions does this allow the precise structure of T to be determined? In general this is not the case if internal vertices of degree 5 (or below) are permitted. For any triangulation we can glue an icosahedron onto any face, adding 17 vertices of degree 5, without changing any distances between existing vertices. This question was first posed by Itai Benjamini [7], who conjectured that provided all internal degrees are at least 6, the triangulation can be reconstructed.
Indeed, degree 5 is the natural boundary to this sort of counterexample. If all internal vertices have degree at least 6, then no triangle can have internal vertices. To see this, suppose abc is a triangle surrounding m ≥ 1 internal vertices. Then the total number of edges between and inside abc is at least 3m + 9/2, since each of a, b, c has at least one neighbour inside the triangle, but a planar graph on m + 3 vertices can have at most 3m + 3 edges.
Similarly, we might instead consider a planar quadrangulation. If internal vertices of degree 3 are permitted then we may glue a cube onto a face, but again this type of example cannot occur if the minimum degree of internal vertices is at least 4. Both of these conditions (minimum degree 6 for triangulations and minimum degree 4 for quadrangulations) correspond to having non-positive curvature at each internal vertex.
In more generality, if we consider a planar map with simple closed boundary which may have faces of different sizes, then the natural interpretation of what it means to have nonpositive curvature at each internal vertex is to look locally at the faces surrounding a vertex, considering each as a regular polygon with the appropriate number of sides, and require the angles around the vertex to sum to at least 2π. For example, if all faces are triangles or quadrangles, and an internal vertex v meets t(v) triangles and q(v) quadrangles, then this condition becomes 2t(v) + 3q(v) ≥ 12. As we shall see, this is indeed the right definition, in the sense that it precludes the type of simple counterexamples discussed above. However, perhaps surprisingly in light of our main results, this condition is not sufficient to allow reconstruction of the graph from boundary distances, even for graphs with only these two types of faces; a class of counterexamples is given in Section 4.
However, we show that in the cases of pure triangulations and pure quadrangulations the natural condition is sufficient to allow reconstruction. Theorem 1.1. Let T be a triangulation with a simple closed boundary such that all internal vertices have degree at least 6. Then the distances between boundary vertices determine T . Theorem 1.2. Let Q be a quadrangulation with a simple closed boundary such that all internal vertices have degree at least 4. Then the distances between boundary vertices determine Q. Theorems 1.1 and 1.2 may be viewed as discrete versions of the continuous inverse problem of reconstructing (up to isometry) the metric on a compact Riemannian metric with specified boundary from the distance function on pairs of boundary points. This problem originates from rigidity questions in Riemannian geometry [13,9,10], and a manifold is said to be boundary rigid if any other Riemannian manifold with the same boundary and boundary distance function is isometric to it. Michel [13] conjectured that any simple Riemannian manifold is boundary rigid; the condition of being simple requires that the manifold is simply-connected with strictly convex boundary and that geodesics have no conjugate points. In the two-dimensional case this was confirmed for simple surfaces of negative curvature by Croke [8] and for all simple surfaces by Pestov and Uhlmann [14]. Note, however, that these results in the continuous case require strong assumptions on the boundary, whereas our results hold for any boundary which encloses a simply-connected region.
In addition to the reconstruction question, we might also ask about recognition: is there an efficient way to determine whether a given list of distances arise from such a graph? While the proofs of our main results do indeed give a way to do this, the recognition question also makes sense in contexts where reconstruction is not possible. In Section 5 we discuss such generalisations.
Throughout, we write d G (·, ·) for the graph distance within G (or just d(·, ·) if there is only one possible graph); to avoid confusion, we write deg G (·) (or deg(·)) for the vertex degree.

Triangulations
In this section we prove Theorem 1.1. Our approach is induction on n, the number of boundary vertices (the observation in Section 1 that every triangle is a face gives the result for n = 3). We show that certain types of configuration allow reduction to smaller cases. For a configuration to allow such a reduction, we require two properties: first, that the presence of this configuration within T can be recognised from the boundary distances; secondly, that after removing the configuration what remains consists of one or more smaller triangulations, and all boundary distances for these smaller triangulations may be deduced from the original boundary distances.
A simple example of such a configuration is a chord, that is, if T contains an internal edge between two boundary vertices. A chord may be identified because its ends are a non-consecutive pair of boundary vertices at distance 1, giving the first property. Assuming such a chord exists, let the boundary vertices, in order, be v 1 , . . . , v n and suppose without loss of generality that d(v 1 , v k ) = 1 for k = 2, n. Then we may split T into two triangulations T 1 and T 2 bounded respectively by the cycles v 1 · · · v k v 1 and v k · · · v n v 1 v k . No shortest path (in T ) between two vertices of T 1 can use vertices outside T 1 , since if a path leaves T 1 and subsequently returns to it then the section outside T 1 can be replaced by the single edge v 1 v k (in some direction).
The same applies to T 2 , giving the second property.
Of course, in order to make this approach into an inductive proof, we will need our set of reducible configurations to be sufficiently large that at least one of them is guaranteed to occur (except in the base case). While there are some other "small" configurations (in the sense of depending only on one or two internal vertices) that allow reductions, in general we will need to consider configurations of unbounded size. The general form of these will be a strip of faces running along the boundary, which we can remove to leave a single triangulation consisting of all remaining faces.
A key fact which we will need in order to deduce the boundary distances of the smaller triangulation is that in any triangulation where internal vertices all have degree at least 6, the three vertices of any face cannot be equidistant from any fourth point; we prove this in Section 2.1. We then define the main configurations we use in Section 2.2, and show that they may be identified and permit reductions. After giving some other simpler reduction configurations in Section 2.3, we complete the proof in Section 2. 4. In what follows, a disc triangulation is a plane graph with a simple closed boundary and all internal faces being triangles. It is chordless if no internal edge joins two boundary vertices. We define the boundary faces of T to be those which share an edge with the boundary cycle.

Meridians and no equidistant triangle
Lemma 2.1. Let T be a disc triangulation with boundary v 0 v 1 · · · v n−1 v 0 such that every internal vertex has degree at least 6. Suppose that v 1 , . . . , v k−1 each have degree at least 4. Then d T (v 0 , v k ) = k, and furthermore v 0 v 1 · · · v k is the unique shortest path between v 0 and v k .
Proof. First we argue that for every pair 0 ≤ i < j ≤ k with j > i + 1, the vertices v i , v j are not adjacent and do not have a common neighbour other than v i+1 . Indeed, suppose not and consider a counterexample minimising j − i. Consider the boundary faces with edges v i v i+1 , . . . , v j−1 v j . The third vertices of all these faces are distinct, using minimality and the fact that each of v 1 , . . . , v k−1 has degree at least 4. Thus if v i and v j are adjacent then the cycle v i · · · v j is chordless and encloses a triangulation where all internal vertices have degree at least 6 and at least j − i − 1 internal vertices are adjacent to the boundary. Similarly, if v i and v j have a common neighbour x (other than v i+1 ), then the cycle v i · · · v j x has the same properties. In either case, it follows that the inner subtriangulation remaining after removing the cycle of length at most j − i + 1 has boundary length at least j − i − 2. However, this gives a contradiction together with [1,Lemma 2.2], which states that if T ′ is a triangulation of a cycle of order ℓ with all internal vertices having degree at least 6 then the inner subtriangulation remaining after removing the cycle has boundary length at most ℓ − 6. Now we prove the desired result. Suppose it is not true and take a counterexample with as few total vertices in the triangulation as possible, and among such counterexamples, with k as small as possible. Let P be either a shorter path or a different path of length k between v 0 and v k . If v j is on P for some 1 ≤ j < k then either the section of P from v 0 to v j or the section from v j to v k contradicts minimality of the original counterexample. Thus P avoids v 1 , . . . , v k−1 .
Consider the set of faces incident with at least one of v 1 , . . . , v k−1 . The number of such faces There is another path P ′ from v 0 to v k around the other side of this strip of faces, which has length at least k + 1 and is disjoint from {v 1 , . . . , v k−1 }; in particular P ′ is longer than P , so is not a shortest path in T \ {v 1 , . . . , v k−1 }. Suppose that P ′ consists entirely of internal vertices of T . Then removing v 1 , . . . , v k−1 leaves a disc triangulation T ′ for which P ′ forms part of the boundary, and since each vertex on P ′ , other than v 0 and v k , was adjacent to at most two of the removed vertices, we conclude that it has degree at least 4 in the remaining triangulation. Since P lies entirely in T ′ , it follows that P ′ is not a shortest path between v 0 and v k in T ′ , contradicting minimality of the original example. If some vertices of P ′ are boundary vertices of T , we may remove any bridges from T ′ and split any cutvertices to leave two or more disc triangulations, then apply the same argument to each section of P ′ that remains, noting that every vertex of P ′ which lies strictly inside such a section has degree at least 4. Lemma 2.2. Let T be a triangulation of the cycle v 0 v 1 · · · v n−1 v 0 with every internal vertex having degree at least 6. Suppose that v 1 , . . . , v k−1 each have degree at least 3, that if deg(v i ) = 3 then there is some h with 0 < h < i and deg(v h ) ≥ 5, and that if there are two values Then d T (v 0 , v k ) = k, and furthermore every path of length exactly k uses v 1 .
Proof. Again, suppose not and take a counterexample with as few total vertices as possible. By Lemma 2.1, at least one of these vertices, say v i , has degree 3. Let w i be the neighbour of v i other than v i−1 , v i+1 , and remove v i to give a triangulation T ′ . For any shortest v 0 v k -path in T which uses v i , replacing v i by w i gives another shortest path, and so it suffices to show the conclusion holds for T ′ . Note with all other degrees unchanged. If w i was an internal vertex of T then T ′ is still a disc triangulation and deg T ′ (w i ) ≥ 5. It follows that T ′ satisfies the same boundary degree conditions, and so the result holds by minimality of T . If not, then T ′ consists of two disc triangulations T ′ 1 and T ′ 2 with a common vertex w i . The required boundary conditions are met in from which the result follows. We work towards the crucial Lemma 2.4. We first need a definition. Given a plane triangulation T , and an internal vertex x, let C be the cycle of neighbours of x. We regard C as a cyclic list alternating between vertices and edges, of even length 2 deg(x). If two elements of this list have positions differing by deg(x), we say they are opposite with respect to x. If y, z are two neighbours of x then their positions in the list differ by an even number, so there are two list elements exactly halfway between them which form a pair of opposite elements; we say either such element is a midpoint of y and z with respect to x. We may similarly define the midpoint of y and z relative to x when x is not internal; in this case there is only one midpoint.
We define a meridian in T as a sequence e 0 , . . . , e r with the following properties: • For each i, e i is either a vertex or an edge.
• e i is a boundary vertex or boundary edge if and only if i ∈ {0, r}.
• For 0 < i < r, if e i is a vertex then e i−1 and e i+1 are opposite with respect to e i .
• For 0 < i < r, if e i is an edge then e i−1 and e i+1 are the two vertices completing faces with e i in some order.
Note that we may associate a meridian with a simple curve, passing through each vertex and crossing each edge which is an element of the meridian, meeting the boundary of T (only) at each endpoint. Consequently a meridian divides T into two parts. We say that a meridian bisects two incident edges xy and xz if x is an element of the meridian and the adjacent elements are midpoints of y and z relative to x. Note that this includes the case where x is a boundary vertex and so there is only one adjacent element (and only one midpoint). Since each e i is either a vertex or an edge, we abuse notation by writing v ∈ e i to mean that either e i is the vertex v or is an edge containing v. We say that a path v 0 v 1 · · · v s in T follows a meridian e 0 , . . . , e r if v 0 = e i for some i, and either for every j we have Figure 1: Part of a triangulation, with a meridian (circled groups) and a path following the meridian (red). The dashed section at the top shows how the triangulation may be expanded to avoid the path meeting the boundary (bold) internally.
v j ∈ e i+j or for every j we have v j ∈ e i−j . Note that we require the path to start in a vertex of the meridian. Figure 1 shows a meridian and following path. Our next lemma shows that paths which follow meridians are shortest paths for the class of triangulations we consider. Lemma 2.3. Let T be a disc triangulation for which every internal vertex has degree at least 6, let ℓ be a meridian in T and let v 0 v 1 · · · v s be a path which follows ℓ.
Proof. Suppose not, and take a counterexample P = v 0 v 1 · · · v s following a meridian ℓ, with s as small as possible. Note that we may assume v 1 , . . . , v r−1 are internal vertices of T , since we may add vertices to T , if necessary, to ensure this without violating the fact that P is a counterexample, and in such a way that all internal vertices have degree at least 6 (see Figure  1). Let P ′ be an alternative path which demonstrates that P is a counterexample, and let γ be a curve associated with ℓ. Note that minimality ensures that, for 0 < i < r, if v i is an element of ℓ then P ′ does not visit that vertex, and if v i v ′ i is an element of ℓ then P ′ does not use that edge. In particular, this means that P ′ does not cross γ, so we may choose a subtriangulation T ′ induced by vertices which are either on γ or on a particular side of it, such that P ′ lies entirely in T ′ . We may assume P also lies entirely within T ′ (if not, replace each vertex which does not with its neighbour which does). We may also assume T ′ is a disc triangulation, since our previous assumption that v 1 , . . . , v r−1 were internal in T ensures that P and P ′ lie entirely within one block of T ′ .
Fix i with 0 < i < r. Suppose first that v i is an element of ℓ. If v i−1 and v i+1 are both elements of ℓ then they are opposite in T with respect to v i , and since deg If exactly one is an element of ℓ then deg T (v i ) must be odd, so at least 7, and Alternatively, if v i is not an element of ℓ then it has exactly one neighbour in T \ T ′ , and so Thus the conditions of Lemma 2.2 are met, giving the result.
We can now prove the main result of this section.
Lemma 2.4. Let T be a triangulation with a simple closed boundary with all internal degrees at least 6. Let a, b, c be the vertices of a triangle in T , and let x be any other vertex of T . Then Proof. Suppose the result is not true, and take a counterexample where the common distance is as small as possible; note that it cannot be 1 because each triangle bounds a face. Fix three shortest paths P a , P b , P c to a, b, c respectively, and let y a , y b , y c be the vertices adjacent to x on the paths. By minimality of distance, y a , y b , y c are not all equal. Suppose that y a = y b . Then consider the meridian ℓ which bisects xy a and xy b , and let γ be the associated curve. The cycle K consisting of P a , P b and ab crosses γ at x, so must cross it at least once more, either because there is some vertex z = x on K which is an element of ℓ, or because there is some edge zz ′ of K which is an element of ℓ. If there are multiple crossings, note that each crossing corresponds to an element of ℓ, and we fix the crossing for which this element z or zz ′ is closest to the element x. Since the length of the cycle is at least 5, neither z nor z ′ is adjacent to x.
Without loss of generality z lies on P a , and so an initial section of P a is a shortest path to z. Also, using Lemma 2.3, any x-z path which follows ℓ is a shortest path. Let e i be the next element of ℓ after x used by such a path. Since x and z are not adjacent, for each y ∈ e i there is an x-z path following ℓ which uses y. By Lemma 2.3, y a ∈ e i . Since y a = y b and e i is a midpoint of y a and y b , we must have e i = {y a , y b }. Consequently there is an alternative shortest path P ′ a with y ′ a = y b . Applying the above argument to each pair of paths, each pair of y a , y b , y c are equal or adjacent. Suppose without loss of generality that y a = y b ∼ y c . Now apply the above argument to the pairs (P a , P c ) and (P b , P c ) respectively. If either of the vertices z obtained lies on P c , there is an alternative shortest path P ′ c passing through y a ; if not, there are alternative shortest paths P ′ a and P ′ b both passing through y c . In either case this contradicts minimality of the supposed counterexample.

Nice configurations
We next define the main configurations we use in the proof; we shall show that such a configuration can be identified from the pairwise distances of its boundary vertices, and allows a reduction to a smaller triangulation.
For k ≥ 4, a nice configuration of length k in a triangulation T consists of k + 1 consecutive boundary vertices, which we label v 0 , . . . , v k , and k − 2 internal vertices w 1 · · · w k−2 , such that the Figure 2 for an example.
Lemma 2.5. Let T be a chordless disc triangulation of boundary length n > 3 in which every internal vertex has degree at least 6. Then the maximum distance in T between external vertices is at most ⌊n/2⌋ − 1.
Proof. Removing the external vertices leaves a triangulated graph T ′ . Since T contains no chords, T ′ must be connected and every external vertex of T is adjacent to a vertex on the boundary of T ′ . By [1, Lemma 2.2], the boundary length of T ′ is at most n − 6; note that this counts edges with multiplicity, i.e. any edge of T ′ meeting the external face on both sides is counted twice. The boundary of T ′ forms a connected graph H, and every block of H is either a cycle or a bridge. Writing a for the number of edges of H in cycles and b for the number of bridges of H, the bound mentioned is therefore that a + 2b ≤ n − 6. Any two vertices x, y on the boundary of T may be connected by taking a shortest path in H between vertices x ′ adjacent to x and y ′ adjacent to y. Any shortest path in H uses at most half the edges of any cycle, and so has length at most a/2 + b ≤ n/2 − 3, implying that the path from x to y has length at most n/2 − 1.
Lemma 2.6. Suppose T is a chordless disc triangulation with all minimum degrees at least 6, and v 0 , . . . , v k are consecutive boundary vertices. Then the following are equivalent.
• v 0 , . . . , v k are the boundary vertices of a nice configuration.
Proof. First we show the forward implication. Consider the triangulation T ′ obtained by removing v 1 , . . . , v k−1 . Applying Lemma 2.1 to T ′ and the path v 0 w 1 · · · w k−2 v k , this is a shortest path in T ′ . It follows that for any 0 ≤ i < j ≤ k, there is a shortest path in T from v i to v j which lies entirely within the nice configuration, since any section which goes outside must start and end at vertices on the path v 0 w 1 · · · w k−2 v k and lie in T ′ , so can be replaced by a section of that path without increasing the length. The claim follows since these are the distances on the subgraph formed by the nice configuration.
Next we show the reverse implication. The distance conditions ensure that there is a path of . . w k−2 for the vertices on the path other than v 0 and v k . We will show that w i v i and w i v i+1 are edges of T for each i; since T is chordless this means each w i must be an internal vertex of T and so this is a nice configuration.
Indeed, the cycle C := v 0 · · · v k w k−2 · · · w 1 can have no chord other than these, since if j < i and w i v j is an edge then the path v j w i · · · w k−2 v k is too short unless (j, i) = (0, 1), whereas if j > i + 1 and w i v j is an edge then the path v 0 w 1 · · · w i v j is too short unless (j, i) = (k − 2, k). Suppose not all of the required chords of C are edges of T . Then there is some chordless cycle C ′ of length at least 4 in T whose vertices are vertices of C, and each edge of C ′ is either an edge of C or one of the required chords. We consider the subtriangulation T ′ with boundary C ′ . If C ′ = C then Lemma 2.5 gives that d T ′ (v 1 , v k ) ≤ k − 2 a contradiction. If it contains v 0 , . . . , v j but not v j+1 for j < k, then it contains at most j other vertices and Lemma 2.5 gives for some 0 < i < j < k then it contains w i , . . . w j−1 and possibly also w i−1 and/or w j . Lemma 2.5 gives a contradiction to the distance between v i and v j if gives a contradiction to the distance between v i−1 and v j via w i (and the remaining case is similar).
Lemma 2.7. Let T be a disc triangulation with boundary v 0 , . . . , v n−1 and all internal degrees at least 6, and suppose that v 0 , . . . , v k and w 1 , . . . , w k−2 form a nice configuration. Let T ′ be the triangulation obtained by removing v 1 , . . . , v k−1 . Then if all pairwise distances between boundary vertices of T are known, we may deduce all pairwise distances between boundary vertices of T ′ .
Proof. By Lemma 2.6, v 0 w 1 · · · w k−2 v k is a shortest path, and it follows that d T ′ (x, y) = d T (x, y) for all x, y ∈ T ′ . Thus it is sufficient to show that for any i > k we may deduce (d T (v i , w j )) 1≤j≤k−2 from (d T (v i , v j )) 1≤j≤k−1 . We use the following three properties satisfied by the function f (y) = d T (x, y) for any fixed x: (i) if y and z are adjacent then |f (y) − f (z)| ≤ 1; (ii) if f (y) > 0 then y has a neighbour z with f (z) = f (y) − 1; (iii) f is not constant on any triangle, by Lemma 2.4. Fix x = v i for some i > k, and let 1 ≤ j ≤ k − 2.
If f (v j ) = f (v j+1 ), then they differ by 1 and f (w j ) takes one of those two values, using (i). We claim it must be the lower of the two. Suppose not; by symmetry we may assume then either j > 1 and the previous paragraph gives f (w j−1 ) = q − 1, or j = 1 and v 0 is adjacent to w 1 . If f (v j−1 ) ≥ q then by (ii) either we have f (w j ) = q − 1 or we have j > 1 and f (w j−1 ) = q − 1. In all cases either w j or one of its neighbours has value q − 1, so f (w j ) = q + 1 by (i).
Thus in every case we may determine f (w j ) from the values f (v j ) and f (v j−1 ).

Additional reductions
Next we give some additional small cases which yield reductions. Throughout this section we assume T is a chordless disc triangulation with all internal vertex degrees at least 6; recall that this ensures that no cycle of length less than 6 encloses any vertices. Proof. We show the "if" statement; "only if" is immediate. Write S = {w 1 , . . . , w r }, labelled anticlockwise around the boundary cycle. First suppose r ≥ 6. There must be some vertex x not on the boundary which is adjacent to w 1 and w 4 . There must also be paths of length 2 between w 2 and each of w 5 , . . . , w r−1 , and between w 3 and w r ; since there are no chords these must all go via x. If r = 5 then without loss of generality vertices w 1 and w 5 are not adjacent (since we have n ≥ 6). Again there must be a vertex x adjacent to w 1 and w 4 , and this must also be adjacent to w 2 and w 5 . If w 2 , w 3 , w 4 are consecutive boundary vertices then w 2 w 3 w 4 x is a 4-cycle and must be triangulated by the edge xw 3 . If not, assume without loss of generality w 3 , w 4 are not adjacent. Then the path of length 2 from w 3 to w 5 must use x. In either case x is adjacent to all five vertices. Proof. Again, it is sufficient to prove the "if" statement. Indeed, the path of length 2 from v 1 to v 4 uses some vertex x = v 2 , v 3 , and now the 5-cycle v 1 v 2 v 3 v 4 x must be triangulated without additional vertices or chords of the boundary cycle, so by the edges v 2 x and v 3 x. Proof. Note that a path between two such vertices in T cannot be shorter than the shortest path in T i : if a section of the path is outside T i then that section must consist of at least two edges and go between two of v i , v i+1 and x, but then it may be replaced by edges v i x and/or v i+1 x without increasing the length. Thus it is sufficient to find d T (y, z) for each such pair. This is known except for pairs of the form x, y, where y is on the boundary between x i and x i+1 . However, for any such y, any shortest path in T between v i+3 and y must pass through either v i , v i+1 or x, and so, since

Boundary distances determine the triangulation
We have now established almost all the facts needed to prove the main result. The final piece of the jigsaw is to show that one of the reductions detailed in Sections 2.2 and 2.3 must be available to us. For this we need the following lemma, which is a modification of [11, Lemma 15].
We state the lemma with the weaker condition of a lower bound on the average degree of internal vertices, although when applying it in this section we have a bound on their minimal degree; we shall use this extra strength in Section 4. Let T be a disc triangulation with boundary length n. Recall that the boundary faces of T are those which share an edge with the boundary cycle; we endow them with the natural cyclic ordering. Define a Cleveland vertex to be an internal vertex lying on exactly two non-consecutive boundary faces (that is, it lies on exactly two boundary faces and those boundary faces are not consecutive). We write I C for the indicator function of a condition C. Proof. Note that if m = 1 then all boundary faces have a common internal vertex, so we must have k = 0, c = 0 and n ≥ d as all the neighbours of the internal vertex are external. Thus we may assume m ≥ 2. The fact that the boundary has no chords implies that the subgraph induced by internal vertices adjacent to the boundary is connected.
Adding a new vertex v * in the unbounded face of T adjacent to all vertices on the boundary gives a triangulationT of the sphere. with |X| + |Y | + |Z| + 1 vertices, i.e. all faces, including the unbounded one, have degree 3. It follows (using Euler's formula) that E = 3V − 6, where F , E and V denote the number of faces, edges and vertices ofT .
We next count the faces of T with at least one boundary vertex. We count these in cyclic order around the boundary: starting from any boundary face including boundary vertices x, y, we proceed through all internal faces meeting y (if any) in order, then to the next boundary face meeting boundary vertices y, z, and so on. Looking instead at the internal vertices included in faces, the ordering will consist of some boundary faces meeting an internal vertex u, followed by a face meeting two internal vertices u, v, then possibly some boundary faces meeting v, followed by a face meeting v and some other internal vertex w, and so on. This gives a cyclic list of internal vertices; however, the same internal vertex may appear in this list more than once. For each entry in the list, we note the number of boundary faces, if any, encountered at the corresponding point in the cyclic ordering. Note that the total number of faces meeting two internal vertices and one boundary vertex is equal to the total length of this list (since each two adjacent entries in the list correspond to one such face). Additionally, every internal vertex which is on a boundary face appears as an entry in this list with a positive number of boundary faces, every Cleveland vertex appears twice as an entry with a positive number of boundary faces, and every edge incident with a boundary vertex which does not form part of a boundary face corresponds to an entry on the list with no boundary faces. Thus the length of the list, and hence the number of faces with exactly one boundary vertex, is at least m + k + c.
Additionally, the number of boundary faces is n, and so there are at least n + m + k + c faces containing at least one boundary vertex. There is a one-to-one correspondence between such faces and edges meeting the boundary, not counting boundary edges or the new edges of T .
Thus, we may calculate the number of edges ofT as follows. There are n edges between boundary vertices, and another n meeting v * . Summing the degrees of internal vertices counts other edges meeting the boundary once each and other edges not meeting the boundary twice. If there are m + s internal vertices in total, then, we have d(m + s) + (m + k + c + n) + 4n ≤ 2E = 6(m + s + n + 1) − 12, and therefore n ≥ (d − 5)m + k + c + s + 6 ≥ (d − 5)m + k + c + 6.
We are now ready to complete the proof.
Proof of Theorem 1.1. We proceed by induction on the number of boundary vertices. Recall that if T has a chord we may reduce to two smaller cases. Likewise, if any internal vertex has five or more boundary neighbours then we may identify these neighbours by Lemma 2.8, and reduce (using Lemma 2.10) to one or more subtriangulations, all of which have strictly fewer than n boundary vertices, thus completing the inductive step of the proof. If any internal vertex has four consecutive boundary neighbours, we may identify them by Lemma 2.9. Suppose that w has consecutive boundary neighbours v 1 , v 2 , v 3 , v 4 . We claim that in this case we can deduce the distance between boundary vertices in T \ {v 2 , v 3 }; it suffices to check we can deduce d T (v i , w) for each i > 4. As in the proof of Lemma 2.7, if the distances from v i to v 2 and v 3 differ, say they are q, q + 1 in some order, then one of v 1 , v 4 must be at distance q − 1, so the distance to w must be q. If both distances are q then at least one of v 1 or w is at distance q − 1, and since the distance to w is not q by Lemma 2.4, it must be q − 1.
Thus we may reduce to a smaller case if any of the above configurations exist. If T contains no chord and no internal vertex adjacent to four consecutive boundary vertices or to any five boundary vertices, we will show that it must contain a nice configuration. Then, by Lemma 2.6, we may identify such a configuration, and, by Lemma 2.7, reduce to a triangulation with a shorter boundary.
To establish this, we apply Lemma 2.11 with d = 6. By assumption, there is no internal vertex on more than two boundary faces. Let m 1 be the number of internal vertices on one boundary face, let m 2 be the number of internal vertices on two consecutive boundary faces, and let c be the number of Cleveland vertices. The result of that lemma gives n = m 1 + 2m 2 + 2c ≥ (m 1 + m 2 + c) + c + k + 5, where k is the number of edges meeting the boundary but not on a boundary face (note that, by assumption, such an edge meets the boundary only once). Thus m 2 ≥ k + 5, so as we traverse the boundary we must at some point find two pairs of consecutive boundary faces, with each pair having an internal vertex in common, such that every edge meeting the boundary between them is on a boundary face. This is a nice configuration, completing the proof.

Quadrangulations
In this section we prove Theorem 1.2. The proof follows the same lines as that of Theorem 1.1 but is slightly simpler, largely due to identification of boundary distances in the reduced quadrangulation being more straightforward.
Let Q be a chordless disc quadrangulation of boundary length n (where, necessarily, n is even) with all internal vertex degrees at least 4, and having at least one internal vertex. We first prove a tight bound on the number of edges meeting the boundary.  Now the 4f • pairs consisting of a face in F • and an edge of that face count the boundary edges of Q ′ (with multiplicity), the boundary edges of Q (once each) and the edges of E • (twice each). Thus m = 4f • − 2e • − n ≤ 2f • − n ≤ n − 8, as required. Finally, since the boundary of Q ′ is a connected graph with r vertices, it has at least r − 1 edges, and if it has exactly r − 1 edges all are bridges and hence counted twice. It follows that r ≤ m ≤ n − 8 unless m = 0 and r = 1 (when n ≥ 8).
In particular, note that there can be no internal vertices if n < 8. Lemma 3.3. For n ≥ 6, let Q be a chordless disc quadrangulation with boundary length n such that every internal vertex has degree at least 4, and let x and y be boundary vertices. Then Figure 3: A nice configuration for a quadrangulation, with k ≥ 4.
For quadrangulations, we redefine a nice configuration as follows. For k ≥ 4, a nice configuration of length k in a quadrangulation Q consists of k + 1 consecutive boundary vertices, which we label v 0 , . . . , v k , and k − 3 internal vertices w 2 · · · w k−2 , such that the Figure 3 for an example.
Lemma 3.4. If Q is a chordless disc quadrangulation with boundary length n > 4 such that all internal degrees are at least 4, then Q contains a nice configuration.
Proof. By Lemma 3.1 the number of internal edges meeting an external vertex is at most n − 4. Writing S 0 , S 1 , S ≥2 for the sets of external vertices with zero, one and at least two internal neighbours respectively, we have |S 0 | ≥ |S ≥2 | + 4. Consequently the vertices of S 0 divide the boundary into |S 0 | ≥ 4 intervals, some of which contain no vertices of S ≥2 (and each of which has at most n−3 edges). Consequently, relabelling if necessary, we have, for some k ≥ 3, distinct consecutive boundary vertices v 0 , . . . , v k with v 1 , v k−1 ∈ S 0 and v i ∈ S 1 for each 2 ≤ i ≤ k − 2. We cannot have k = 3, since then v 0 v 1 v 2 v 3 would be a face, making v 0 v 3 a chord, so k ≥ 4. For each 2 ≤ i ≤ k − 2, the vertex v i has a unique internal neighbour w i , and together with v 0 , . . . , v k these form a nice configuration.
We now need to show that a nice configuration may be identified from the information available. The proof will be similar to the triangulation case.
Proof. First we argue that if 0 ≤ i < j ≤ k then v i , v j are not adjacent unless with j = i + 1, and do not have a common neighbour. Indeed, suppose not and take a counterexample with j − i as small as possible. Now either v i v i+1 · · · v j (if v i and v j are adjacent) or v i v i+1 · · · v j w (if they have a common neighbour w) forms a cycle C, and C together with the vertices inside it induces a quadrangulation of C, which is chordless by minimiality of the counterexample. However, each ℓ with i < ℓ < j meets at least one internal edge of this quadrangulation of C, so at least |C| − 3 internal edges meet boundary vertices, contradicting Lemma 3.1. Now we prove the desired result. Suppose it is not true and take a counterexample with as few total vertices in the quadrangulation as possible, and among such counterexamples, with k as small as possible. Let P be either a shorter path or a different path of length k. If v j is on P for some 1 ≤ j < k then P contains either a v 0 -v j path of length at most j other than v 0 v 1 · · · v j or a v j -v k path of length at most k − j other than v j v j+1 · · · v k , contradicting minimality in each case. Thus P avoids v 1 , . . . , v k−1 .
Consider the set of faces incident with at least one of v 1 , . . . , v k−1 . The number of such faces There is another path P ′ from v 0 to v k around the other side of this strip of faces, which has length at least k+2 and is disjoint from {v 1 , . . . , v k−1 }; in particular P ′ is longer than P , so is not a shortest path in Q \ {v 1 , . . . , v k−1 }. Suppose that P ′ consists entirely of internal vertices of Q. Then removing v 1 , . . . , v k−1 leaves a disc quadrangulation Q ′ for which P ′ forms part of the boundary, and since each internal vertex of P ′ was adjacent to at most one of the removed vertices it has degree at least 3 in the remaining quadrangulation. Since P ′ is not a shortest path between v 0 and v k in Q ′ , this contradicts minimality of the original example.
If some vertices of P ′ are boundary vertices of Q, we may remove any bridges from Q ′ and split any cutvertices to leave two or more disc quadrangulations and apply the same argument to each section of P ′ that remains, noting that each vertex of P ′ which lies strictly inside such a section has degree at least 3.
Lemma 3.6. Suppose Q is a chordless disc quadrangulation with all internal degrees at least 4, and v 0 , . . . , v k are consecutive boundary vertices, where k ≥ 4. Then the following are equivalent.
• v 0 , . . . , v k are the boundary vertices of a nice configuration.
Proof. We first prove the forward implication; write w 2 , . . . w k−2 for the internal vertices of the nice configuration.
If 0 < i < j < k this follows directly by applying Lemma 3.5 to Q, since deg(v ℓ ) = 3 for all i < ℓ < j. If i = 0 and j < k, we deduce this by induction on j (it is clearly true for j = 1). Suppose j > 1 and let Q ′ be the quadrangulation obtained by removing v 1 , . . . , v j−1 ; since each w ℓ is internal for Q, this is a disc quadrangulation. Since v 0 , w 2 , . . . , w j , v j forms part of the boundary of Q ′ , and deg using the induction hypothesis and the previous case) for each 0 < ℓ < j, there is no shorter path via v ℓ and so d Q (v 0 , v j ) = j. The case i > 0 and j = k is similar. Finally, v 0 w 2 · · · w k−2 v k is a path of length k − 2, and we cannot have Next we show the reverse implication. The distance conditions ensure that there is a path of length k − 2 ≥ 2 from v 0 to v k which is disjoint from v 1 , . . . , v k−1 . Write w 2 , . . . w k−2 for the vertices on the path other than v 0 and v k ; for ease of notation we also set w 1 = v 0 and w k−1 = v k . Since Q is chordless, each w i is internal for 2 ≤ i ≤ k − 2. It suffices to show that v i w i is an edge of Q for 2 ≤ i ≤ k − 2.
Indeed, the cycle C := v 0 · · · v k w k−2 · · · w 2 can have no chord other than these, since if j = i and w i v j is an edge then either the path v j w i · · · w k−2 v k or the path v 0 w 2 · · · w i v j contradicts a distance condition. Suppose not all of the required chords of C are edges of Q. Then there is some chordless cycle C ′ of length at least 6 in T whose vertices are vertices of C, and the boundary of C ′ consists of v i w i , v j w j and the paths w i w i+1 · · · w j and v i v i+1 · · · v j for some We consider the subquadrangulation Q ′ with boundary C ′ . Since Q ′ is chordless, we have either deg Q ′ (v i ) ≥ 3 or deg Q ′ (w i ) ≥ 3 (or both), and similarly for v j , w j . Thus Lemma 3.3 gives that one of the four distances However, in each case this contradicts a distance condition: respectively, the condition Next we show that identifying a nice configuration will allow us to reduce the problem of determining the quadrangulation to a smaller case.
Proof. Note first that if x, y ∈ V (Q ′ ) then d Q ′ (x, y) = d Q (x, y). This is true when x, y ∈ {v 0 , w 2 , . . . , w k−2 , v k } by Lemma 3.6, since a shorter route in Q between any two of these vertices would contradict the fact that d Q (v 0 , v k ) = k − 2. The corresponding fact for arbitrary x, y follows since any path which leaves Q ′ contains a subpath between two vertices of {v 0 , w 2 , . . . , w k−2 , v k }, which can be replaced by a shortest path in Q ′ between those two vertices.
Now suppose the desired result is not true, and for fixed z choose i for which We now have all the ingredients needed to complete the proof.
Proof of Theorem 1.2. We proceed by induction on the boundary length, n. By Lemma 3.2, if n < 8 then there are no internal vertices and we may identify Q from the pairs at distance 1. If Q has a chord, we may divide Q along the chord into two subquadrangulations Q 1 and Q 2 , for which we know all boundary distances, and hence by the induction hypothesis can determine in full.
Thus we may assume Q is chordless and n ≥ 8. By Lemma 3.4 there is a nice configuration, with boundary vertices v 0 , . . . , v k , say, which we may identify by Lemma 3.6. By Lemma 3.7, together with the induction hypothesis, we may deduce all boundary distances for the quadrangulation obtained by removing v 1 , . . . , v k−1 , and hence determine it precisely. Together with the known edges meeting v 1 , . . . , v k−1 , this determines Q.

Mixing triangles and quadrangles
Noting that the conditions of minimum degree 6 for triangles and 4 for quadrangles correspond to locally everywhere non-positive curvature, we might conjecture that a similar condition is sufficient to determine planar graphs where all internal faces are triangles or quadrangles by the distances between boundary vertices. In particular, the natural condition to impose on internal vertices is that 2t(v) + 3q(v) ≥ 12, where t(v), q(v) are the number of triangular and quadrangular faces containing v respectively. We first show that this has similar properties to the conditions on triangulations and quadrangulations, in that it excludes examples of the kind discussed in Section 1, that is, obtained by adding extra vertices inside a face. Proposition 4.1. Let G be a plane graph with a simple closed boundary of length n for which every internal face is a triangle or quadrangle. Suppose that G has at least one internal vertex, and every internal vertex satisfies 2t(v) + 3q(v) ≥ 12. Then n ≥ 6.
Proof. We may assume that G is chordless, since any counterexample with a chord must contain a chordless counterexample as a subgraph. Note that each internal vertex v has deg(v) = t(v) + q(v) ≥ 6 − q(v)/2. Consequently, denoting the set of internal vertices by I(G), we have where q i is the number of quadrangles containing exactly i internal vertices. We now add a diagonal to each quadrangle to form a triangulation T . If a quadrangle contains i internal vertices, we may ensure that the diagonal we add meets at least ⌈i/2⌉ internal vertices, and this also ensures that we do not create any Figure 4: A graph with zero curvature whose boundary distances are preserved by a rotation (left), and two non-isomorphic graphs with identical boundary distances (middle and right).
new chords (the fact that G is chordless means that every quadrangle meets at least one new vertex). Thus we have and so the average degree of internal vertices of T is at least 6. Now Lemma 2.11 gives the desired result.
However, this condition is not sufficient to determine the graph from its boundary distances, as the graphs in Figure 4 show. The left-hand graph has 2t(v) + 3q(v) = 12 for every internal vertex v, but has the property that each boundary vertex is at distance 1, 2 and 3 respectively from the next three vertices in either direction, and at distance 4 from the five remaining boundary vertices. In particular, the boundary distances are preserved by rotating the graph by π/6. Consequently, boundary distances cannot distinguish between the original example and its rotation if either appears anywhere in a planar graph. By adding some extra faces we can obtain two non-isomorphic graphs that satisfy the condition on internal vertices but nevertheless have identical boundary distances, for example the middle and right-hand graphs in Figure 4. The original graph, and one of the non-isomorphic pair but not the other, may be obtained as a section of the rhombitrihexagonal tiling after dividing each hexagon into six triangles.

Algorithmic considerations
Suppose we are given a cyclic list of boundary vertices and all distances between them. The proof of our main result gives a polynomial-time algorithm to determine whether there exists a triangulation with that boundary and all internal degrees at least 6 that achieves those distances (and in fact reconstructs the unique such triangulation, if one exists). One might naturally ask whether the decision problem can still be solved in polynomial time if we relax the minimum degree condition. In this case a triangulation, if it exists, will not be unique, but can we efficiently determine whether it exists? Observe that removing the degree condition gives a genuinely different question, since without it Lemma 2.5 is not necessarily satisfied.
Similar problems arise in other contexts, particularly for the identification and reconstruction of phylogenetic networks. A (binary) phylogenetic network is a rooted graph where every vertex is either a tree vertex, with two children and (unless it is the root) one parent; a leaf with no children and one parent; or a reticulation vertex with one child and two parents. Such networks represent divergence between taxa in evolutionary history, with reticulation vertices corresponding to hybridisation events.
Reconstruction of such networks from partial information is a key task in evolutionary biology. In particular, distance-based methods which seek to reconstruct the network from information about the lengths of paths between taxa (that is, leaves) are widely studied; here we may think of the set of leaves as the boundary of the network. Early work focussed on the simplest case of a phylogenetic tree, that is, a phylogenetic network without reticulation points. Simple necessary and sufficient conditions for a phylogenetic tree realising a set of boundary distances to exist, in terms of a relationship satisfied by the distances between any four vertices, were found by Zareckiȋ [15] and subsequently rediscovered by Buneman [6]. These apply to both weighted and unweighted trees, with an additional parity constraint for the latter, and give a straightforward quartic recognition algorithm.
If weighted networks are considered, one can always modify some weights while retaining all distances between leaves (for example, by choosing an internal vertex and transferring a fixed small amount of weight from each incoming edge to each outgoing edge), and so reconstruction is only possible up to equivalence under these and other transformations. Consequently we essentially have a recognition problem rather than reconstruction, though of course it is interesting to classify the precise equivalence up to which reconstruction is possible. This has been accomplished recently in various contexts. Bordewich and Semple [3] showed that under the assumption that the network is tree-child, that is, every non-leaf vertex has at least one child which is either a leaf or a tree vertex, knowing the lengths of all paths between each pair of leaves is sufficient to reconstruct a network efficiently, and this was subsequently extended to weighted networks [4]. Results closer to ours, in which only the shortest-path distance between each pair of leaves is given, have been obtained with the additional assumption of either an ultrametric tree-child network [5] or a normal tree-child network [2]. A polynomial-time recognition algorithm was also recently obtained for metrics arising from cactus graphs [12].
Returning to the question of recognising triangulations, it actually makes no difference whether we ask for a triangulation or, more simply, for a plane graph which achieves the given boundary distances. This is because any plane graph with given boundary can be extended to a triangulation of that boundary, without changing any distances between existing vertices. To do this, if an internal face has r > 3 edges, add a band of 2r triangles inside that face, leaving another r-face inside the band. Repeat this process ⌊r/4⌋ times, and then triangulate the final r-face ad lib. Notice that the addition of a band does not change the distance between two original vertices, and the edges added in the final triangulation are too far away from the original vertices to introduce a shorter path. Thus we ask the following.
Question 5.1. Given vertices v 1 , . . . , v n and all pairwise distances between them, is there a polynomial-time algorithm to determine whether there is a plane graph with simple boundary v 1 · · · v n v 1 realising those distances?
There are some non-trivial necessary conditions on the distances for such a graph to exist (that is, conditions which would not be necessary if the planarity requirement were dropped). In particular, we have the following condition satisfied by any four points (which can easily be checked in polynomial time). Proof. Note that if P 1 is an a-c path and P 2 is a b-d path then P 1 and P 2 must intersect. Choose P 1 and P 2 to be shortest paths, and let x be a point of intersection. Now since x is on each shortest path we have d(a, c) = d(a, x) + d(x, c) and d(b, d) = d(b, x) + d(x, d). However, d(a, b) ≤ d(a, x) + d(x, b) and d(c, d) ≤ d(c, x) + d(x, d), giving the result.
However, Proposition 5.2 (together with the distances forming an integer-valued metric) is not sufficient to ensure planarity. For example, boundary distances for the graph shown in Figure 5 satisfy Proposition 5.2, but no plane graph has the same boundary and boundary distances, since the only way to achieve d(v 0 , v 3 ) = d(v 1 , v 6 ) = d(v 4 , v 7 ) = 2 without crossing edges or adding external vertices is to identify x and y, reducing d(v 0 , v 4 ).
x y Figure 5: A graph whose boundary distances satisfy Proposition 5.2 but are not consistent with a plane graph having the same boundary.