arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:1009.1866v2 [cs.CG] 13 Dec 2013

Fat Polygonal Partitions with Applications
to Visualization and EmbeddingsThanks: A preliminary version of this paper appeared in the Proceedings of the 24th ACM Symposium on Computational Geometry [18].

Mark de Berg thanks: TU Eindhoven. Email: mdberg@win.tue.nl.    Krzysztof Onak thanks: IBM T.J. Watson Research Center. Email: krzysztof@onak.pl. Supported in part by NSF grants 0514771, 0728645, and 0732334. The research was done when the author was at a student at MIT.    Anastasios Sidiropoulos thanks: Dept.˜of Computer Science & Engineering, and Dept.˜of Mathematics, The Ohio State University. Email: sidiropoulos.1@osu.edu.
December 13, 2013
Abstract

Let 𝒯\mathcal{T} be a rooted and weighted tree, where the weight of any node is equal to the sum of the weights of its children. The popular Treemap algorithm visualizes such a tree as a hierarchical partition of a square into rectangles, where the area of the rectangle corresponding to any node in 𝒯\mathcal{T} is equal to the weight of that node. The aspect ratio of the rectangles in such a rectangular partition necessarily depends on the weights and can become arbitrarily high.

We introduce a new hierarchical partition scheme, called a polygonal partition, which uses convex polygons rather than just rectangles. We present two methods for constructing polygonal partitions, both having guarantees on the worst-case aspect ratio of the constructed polygons; in particular, both methods guarantee a bound on the aspect ratio that is independent of the weights of the nodes.

We also consider rectangular partitions with slack, where the areas of the rectangles may differ slightly from the weights of the corresponding nodes. We show that this makes it possible to obtain partitions with constant aspect ratio. This result generalizes to hyper-rectangular partitions in d{\mathbb{R}}^{d}. We use these partitions with slack for embedding ultrametrics into dd-dimensional Euclidean space: we give a polylog(Δ)\mathop{\rm polylog}(\Delta)-approximation algorithm for embedding nn-point ultrametrics into d\mathbb{R}^{d} with minimum distortion, where Δ\Delta denotes the spread of the metric, i.e., the ratio between the largest and the smallest distance between two points. The previously best-known approximation ratio for this problem was polynomial in nn. This is the first algorithm for embedding a non-trivial family of weighted-graph metrics into a space of constant dimension that achieves polylogarithmic approximation ratio.

1 Introduction

Hierarchical structures are commonplace in many areas. It is not surprising, therefore, that the visualization of hierarchical structures—in other words, of rooted trees—is one of the most widely studied problems in information visualization and graph drawing. In the weighted variant of the problem, we are given a rooted tree in which each leaf has a positive weight and the weight of each internal node is the sum of the weights of the leaves in its subtree. One of the most successful practical algorithms for visualizing such weighted trees is the so-called Treemap algorithm. Treemap visualizes the given tree by constructing a hierarchical rectangular partition of a square, as illustrated in Figure 1(a). More precisely, Treemap assigns a rectangle to each node in the tree such that

  • the area of the rectangle is equal to the weight of the node;

  • the rectangles of the children of each internal node ν\nu form a partition of the rectangle of ν\nu.

The Treemap algorithm was proposed by Shneiderman [21] and its first efficient implementation was given by Johnson and Shneiderman [14]. Treemap has been used to visualize a wide range of hierarchical data, including stock portfolios [15], news items [26], blogs [25], business data [24], tennis matches [13], photo collections [6], and file-system usage [21, 27]. Shneiderman maintains a webpage [20] that describes the history of his invention and gives an overview of applications and proposed extensions to his original idea. Below we only discuss the results that are directly related to our work.

In general, there are many different rectangular partitions corresponding to a given tree. To obtain an effective visualization it is desirable that the aspect ratio of the rectangles be kept as small as possible; this way the individual rectangles are easier to distinguish and the areas of the rectangles are easier to estimate. Various heuristics have been proposed for minimizing the aspect ratio of the rectangles in the partition [8, 22, 23]. Unfortunately, the aspect ratio can become arbitrarily bad if the weights have unfavorable values. For example, consider a tree with a root and two leaves, where the first leaf has weight 1 and the second has weight WW. Then the optimal aspect ratio of any rectangular partition is unbounded as WW\rightarrow\infty. Hence, in order to obtain guarantees on the aspect ratio we cannot restrict ourselves to rectangles. This lead Balzer et al. [2, 1] to introduce Voronoi treemaps, which use more general regions in the partition. However, their approach is heuristic and it does not come with any guarantees on the aspect ratio of the produced regions. Thus the following natural question is still open:

Suppose we are allowed to use arbitrary convex polygons in the partition, rather than just rectangles. Is it then always possible to obtain a partition that achieves aspect ratio independent of the weights of the nodes in the input tree? (The aspect ratio of a convex region AA is defined as diam(A)2/area(A)\diam(A)^{2}/\area(A), where diam(A)\diam(A) is its diameter and area(A)\area(A) is its area.11 1 Another common definition of the aspect ratio of a convex region AA is the ratio between the radius RR of the smallest circumscribing circle and the radius rr of the largest inscribed circle. The aspect ratio defined in this manner is sometimes referred to as the fatness of the region. There are several other definitions of fatness, all of which are equivalent up to constant factors for convex planar objects [11]. In particular, in our case it is easy to show that diam(A)=Θ(R)\diam(A)=\Theta(R) and area(A)=Θ(Rr)\area(A)=\Theta(R\cdot r), which implies that diam(A)2/area(A)=Θ(R/r)\diam(A)^{2}/\area(A)=\Theta(R/r). )

(a) A rectangular partition
(b) A greedy polygonal partition
(c) An angular polygonal partition
Figure 1: Sample polygonal partitions

Our results on hierarchical partitions.

Our main result is an affirmative answer to the question above: we present two algorithms that, given an nn-node tree of height hh, construct a partition into convex polygons with aspect ratio O(poly(h,logn))O(\mathop{\rm poly}(h,\log n)). Our algorithms, which are described in Section 2, are very simple. They first convert the input tree into a binary tree, and then recursively partition the initial square region using straight-line cuts. The methods differ in the way in which the orientation of the cutting line is chosen at each step. The greedy method minimizes the maximum aspect ratio of two subpolygons resulting from the cut, while the angular method maximizes the angle that the splitting line makes with any of the edges of the polygon being cut. Figures 1(b) and 1(c) depict partitions computed by our algorithms.

The main challenge lies in the analysis of the aspect ratio achieved by the algorithms, which is given in Sections 3 and 4. We prove that the angular method produces a partition with aspect ratio O(h+logn)O(h+\log n). For the greedy method we can only prove an aspect ratio of O((h+logn)8)O((h+\log n)^{8}). Since the greedy method is the most natural one, we believe this result is still interesting. Moreover, in the (limited) experiments we have done—see Section 2—the greedy method always outperforms the angular method. Besides these two algorithms, we also prove a lower bound: we show in Section 5 that for certain trees and weights, any partition into convex polygons must have polygons with aspect ratio Ω(h)\Omega(h).22 2 Recently de Berg, Speckmann, and van der Weele [10] refined our angular method to get rid of the additive O(logn)O(\log n) factor in the upper bound, thus obtaining a polygonal partition of aspect ratio O(h)O(h).

After having studied the problem of constructing polygonal partitions, we return to rectangular partitions. As observed, it is in general not possible to obtain any guarantees on the aspect ratio of the rectangles in the partition. If, however, we are willing to let the area of a rectangle deviate slightly from the weight of its corresponding node then we can obtain bounded aspect ratio, as we show in Section 6. More precisely, we obtain the following partition. Let ε(0,1/3)\varepsilon\in(0,1/3). We allow that the area AA of the rectangle assigned to every non-root node vv is shrunken by a factor of at most 1ε1-\varepsilon compared to its share of the area AA^{\prime} of the rectangle of the parent vv^{\prime}. That is, we only require that

(1ε)AwvAwvAwv,(1-\varepsilon)\cdot\frac{A^{\prime}}{w_{v^{\prime}}}\leq\frac{A}{w_{v}}\leq\frac{A^{\prime}}{w_{v^{\prime}}},

where wvw_{v} and wvw_{v^{\prime}} are the weights of vv and vv^{\prime}, respectively. Then we show that the aspect ratio of every rectangle can be bounded by 1/ε1/\varepsilon. We call this kind of partition a rectangular partition with slack.

Application to embedding ultrametrics.

The work of Bădoiu et al. [9] establishes a lower bound for the distortion of the best embedding of an ultrametric into d\mathbb{R}^{d}. Our hierarchical partitions with low aspect ratio can be used for efficiently constructing an embedding that closely matches the lower bound of Bădoiu et al. More details, including a brief history of relevant embedding results, follow.

Let us first recall a few standard definitions. A metric space M=(X,D)M=(X,D) is a set XX together with a symmetric distance function D:X×X0D\colon X\times X\rightarrow{\mathbb{R}}_{\geq 0} that satisfies the triangle inequality and D(x1,x2)=0D(x_{1},x_{2})=0 if and only if x1=x2x_{1}=x_{2}. An embedding of a metric space M=(X,D)M=(X,D) into a host metric space M=(X,D)M^{\prime}=(X^{\prime},D^{\prime}) is an injective mapping f:XXf\colon X\to X^{\prime}. The distortion of an embedding ff is defined as

maxx,yXD(f(x),f(y))D(x,y)maxx,yXD(x,y)D(f(x),f(y)).\max_{x,y\in X}\frac{D^{\prime}(f(x),f(y))}{D(x,y)}\cdot\max_{x,y\in X}\frac{D(x,y)}{D^{\prime}(f(x),f(y))}.

Over the past few decades, low-distortion embeddings of metric spaces into various host spaces have been the subject of extensive study [12]. Embeddings into Euclidean space are of particular importance in applications, and have received a lot of attention. Bourgain’s theorem [7] asserts that any nn-point metric space admits an embedding into high-dimensional Euclidean space with distortion O(logn)O(\log n). Matoušek [16] has shown that the minimum distortion for embedding into dd-dimensional Euclidean space is nΘ(1/d)logO(1)nn^{\Theta(1/d)}\cdot\log^{O(1)}n. Since the distortion for embedding into constant-dimensional Euclidean space can be polynomially large in the worst case, it is natural to ask whether we can approximate the best possible distortion for a given input metric. Matoušek and Sidiropoulos [17] have shown that minimum-distortion embeddings of general metrics into d{\mathbb{R}}^{d} (with d2d\geq 2) are hard to approximate to within a factor of roughly n1/(22d10)n^{1/(22d-10)}, unless p=np [17]. In other words, it is unlikely that there exists a polynomial-time algorithm with significantly better performance than the worst case guarantee.

In light of the above inapproximability result, it is natural to ask whether there exist interesting families of metrics, for which we can obtain better than polynomial approximation factors for embedding into constant-dimensional Euclidean space. In this paper we present the first result of this type, for embedding ultrametrics into d{\mathbb{R}}^{d}. An ultrametric is a metric satisfying the following strengthened version of the triangle inequality: for any x,y,zXx,y,z\in X we have D(x,z)max{D(x,y),D(y,z)}D(x,z)\leq\max\{D(x,y),D(y,z)\}. Equivalently, M=(X,D)M=(X,D) is an ultrametric if it can be realized as the shortest-path metric over the leaves of a rooted edge-weighted tree such that the distance between the root and any leaf is the same. Ultrametrics have received a lot of attention in the embeddings literature, and play a central role in many algorithmic applications (see e.g. [3]).

Bădoiu et al. [9] showed that finding a minimum-distortion embedding of an ultrametric into 2\mathbb{R}^{2} is np-complete and presented an O(n1/3)O(n^{1/3})-approximation algorithm for the problem. They extended the algorithm to embedding ultrametrics into d\mathbb{R}^{d}, obtaining an (n1dΘ(1d2))(n^{\frac{1}{d}-\Theta(\frac{1}{d^{2}})})-approximation. This result is obtained using a lower bound on the amount of space required in a non-contracting embedding of every subtree of an ultrametric into d\mathbb{R}^{d}. We apply our results on rectangular partitions with slack to a hierarchical structure corresponding to the ultrametric with weights given by the lower bound. Bounded aspect ratios in our partition imply relatively low distortion and good approximation to the best embedding of the ultrametric into d\mathbb{R}^{d}. Moreover, we show a connection between embedding ultrametrics into d{\mathbb{R}}^{d} and (hyper-)rectangular partitions with slack and we use this connection to obtain a significant improvement over the result of Bădoiu et al. [9]. More precisely, using our results on (hyper-)rectangular partitions with slack, we obtain a polynomial-time polylog(Δ)\mathop{\rm polylog}(\Delta)-approximation algorithm for the problem of embedding ultrametrics into (d,2)(\mathbb{R}^{d},\ell_{2}) with minimum distortion, where Δ\Delta is the spread of XX. (The spread of XX is defined as Δ=diam(X)/minx,yXD(x,y)\Delta=\diam(X)/\min_{x,y\in X}D(x,y).) As long as the spread is sub-exponential in nn, this is an exponential improvement over [9].

2 The two algorithms

Before we present our algorithms, we define the problem more formally and introduce some notation. Let 𝒯\mathcal{T} be a rooted tree. We say that 𝒯\mathcal{T} is properly weighted if each node ν𝒯\nu\in\mathcal{T} has a positive weight w(ν)w(\nu) that equals the sum of the weights of the children of ν\nu. We assume without loss of generality that w(root(𝒯))=1w(\myroot(\mathcal{T}))=1. A polygonal partition for a properly weighted tree assigns a convex polygon P(ν)P(\nu) to each node ν𝒯\nu\in\mathcal{T} such that

  • the polygon P(root(𝒯))P(\myroot(\mathcal{T})) is the unit square;

  • for any node ν\nu we have area(P(ν))=w(ν)\area(P(\nu))=w(\nu);

  • for any node ν\nu, the polygons assigned to the children of ν\nu form a disjoint partition of P(ν)P(\nu).

Recall that the aspect ratio of a planar convex region AA, denoted by asp(A)\ar(A), is defined as asp(A):=diam(A)2/area(A)\ar(A):=\diam(A)^{2}/\area(A). The aspect ratio of a polygonal partition is the maximum aspect ratio of any of the polygons in the partition. Our goal is to show that any properly weighted tree admits a fat polygon partition, that is, a polygonal partition with small aspect ratio.

We propose two methods for constructing fat polygonal partitions. They both start with transforming the input tree 𝒯\mathcal{T} into a binary tree 𝒯\mathcal{T}^{\prime}. The nodes of 𝒯\mathcal{T} are a subset of nodes of 𝒯\mathcal{T}^{\prime}, and two nodes are in the ancestor-descendant relation in 𝒯\mathcal{T} if and only if they are in the same relation in 𝒯\mathcal{T}^{\prime}. The weights assigned to nodes of 𝒯\mathcal{T} are preserved in 𝒯\mathcal{T}^{\prime}. Any polygonal partition for 𝒯\mathcal{T}^{\prime} restricted to nodes from 𝒯\mathcal{T} is a polygonal partition for 𝒯\mathcal{T}. Then, for the binary tree 𝒯\mathcal{T}^{\prime}, it suffices to design a method that cuts the polygon P(ν)P(\nu) corresponding to a node ν\nu into two polygons of prespecified areas that correspond to ν\nu’s children. We propose two such methods: the angular method and the greedy method. To achieve a polygonal partition for 𝒯\mathcal{T}^{\prime}, it suffices to recursively apply one of the cutting methods.

The transformation into a binary tree.

We transform the input nn-node tree 𝒯\mathcal{T} into a binary tree 𝒯\mathcal{T}^{\prime} by replacing every internal node ν\nu of degree greater than two by a collection of nodes whose subtrees together are exactly the subtrees of ν\nu. This can be done in such a way that height(𝒯)=O(height(𝒯)+logn)\mydepth(\mathcal{T}^{\prime})=O(\mydepth(\mathcal{T})+\log n) [19]. The number of nodes in 𝒯\mathcal{T}^{\prime} is O(n)O(n). For completeness we sketch how this transformation is done.

For a node ν\nu, we use 𝒯ν\mathcal{T}_{\nu} to denote the subtree rooted at ν\nu, and |𝒯ν||\mathcal{T}_{\nu}| to denote the number of nodes in 𝒯ν\mathcal{T}_{\nu}. The transformation is a recursive process, starting at the root of 𝒯\mathcal{T}. Suppose we reach a node ν\nu. If ν\nu has degree two or less, we just recurse on the at most two children of ν\nu. If ν\nu has degree k3k\geq 3, we proceed as follows. Let C(ν)C(\nu) be the set of children of ν\nu, and let μC(ν)\mu\in C(\nu) be the child with the largest number of nodes in its subtree. We partition C(ν){μ}C(\nu)\setminus\{\mu\} into two non-empty subsets C1(ν)C_{1}(\nu) and C2(ν)C_{2}(\nu) such that μC1(ν)|𝒯μ|<|𝒯ν|/2\sum_{\mu\in C_{1}(\nu)}|\mathcal{T}_{\mu}|<|\mathcal{T}_{\nu}|/2 and μC2(ν)|𝒯μ|<|𝒯ν|/2\sum_{\mu\in C_{2}(\nu)}|\mathcal{T}_{\mu}|<|\mathcal{T}_{\nu}|/2. We create three new nodes ν1,ν2,ν3\nu_{1},\nu_{2},\nu_{3} and modify the tree as shown in Figure 2. The weights w(ν1),w(ν2),w(ν3)w(\nu_{1}),w(\nu_{2}),w(\nu_{3}) are set to the sum of the weights of the leaves in their respective subtrees. Finally, we recurse on ν1\nu_{1}, μ\mu, and ν3\nu_{3}.

Figure 2: Transforming a tree to a binary tree.

After the procedure has finished we have a (properly weighted) tree in which every node has degree at most two. We remove all degree-1 nodes to obtain our binary tree 𝒯\mathcal{T}^{\prime}. The height of 𝒯\mathcal{T}^{\prime} is at most 2(height(𝒯)+logn)2(\mydepth(\mathcal{T})+\log n), because every time we go down two levels in 𝒯\mathcal{T}^{\prime} we either pass through an original node from 𝒯\mathcal{T} or the number of nodes in the subtree halves.

Figure 3: Sample executions of our cutting methods.

Methods for cutting a polygon.

Suppose we have to cut a convex polygon P(ν)P(\nu) into two subpolygons. Note that if we fix an orientation for the cut, then there are only two choices left for the cut because the areas of the subpolygons are prespecified. (The two choices correspond to having the smaller of the two areas to the left or to the right of the cut.) Our cutting methods, depicted in Figure 3 are the following.

  • Angular: Let cc denote the cut, that is, the line segment separating the two subpolygons of P(ν)P(\nu). We select the orientation of cc such that we maximize

    min{angle(c,e):e is an edge of the input polygon},\min\{\myangle(c,e):\hbox{$e$ is an edge of the input polygon}\},

    where angle(c,e)\myangle(c,e) is the smaller of the angles between the lines (c)\ell(c) and (e)\ell(e) containing cc and ee, respectively. In other words, we cut in a direction as different as possible from all the orientations determined by the edges of the polygon. We then take any of the two cuts of the selected orientation.

  • Greedy: The greedy method selects the cut that minimizes the maximum of the aspect ratios of the two subpolygons.

Experiments.

To get an idea of the relative performance of the two methods we implemented them and performed some experiments. Table 1 shows the results on two hierarchies. One is synthetic and was generated using a random process, the other is the home directory with all subfolders of one of the authors. Leaves in the latter hierarchy are the files in any of the folders, and the weight of a leaf is the size of the corresponding file. For comparison, we also ran two additional partitioning methods. Both of these methods use the transformation of the input into a binary tree. The random method always makes a cut in a random direction. In the greedy rectangular method, all polygons are rectangles and all cuts are parallel to the sides of the original rectangle. The method always greedily chooses the cut that is perpendicular to the longer side, which maximizes the aspect ratio of the two subpolygons resulting from the cut.

Method Synthetic Data Home Folder
Average Maximum Average Maximum
Angular 3.79 13.19 3.87 20.11
Greedy 2.56 6.79 2.57 8.39
Random 5.79 355.14 6.26 1609.66
Greedy Rectangular 3.52 1445.99 24.49 230308.30
Table 1: Aspect ratios of partitions generated by various methods

In all our tests, the methods partitioned a square. The greedy method performs best, closely followed by the angular method. Interestingly, the greedy rectangular method performs even worse than the random method—apparently restricting to rectangles is a very bad idea as far as aspect ratio is concerned.

In the next two sections we prove that both the angular method and the greedy method construct a partition in which the aspect ratios are O(poly(height𝒯+logn))O(\mathop{\rm poly}(\mydepth{\mathcal{T}}+\log n)). For the angular method, the proof is simpler and gives a better bound on the worst-case aspect ratio. We present the more complicated proof for the greedy method because it is the most natural method and it has the best performance in practice.

3 Analysis of angular partitions

The idea behind the angular partitioning method is that a polygon with large aspect ratio must have two edges that are almost parallel. Hence, if we avoid using partition lines whose orientations are too close to each other, then we can control the aspect ratio of our subpolygons. Next we make this idea precise.

Let UU be the initial unit square that we partition, and let ϕ>0\phi>0 be a parameter. Recall that for two line segments ee and ee^{\prime}, we use angle(e,e)\myangle(e,e^{\prime}) to denote the smaller angle defined by the lines (e)\ell(e) and (e)\ell(e^{\prime}) containing ee and ee^{\prime}, respectively. We define a convex polygon PUP\subset U to be a ϕ\phi-separated polygon if it satisfies the following condition. For any two distinct edges ee and ee^{\prime}, we have:

  1. (i)

    angle(e,e)ϕ\myangle(e,e^{\prime})\geq\phi; or

  2. (ii)

    ee is contained in UU’s top edge and ee^{\prime} is contained in UU’s bottom edge (or vice versa); or

  3. (iii)

    ee is contained in UU’s left edge and ee^{\prime} is contained in UU’s right edge (or vice versa).

Lemma 1.

The aspect ratio of a ϕ\phi-separated polygon PP is O(1/ϕ)O(1/\phi).

Proof.

Let d:=diam(P)d:=\diam(P) and let uvuv be a diagonal of PP that has length dd. Consider the bounding box BB of PP that has two edges parallel to uvuv. We call the edge of BB parallel to and above uvuv its top edge, and the edge of BB parallel to and below uvuv its bottom edge. Let rr be a vertex of PP on the top edge of BB and let ss be a vertex on its bottom edge—see Fig. 4.

Figure 4: Illustration for the proof of Lemma 1.

Let e1e_{1} and e2e_{2} be the edges of PP incident to rr, and let e3e_{3} and e4e_{4} be the edges incident to ss. Let the angles α1,,α4\alpha_{1},\ldots,\alpha_{4} be defined as in Fig. 4. We distinguish two cases.

  • Case (a): none of e1,e2,e3,e4e_{1},e_{2},e_{3},e_{4} are parallel.
    By condition (i), this implies that the angles any two edges make is at least ϕ\phi. Hence, we have

    ϕ\displaystyle\phi angle(e1,e3)max(α1,α3),\displaystyle\leq\myangle(e_{1},e_{3})\leq\max(\alpha_{1},\alpha_{3}), (1)
    ϕ\displaystyle\phi angle(e2,e4)max(α2,α4),\displaystyle\leq\myangle(e_{2},e_{4})\leq\max(\alpha_{2},\alpha_{4}), (2)
    ϕ\displaystyle\phi angle(e1,e4)α1+α4,\displaystyle\leq\myangle(e_{1},e_{4})\leq\alpha_{1}+\alpha_{4}, (3)
    ϕ\displaystyle\phi angle(e2,e3)α2+α3.\displaystyle\leq\myangle(e_{2},e_{3})\leq\alpha_{2}+\alpha_{3}. (4)

    By (3) we have α1+α4ϕ\alpha_{1}+\alpha_{4}\geq\phi. Now assume without loss of generality that α1ϕ/2\alpha_{1}\geq\phi/2. If α2ϕ/2\alpha_{2}\geq\phi/2 as well, then

    area(uvr)(d2/4)sin(ϕ/2).\area(uvr)\geq(d^{2}/4)\cdot\sin(\phi/2).

    Since uvrPuvr\subset P, this implies that

    asp(P)d2(d2/4)sin(ϕ/2)=O(1/ϕ).\ar(P)\leq\frac{d^{2}}{(d^{2}/4)\cdot\sin(\phi/2)}=O(1/\phi).

    If α2<ϕ/2\alpha_{2}<\phi/2, then we use (2) and (4) to conclude that α4ϕ\alpha_{4}\geq\phi and α3ϕ/2\alpha_{3}\geq\phi/2. Hence, we now have area(uvs)(d2/4)sin(ϕ/2)\area(uvs)\geq(d^{2}/4)\cdot\sin(\phi/2), which implies that asp(P)=O(1/ϕ)\ar(P)=O(1/\phi).

  • Case (b): some edges in e1,e2,e3,e4e_{1},e_{2},e_{3},e_{4} are parallel.
    By conditions (i)–(iii), two edges of PP can be parallel only if they are contained in opposite edges of UU. Hence, |rs|1|rs|\geq 1. Moreover, since uvuv defines the diameter we have |uv||rs||uv|\geq|rs|. Let α:=angle(uv,rs)\alpha:=\myangle(uv,rs), as illustrated in Fig. 5.

    Figure 5: The case of parallel edges.

    If αmin{ϕ,π/4}\alpha\geq\min\{\phi,\pi/4\}, this is easily seen to imply that area(P)area(urvs)=Ω(ϕ)\area(P)\geq\area(urvs)=\Omega(\phi), which means that asp(P)=O(1/ϕ)\ar(P)=O(1/\phi). Now consider the case where α<ϕ\alpha<\phi and α<π/4\alpha<\pi/4. We show that this leads to a contradiction. Let x:=uvrsx:=uv\cap rs and assume without loss of generality that, as in Figure 5, we have α=rxv\alpha=\angle rxv. Then angle(e1,e3)α<ϕ\myangle(e_{1},e_{3})\leq\alpha<\phi. By conditions (i)–(iii) this can only happen if e1e_{1} and e3e_{3} are contained in opposite edges of UU, if we assume that rr and ss are chosen such that they maximize the distances between rr and ss, which can be done without loss of generality. We have angle(e3,rs)angle(uv,rs)=αϕ<π/4\myangle(e_{3},rs)\leq\myangle(uv,rs)=\alpha\leq\phi<\pi/4. However, it is impossible to place two points rr and ss on opposite sides of UU such that angle(e3,rs)<π/4\myangle(e_{3},rs)<\pi/4. The smallest angle one can obtain is π/4\pi/4.

To construct a polygonal partition we use the procedure described in Section 2. Thus, we first transform the input tree 𝒯\mathcal{T} into a corresponding binary tree 𝒯\mathcal{T}^{\prime}. Next, we recursively apply the angular cutting method to 𝒯\mathcal{T}^{\prime}, that is, at each node ν\nu, we cut the polygon P(ν)P(\nu), using a cut cc that maximizes the minimum angle cc makes with any of the edges of P(ν)P(\nu).

Lemma 2.

Let P(ν)P(\nu) be the subpolygon generated by the algorithm above for a node ν\nu at level kk in 𝒯\mathcal{T}^{\prime}. Then P(ν)P(\nu) is a (π/(2k+6))(\pi/(2k+6))-separated polygon.

Proof.

The proof is by induction on kk.

For k=0k=0, we have ν=root(𝒯)\nu=\myroot(\mathcal{T}^{\prime}) and P(ν)P(\nu) is a unit square. Hence, P(ν)P(\nu) is (π/2)(\pi/2)-separated and therefore also (π/6)(\pi/6)-separated.

For k>0k>0 we argue as follows. By the induction hypothesis, the polygon P(μ)P(\mu) corresponding to the parent μ\mu of ν\nu is (π/(2k+4))(\pi/(2k+4))-separated. Moreover, by construction it has at most 4+(k1)=k+34+(k-1)=k+3 edges. Consider the sorted (circular) sequence of angles that these edges make with the xx-axis. By the pigeon-hole principle, there must be two adjacent angles that are at least π/(k+3)\pi/(k+3) apart. Hence, the cut cc that is chosen to partition P(μ)P(\mu) makes an angle at least π/(2k+6)\pi/(2k+6) with all edges of P(μ)P(\mu), and by the induction hypothesis, all the other angles are at least π/(2k+4)\pi/(2k+4). ∎

Recall that the height of the binary tree 𝒯\mathcal{T}^{\prime} is O(height(𝒯)+logn)O(\mydepth(\mathcal{T})+\log n). Hence, we get the following theorem.

Theorem 1.

Let 𝒯\mathcal{T} be a properly weighted tree with nn nodes. Then the angular partitioning method constructs a polygonal partition for 𝒯\mathcal{T} whose aspect ratio is O(height(𝒯)+logn)O(\mydepth(\mathcal{T})+\log n).

4 Analysis of greedy partitions

We now turn our attention to the greedy method, which at each step chooses a cut cc that minimizes the maximum aspect ratio of the two subpolygons resulting from the cut. The main component of our proof that polygonal partitions with good properties exist will be the following lemma. It shows that there is always a way to cut a polygon into two smaller polygons of required areas so that the aspect ratios of the new subpolygons are bounded.

Note that the lemma requires that the number of vertices in the polygon be bounded. If the number of vertices is unbounded, the polygon may become arbitrarily close to a circle. In this case there is no good cut if one of the resulting polygons has to be much smaller than the other.

The proof of the lemma is long and consists of a case analysis. An impatient reader may prefer to omit the proof and move directly to Theorem 2.

Lemma 3 (Good cuts).

Let P2P\subset\mathbb{R}^{2} be a convex polygon with kk vertices, and let a(0,1/2]a\in(0,1/2]. Then PP can be partitioned into two convex polygons P1P_{1} and P2P_{2} such that

  • Each of the P1P_{1} and P2P_{2} has at most k+1k+1 vertices.

  • area(P1)=aarea(P)\area(P_{1})=a\cdot\area(P), and area(P2)=(1a)area(P)\area(P_{2})=(1-a)\cdot\area(P).

  • max{asp(P1),asp(P2)}max{asp(P)(1+6k),k8}\max\{\ar(P_{1}),\ar(P_{2})\}\leq\max\left\{\ar(P)\left(1+\frac{6}{k}\right),k^{8}\right\}.

Proof.

We distinguish two cases, depending on whether a1/k2a\leq 1/k^{2} (that is, we are cutting off a relatively small subpolygon) or not.

Case 1: a1/k2a\leq 1/k^{2}. Let ϕ\phi be the smallest angle of PP, and let vv be a vertex of PP whose interior angle is ϕ\phi. Since PP has kk vertices, we have

ϕπ(12k).\phi\leq\pi\left(1-\frac{2}{k}\right).

Let \ell be the angular bisector at vv. Consider the cut cc orthogonal to \ell such that area(P1)=aarea(P)\area(P_{1})=a\cdot\area(P), where P1P_{1} is the subpolygon induced by cc having vv as a vertex—see Figure 6(a) for an illustration. Let P2P_{2} be the other subpolygon. Clearly, P1P_{1} and P2P_{2} are convex polygons of the required area with at most k+1k+1 vertices each. Therefore, it remains to bound the aspect ratios of P1P_{1} and P2P_{2}.

Since P2PP_{2}\subset P, we have

asp(P2)\displaystyle\ar(P_{2}) =diam(P2)2area(P2)diam(P)2(1a)area(P)=asp(P)1a<asp(P)(1+2a)\displaystyle=\frac{\diam(P_{2})^{2}}{\area(P_{2})}\leq\frac{\diam(P)^{2}}{(1-a)\cdot\area(P)}=\frac{\ar(P)}{1-a}<\ar(P)\left(1+2a\right)
<asp(P)(1+2k2)<asp(P)(1+1k).\displaystyle<\ar(P)\left(1+\frac{2}{k^{2}}\right)<\ar(P)\left(1+\frac{1}{k}\right).

We next bound asp(P1)\ar(P_{1}). Let x1,x2x_{1},x_{2} be the two endpoints of the cut cc, and let tt be the distance between x1x_{1} and x2x_{2}. Let hh be the distance from vv to cc. We distinguish between two subcases.

(a) Case 1.
(b) Case 1.2.
Figure 6: Partitioning PP into P1P_{1} and P2P_{2} when a1/k2a\leq 1/k^{2}.

Case 1.1: th/k2t\geq h/k^{2}. Since PP is convex, the triangle vx1x2vx_{1}x_{2} is contained in P1P_{1}. Therefore,

area(P1)ht/2h2/(2k2).\area(P_{1})\geq h\cdot t/2\geq h^{2}/(2k^{2}).

On the other hand, since cc is normal to the bisector of the angle of vv, it follows that P1P_{1} is contained inside a rectangle of width hh and height HH, with

H\displaystyle H 2htan(ϕ/2)2htan(π(12/k)2)\displaystyle\leq 2\cdot h\cdot\tan(\phi/2)\leq 2\cdot h\cdot\tan\left(\frac{\pi(1-2/k)}{2}\right)
2h/tan(π/k)2hk/π.\displaystyle\leq 2\cdot h/\tan(\pi/k)\leq 2\cdot h\cdot k/\pi.

Thus, diam(P1)<h(1+2k/π)\diam(P_{1})<h(1+2\cdot k/\pi). It follows that

asp(P1)=diam(P1)2area(P1)<(h+2hk/π)2h2/(2k2)<k5.\ar(P_{1})=\frac{\diam(P_{1})^{2}}{\area(P_{1})}<\frac{(h+2\cdot h\cdot k/\pi)^{2}}{h^{2}/(2k^{2})}<k^{5}.

Case 1.2: t<h/k2t<h/k^{2}. Let 1\ell_{1} be the line passing through vv and x1x_{1}, and let 2\ell_{2} be the line passing through vv and x2x_{2}. Let γ\gamma be the angle between 1\ell_{1} and 2\ell_{2}. Observe that P2P_{2} is contained between 1\ell_{1} and 2\ell_{2}. Therefore, if uu is the point in P2P_{2} farthest away from vv we have

γ2ππ|uv|2area(P2),\frac{\gamma}{2\pi}\pi|uv|^{2}\geq\area(P_{2}),

where |uv||uv| denotes the length of the segment uvuv. It follows that

diam(P)2|uv|22γ(1a)area(P).\diam(P)^{2}\geq|uv|^{2}\geq\frac{2}{\gamma}(1-a)\cdot\area(P).

Therefore,

asp(P)=diam(P)2area(P)2γ(1a)2γ(11k2).\ar(P)=\frac{\diam(P)^{2}}{\area(P)}\geq\frac{2}{\gamma}\left(1-a\right)\geq\frac{2}{\gamma}\left(1-\frac{1}{k^{2}}\right).

We now give an upper bound on the diameter of P1P_{1}. Assume without loss of generality that |vx2||vx1||vx_{2}|\geq|vx_{1}|. Consider a segment y1y2y_{1}y_{2} parallel to x1x2x_{1}x_{2} with y1,y2Py_{1},y_{2}\in\bd P such that y1y2y_{1}y_{2} lies between x1x2x_{1}x_{2} and vv—see Figure 6(b). Let hh^{\prime} be the distance between vv and y1y2y_{1}y_{2}. We first argue that |y1y2|2t|y_{1}y_{2}|\leq 2t.

Assume for the sake of contradiction that |y1y2|>2t|y_{1}y_{2}|>2t. Let g1g_{1} be the line passing through y1y_{1} and x1x_{1}, and let g2g_{2} be the line passing through y2y_{2} and x2x_{2}. Observe that since |y1y2|>|x1x2||y_{1}y_{2}|>|x_{1}x_{2}|, the lines g1g_{1} and g2g_{2} intersect in a point ww such that P2P_{2} is contained in the triangle x1x2wx_{1}x_{2}w. Furthermore, the polygon vy1x1x2y2vy_{1}x_{1}x_{2}y_{2} is contained in P1P_{1}. If hh/2h^{\prime}\geq h/2, then the area of the triangle vy1y2vy_{1}y_{2} is greater or equal to the area of the triangle x1x2wx_{1}x_{2}w. Therefore, area(P1)area(P2)\area(P_{1})\geq\area(P_{2}), contradicting the fact that a1/k2a\leq 1/k^{2}. If, on the other hand, h<h/2h^{\prime}<h/2, then the area of the quadrilateral y1x1x2y2y_{1}x_{1}x_{2}y_{2}, is greater than the area of the triangle x1x2wx_{1}x_{2}w, again implying that area(P1)area(P2)\area(P_{1})\geq\area(P_{2}), a contradiction. Therefore, we obtain that |y1y2|2t|y_{1}y_{2}|\leq 2t.

It now follows that any point qP1q\in P_{1} is at distance at most 2t2t from the line segment vx2vx_{2}. Moreover, we have t<h/k2|vx2|/k2t<h/k^{2}\leq|vx_{2}|/k^{2}. Hence,

diam(P1)=maxq,qP1|qq|2t+|vx2|+2t|vx2|(1+4k2).\diam(P_{1})=\max_{q,q^{\prime}\in P_{1}}|qq^{\prime}|\leq 2t+|vx_{2}|+2t\leq|vx_{2}|\left(1+\frac{4}{k^{2}}\right).

Let xx^{*} be the point on the line segment x1x2x_{1}x_{2} that is closest to vv. Since |vx2|h|vx_{2}|\geq h, we have

area(P1)γ2ππ|vx|2γ2(|vx2|t)2γ2|vx2|2(11k2).\area(P_{1})\geq\frac{\gamma}{2\pi}\pi|vx^{*}|^{2}\geq\frac{\gamma}{2}(|vx_{2}|-t)^{2}\geq\frac{\gamma}{2}|vx_{2}|^{2}\left(1-\frac{1}{k^{2}}\right).

Therefore,

asp(P1)\displaystyle\ar(P_{1}) =diam(P1)2area(P1)2γ(1+4/k2)211/k2asp(P)(1+4/k2)2(11/k2)2\displaystyle=\frac{\diam(P_{1})^{2}}{\area(P_{1})}\leq\frac{2}{\gamma}\cdot\frac{(1+4/k^{2})^{2}}{1-1/k^{2}}\leq\ar(P)\frac{(1+4/k^{2})^{2}}{(1-1/k^{2})^{2}}
asp(P)(1+6/k2)2asp(P)(1+2/k)2\displaystyle\leq\ar(P)\cdot(1+6/k^{2})^{2}\leq\ar(P)\cdot(1+2/k)^{2}
asp(P)(1+6/k).\displaystyle\leq\ar(P)\cdot(1+6/k).

Case 2: a>1/k2a>1/k^{2}.

Case 2.1: asp(P)k6\ar(P)\leq k^{6}. In this case any cut giving the two subpolygons P1P_{1} and P2P_{2} the required areas works. Indeed,

asp(P1)=diam(P1)2area(P1)diam(P)2aarea(P)k2asp(P)k8\ar(P_{1})=\frac{\diam(P_{1})^{2}}{\area(P_{1})}\leq\frac{\diam(P)^{2}}{a\cdot\area(P)}\leq k^{2}\cdot\ar(P)\leq k^{8}

and

asp(P2)=diam(P2)2area(P2)diam(P)2(1a)area(P)2asp(P)2k6<k7.\ar(P_{2})=\frac{\diam(P_{2})^{2}}{\area(P_{2})}\leq\frac{\diam(P)^{2}}{(1-a)\cdot\area(P)}\leq 2\cdot\ar(P)\leq 2\cdot k^{6}<k^{7}.

Case 2.2: asp(P)>k6\ar(P)>k^{6}. Pick points v1,v2Pv_{1},v_{2}\in P, such that |v1v2|=diam(P)|v_{1}v_{2}|=\diam(P). For each z[0,diam(P)]z\in[0,\diam(P)], let (z)\ell(z) be a line normal to v1v2v_{1}v_{2} that is at distance zz from v1v_{1} and intersects PP. Note that (0)\ell(0) contains v1v_{1} and (diam(P))\ell(\diam(P)) contains v2v_{2}. Define f(z)f(z) to be the length of the intersection of PP with (z)\ell(z). Observe that

area(P)=z=0diam(P)f(z)𝑑z\area(P)=\int_{z=0}^{\diam(P)}f(z)dz

Pick s1,s2[0,diam(P)]s_{1},s_{2}\in[0,\diam(P)], so that

aarea(P)=z=0s1f(z)𝑑z=z=diam(P)s2diam(P)f(z)𝑑z.a\cdot\area(P)=\int_{z=0}^{s_{1}}f(z)dz=\int_{z=\diam(P)-s_{2}}^{\diam(P)}f(z)dz.

Let Q1Q_{1} be the part of PP that is contained between (0)\ell(0) and (s1)\ell(s_{1}). Similarly, let Q2Q_{2} be the part of PP that is contained between (diam(P)s2)\ell(\diam(P)-s_{2}) and (diam(P))\ell(\diam(P)). Clearly, both Q1Q_{1} and Q2Q_{2} are convex polygons with at most k+1k+1 vertices.

Figure 7: Partitioning PP into P1P_{1} and P2P_{2}, when α>1/k2\alpha>1/k^{2}: Case 2.2.

First, we will show that

min{area(Q1)s1,area(Q2)s2}area(P)diam(P)\min\left\{\frac{\area(Q_{1})}{s_{1}},\frac{\area(Q_{2})}{s_{2}}\right\}\leq\frac{\area(P)}{\diam(P)}

Assume for a contradiction that both area(Q1)/s1\area(Q_{1})/s_{1} and area(Q2)/s2\area(Q_{2})/s_{2} are greater than area(P)/diam(P)\area(P)/\diam(P). It follows that there exist z1[0,s1]z_{1}\in[0,s_{1}] and z2[diam(P)s2]z_{2}\in[\diam(P)-s_{2}] such that f(z1)>area(P)/diam(P)f(z_{1})>\area(P)/\diam(P) and f(z2)>area(P)/diam(P)f(z_{2})>\area(P)/\diam(P). Since PP is convex, ff is a bitonic function. Therefore, for each z[z1,z2]z\in[z_{1},z_{2}], we have f(z)>area(P)/diam(P)f(z)>\area(P)/\diam(P). It follows that

area(P)=area(Q1)+area(Q2)+area(P(Q1Q2))>area(P)diam(P)diam(P),\area(P)=\area(Q_{1})+\area(Q_{2})+\area(P\setminus(Q_{1}\cup Q_{2}))>\frac{\area(P)}{\diam(P)}\cdot\diam(P),

a contradiction.

We can therefore assume without loss of generality that

area(Q1)s1area(P)diam(P).\frac{\area(Q_{1})}{s_{1}}\leq\frac{\area(P)}{\diam(P)}.

Note that this implies

s1adiam(P).s_{1}\geq a\cdot\diam(P).

We set P1=Q1P_{1}=Q_{1}, and P2=PQ1P_{2}=P\setminus Q_{1}. It remains to bound asp(P1)\ar(P_{1}) and asp(P2)\ar(P_{2}).

By the convexity of PP, we have

area(P)maxz[0,diam(P)]f(z)diam(P)/2.\area(P)\geq\max_{z\in[0,\diam(P)]}f(z)\cdot\diam(P)/2.

Since asp(P)>k6\ar(P)>k^{6}, it follows that

maxz[0,diam(P)]f(z)2area(P)diam(P)2diam(P)<2k6diam(P).\max_{z\in[0,\diam(P)]}f(z)\leq 2\cdot\frac{\area(P)}{\diam(P)^{2}}\cdot\diam(P)<\frac{2}{k^{6}}\cdot\diam(P).

This implies that PP is contained inside a rectangle with one edge of length diam(P)\diam(P) parallel to v1v2v_{1}v_{2}, and one edge of length 4k6diam(P)\frac{4}{k^{6}}\cdot\diam(P) normal to v1v2v_{1}v_{2}. Thus,

diam(P1)s1+4k6diam(P).\diam(P_{1})\leq s_{1}+\frac{4}{k^{6}}\cdot\diam(P).

Let σ1\sigma_{1}, σ2\sigma_{2} be the two points where (s1)\ell(s_{1}) intersects P\bd P. Let ζ1\zeta_{1}, ζ2\zeta_{2}, be the lines passing through v1v_{1} and σ1\sigma_{1}, and v1v_{1} and σ2\sigma_{2}, respectively. Let also σ1\sigma_{1}^{\prime} and σ2\sigma_{2}^{\prime} be the points where ζ1\zeta_{1} and ζ2\zeta_{2}, respectively, intersect (diam(P))\ell(\diam(P))—see Figure 7.

By the convexity of PP and P1P_{1}, we have

area(P1)area(v1σ1σ2)=(s1diam(P))2area(v1σ1σ2)(s1diam(P))2area(P).\area(P_{1})\geq\area(v_{1}\sigma_{1}\sigma_{2})=\left(\frac{s_{1}}{\diam(P)}\right)^{2}\cdot\area(v_{1}\sigma_{1}^{\prime}\sigma_{2}^{\prime})\geq\left(\frac{s_{1}}{\diam(P)}\right)^{2}\cdot\area(P).

Since area(P1)=aarea(P)\area(P_{1})=a\cdot\area(P), it follows that s1adiam(P).s_{1}\leq\sqrt{a}\cdot\diam(P). Using that a>1/k2a>1/k^{2} we can now derive

asp(P1)\displaystyle\ar(P_{1}) =diam(P1)2area(P1)(s1+4diam(P)/k6)2area(P1)\displaystyle=\frac{\diam(P_{1})^{2}}{\area(P_{1})}\leq\frac{(s_{1}+4\cdot\diam(P)/k^{6})^{2}}{\area(P_{1})}
(adiam(P)+4diam(P)/k6)2aarea(P)\displaystyle\leq\frac{(\sqrt{a}\cdot\diam(P)+4\cdot\diam(P)/k^{6})^{2}}{a\cdot\area(P)}
<diam(P)2area(P)(1+4k6a)2asp(P)(1+8k4+16k16)\displaystyle<\frac{\diam(P)^{2}}{\area(P)}\cdot\left(1+\frac{4}{k^{6}\sqrt{a}}\right)^{2}\leq\ar(P)\cdot\left(1+\frac{8}{k^{4}}+\frac{16}{k^{16}}\right)
asp(P)(1+1k).\displaystyle\leq\ar(P)\cdot\left(1+\frac{1}{k}\right).

Since ff is bitonic, it follows that

minz[s1,diam(P)s2]f(z)min{maxz[0,s1]f(z),maxz[diam(P)s2,diam(P)]f(z)}.\min_{z\in[s_{1},\diam(P)-s_{2}]}f(z)\geq\min\left\{\max_{z\in[0,s_{1}]}f(z),\max_{z\in[\diam(P)-s_{2},\diam(P)]}f(z)\right\}.

Therefore,

area(P2)diam(P)s1area(P1)s1.\frac{\area(P_{2})}{\diam(P)-s_{1}}\geq\frac{\area(P_{1})}{s_{1}}.

Because P2P_{2} is contained in a rectangle with one edge of length diam(P)s1\diam(P)-s_{1} parallel to v1v2v_{1}v_{2}, and one edge of length 4k6diam(P)\frac{4}{k^{6}}\cdot\diam(P) normal to v1v2v_{1}v_{2}, we have

diam(P2)diam(P)s1+4k6diam(P).\diam(P_{2})\leq\diam(P)-s_{1}+\frac{4}{k^{6}}\cdot\diam(P).

Putting everything together, we get

asp(P2)\displaystyle\ar(P_{2}) =diam(P2)2area(P2)(diam(P)(1+4/k6)s1)2(1a)area(P)\displaystyle=\frac{\diam(P_{2})^{2}}{\area(P_{2})}\leq\frac{(\diam(P)\cdot(1+4/k^{6})-s_{1})^{2}}{(1-a)\cdot\area(P)}
asp(P)(1+4/k6a1a)2asp(P)(1+42k6)2\displaystyle\leq\ar(P)\cdot\left(\frac{1+4/k^{6}-a}{\sqrt{1-a}}\right)^{2}\leq\ar(P)\cdot\left(1+4\cdot\frac{\sqrt{2}}{k^{6}}\right)^{2}
asp(P)(1+1k2)2asp(P)(1+3k2)\displaystyle\leq\ar(P)\cdot\left(1+\frac{1}{k^{2}}\right)^{2}\leq\ar(P)\cdot\left(1+\frac{3}{k^{2}}\right)
asp(P)(1+1k).\displaystyle\leq\ar(P)\cdot\left(1+\frac{1}{k}\right).

This concludes the proof. ∎

Now we have all the necessary tools to prove a bound on the aspect ratio of the polygonal partition constructed by the greedy method.

Theorem 2.

Let 𝒯\mathcal{T} be a properly weighted tree with nn nodes. Then the greedy partitioning method constructs a polygonal partition for 𝒯\mathcal{T} whose aspect ratio is O((height(𝒯)+logn)8)O\left(\left(\mydepth(\mathcal{T})+\log{n}\right)^{8}\right).

Proof.

Recall from Section 2 that our algorithm starts by transforming 𝒯\mathcal{T} to a binary tree 𝒯\mathcal{T}^{\prime} of height O(height(𝒯)+logn)O(\mydepth(\mathcal{T})+\log n). This is done in such a way that a polygonal partition for 𝒯\mathcal{T}^{\prime} induces a polygonal partition for 𝒯\mathcal{T} of the same (or better) aspect ratio. We then recursively apply the greedy cutting strategy to 𝒯\mathcal{T}^{\prime}. Hence, it suffices to show that a recursive application of the greedy strategy to a binary tree of height hh produces a polygonal partition of aspect ratio (h+3)8(h+3)^{8}.

Let A(i)A(i) be the worst-case aspect ratio of a polygon P(ν)P(\nu) produced by the greedy method over all nodes ν\nu at depth ii in the tree. Note that P(root(𝒯))P(\myroot(\mathcal{T})) is a square and each polygon at depth ii has at most i+4i+4 vertices. By Lemma 3 we thus have

A(i){2if i=0,max{(i+3)8,(1+6i+3)A(i1)}if i>0.A(i)\leq\begin{cases}2&\mbox{if $i=0$,}\\ \max\left\{(i+3)^{8},\left(1+\frac{6}{i+3}\right)\cdot A(i-1)\right\}&\mbox{if $i>0$.}\end{cases}

We can now prove by induction that A(i)(i+3)8A(i)\leq(i+3)^{8}. Indeed, for i=0i=0 this obviously holds, and for i>0i>0 we have

A(i)\displaystyle A(i) max{(i+3)8,(1+6i+3)A(i1)}\displaystyle\leq\max\left\{(i+3)^{8},\left(1+\frac{6}{i+3}\right)\cdot A(i-1)\right\}
max{(i+3)8,(1+6i+3)(i+2)8}\displaystyle\leq\max\left\{(i+3)^{8},\left(1+\frac{6}{i+3}\right)\cdot(i+2)^{8}\right\}

and

(1+6i+3)(i+2)8\displaystyle\textstyle\left(1+\frac{6}{i+3}\right)\cdot(i+2)^{8} ={(1+6i+3)(i+2i+3)8}(i+3)8\displaystyle=\textstyle\left\{\left(1+\frac{6}{i+3}\right)\cdot\left(\frac{i+2}{i+3}\right)^{8}\right\}\cdot(i+3)^{8}
={1+6i+3(1+1i+2)8}(i+3)8\displaystyle=\textstyle\left\{\frac{1+\frac{6}{i+3}}{\left(1+\frac{1}{i+2}\right)^{8}}\right\}\cdot(i+3)^{8}
<{1+6i+31+8i+2}(i+3)8\displaystyle<\textstyle\left\{\frac{1+\frac{6}{i+3}}{1+\frac{8}{i+2}}\right\}\cdot(i+3)^{8}
<(i+3)8.\displaystyle<\textstyle(i+3)^{8}.

Hence, A(h)<(h+3)8A(h)<(h+3)^{8}, which finishes the proof. ∎

5 A lower bound for polygonal partitions

In the previous sections we have seen that any properly weighted tree 𝒯\mathcal{T} with nn nodes admits a polygonal partition whose aspect ratio is O(height(𝒯)+logn)O(\mydepth(\mathcal{T})+\log n). In this section we prove this is almost tight in the worst case, by exhibiting a tree for which any polygonal partition has aspect ratio Ω(height(𝒯))\Omega(\mydepth(\mathcal{T})).

We start with an easy lower bound on the aspect ratio of a convex polygon in terms of its smallest angle.

Observation 1.

Let PP be a convex polygon and let α\alpha be the smallest interior angle of PP. Then the aspect ratio of PP is at least 2/α2/\alpha.

Proof.

Let vv be a vertex of PP whose interior angle is α\alpha. Then PP is contained in the circular sector with radius diam(P)\diam(P) and angle α\alpha whose apex is at vv. This sector has area (α/2)diam(P)2(\alpha/2)\cdot\diam(P)^{2}, from which the observation readily follows. ∎

Next we show how to construct, for any given height hh, a weighted tree 𝒯\mathcal{T} of height hh such that any polygonal partition for 𝒯\mathcal{T} has a region with a very small angle. The lower bound on the aspect ratio then follows immediately from Observation 1.

Figure 8: (i) Structure of the tree for the lower-bound construction. (ii) Illustration for the proof of Lemma 4.

The structure of 𝒯\mathcal{T} is depicted in Fig. 8(i). The tree 𝒯\mathcal{T} has h+1h+1 nodes ν0,,νh\nu_{0},\ldots,\nu_{h} that form a path, and hh other (leaf) nodes λ1,,λh\lambda_{1},\ldots,\lambda_{h} branching off the path. The idea will be to choose the weights of the leaves very small, so that the only way to give the region P(λi)P(\lambda_{i}) the required area, is to cut off a small triangle from P(νi)P(\nu_{i}). Then we will argue that one of these triangles must have a small angle.

To make this idea precise we define

xi:={1if i=0,xi1/(2h)if 0<ih,x_{i}:=\begin{cases}1&\mbox{if $i=0$,}\\ x_{i-1}/(2\sqrt{h})&\mbox{if $0<i\leq h$,}\end{cases}

and we set w(λi):=xi12/(4h)w(\lambda_{i}):=x_{i-1}^{2}/(4h) for 1ih1\leq i\leq h. Note that defining the weights for λ1,,λh\lambda_{1},\ldots,\lambda_{h} implicitly defines the weights for ν1,,νh\nu_{1},\ldots,\nu_{h} as well.

Lemma 4.

If each region created in a polygonal partition for 𝒯\mathcal{T} has aspect ratio at most hh, then we have for 0ih0\leq i\leq h,

  1. (i)

    P(λi1)P(\lambda_{i-1}) is a triangle (if λi1\lambda_{i-1} exists, that is, if i0i\neq 0);

  2. (ii)

    P(νi)P(\nu_{i}) has i+4i+4 sides, each of length at least xix_{i}.

Proof.

We will prove the lemma by induction on ii. For i=0i=0 the lemma is obviously true, since P(ν0)P(\nu_{0}) is the unit square.

Now let i>0i>0. By the induction hypothesis, each side of P(νi1)P(\nu_{i-1}) has length at least xi1x_{i-1}. If P(λi)P(\lambda_{i}) fully contained an edge of P(νi1)P(\nu_{i-1}), its diameter would therefore be more than xi1x_{i-1}. But then its aspect ratio would be

diam(P(λi))2area(P(λi))xi12w(λi)=xi12xi12/4h=4h,\frac{\diam(P(\lambda_{i}))^{2}}{\area(P(\lambda_{i}))}\geq\frac{x_{i-1}^{2}}{w(\lambda_{i})}=\frac{x_{i-1}^{2}}{x_{i-1}^{2}/4h}=4h,

which contradicts the assumptions. Hence, P(λi)P(\lambda_{i}) is a triangle, as claimed. It also follows that P(νi)P(\nu_{i}) has i+4i+4 sides. It remains to show that these sides have length at least xix_{i}.

Let stst be the segment that cuts P(νi1)P(\nu_{i-1}) into P(νi)P(\nu_{i}) and P(λi)P(\lambda_{i}), let pp be the corner of P(νi1)P(\nu_{i-1}) that is cut off, and let qq and rr be the corners of P(νi1)P(\nu_{i-1}) adjacent to pp—see Fig. 8(ii). All sides of P(νi)P(\nu_{i}) except qsqs, stst, and trtr have length at least xi1x_{i-1} so they definitely have length at least xix_{i}.

It is easy to see that the angles of any polygon P(νj)P(\nu_{j}) are at least π/2\pi/2—indeed, when a corner is cut off from some P(νj)P(\nu_{j}), the two new angles appearing in P(νj+1)P(\nu_{j+1}) are larger than the angle at the corner that is cut off. Hence, stst is the longest edge of the triangle pst=P(λi)pst=P(\lambda_{i}), and we have

|st|area(P(λi))=w(λi)=xi124h=xi12h=xi.|st|\geq\sqrt{\area(P(\lambda_{i}))}=\sqrt{w(\lambda_{i})}=\sqrt{\frac{x_{i-1}^{2}}{4h}}=\frac{x_{i-1}}{2\sqrt{h}}=x_{i}.

Next we show that qsqs has length at least xix_{i}; the argument for trtr is similar. Note that |ps|hw(λi)|ps|\leq\sqrt{h\cdot w(\lambda_{i})}, otherwise P(λi)P(\lambda_{i})’s aspect ratio would be larger than hh. Hence, we have

|qs|\displaystyle|qs| =|pq||ps|\displaystyle=|pq|-|ps|
xi1|ps|(induction hypothesis)\displaystyle\geq x_{i-1}-|ps|\qquad\mbox{(induction hypothesis)}
xi1hw(λi)\displaystyle\geq x_{i-1}-\sqrt{h\cdot w(\lambda_{i})}
=xi1hxi124h\displaystyle=x_{i-1}-\sqrt{h\cdot\frac{x_{i-1}^{2}}{4h}}
=xi12\displaystyle=\frac{x_{i-1}}{2}
xi.\displaystyle\geq x_{i}.

Next we show that one of the triangles P(λi)P(\lambda_{i}) must have large aspect ratio.

Lemma 5.

If each region created in a polygonal partition for 𝒯\mathcal{T} has aspect ratio at most hh, then there is a region P(λi)P(\lambda_{i}) where one of whose interior angles is at most 2π/(h+4)2\pi/(h+4).

Proof.

By the previous lemma, the region P(νh)P(\nu_{h}) has h+4h+4 sides. The sum of the interior angles of a (h+4)(h+4)-gon is exactly (h+2)2π(h+2)\cdot 2\pi, so one of the interior angles of P(νh)P(\nu_{h}) must be at least

(h+2)2πh+4=2π4πh+4.\frac{(h+2)\cdot 2\pi}{h+4}=2\pi-\frac{4\pi}{h+4}.

If the two edges meeting at some corner pp of P(νh)P(\nu_{h}) make an angle of at least 2π4π/(h+4)2\pi-4\pi/(h+4) in P(νh)P(\nu_{h}), then they must make an angle of at most 4π/(h+4)4\pi/(h+4) in a region P(λi)P(\lambda_{i}) adjacent to pp. ∎

Theorem 3.

For any hh, there is a weighted tree 𝒯\mathcal{T} of height hh such that any polygonal partition for 𝒯\mathcal{T} has aspect ratio Ω(h)\Omega(h).

Proof.

Consider the tree 𝒯\mathcal{T} described above. Assume the aspect ratio of the polygonal partition for 𝒯\mathcal{T} is less than hh—otherwise we are done. Then by Lemma 5 there is a region with interior angle 4π/(h+4)4\pi/(h+4). By Observation 1 this region has aspect ratio at least (h+4)/2π=Ω(h)(h+4)/2\pi=\Omega(h). ∎

6 Partitions with slack

Recall that a rectangular partition is a polygonal partition in which all polygons are rectangles. We show that if we allow a small distortion of the areas of the rectangles, then there exists a rectangular partition of small aspect ratio. This result can also be obtained for partitions of a hypercube in d{\mathbb{R}}^{d}. We now define more precisely which type of distortion we allow.

Let 𝒯\mathcal{T} be a properly weighted tree. A rectangular partition with ε\varepsilon-slack in d{\mathbb{R}}^{d} for 𝒯\mathcal{T} assigns a dd-dimensional hyperrectangle R(ν)R(\nu) to each node ν𝒯\nu\in\mathcal{T} such that

  • the hyperrectangle R(root(𝒯))R(\myroot(\mathcal{T})) is the unit hypercube in d{\mathbb{R}}^{d};

  • for any two nodes ν,μ\nu,\mu such that μ\mu is a child of ν\nu we have

    (1ε)vol(R(μ))w(μ)vol(R(ν))w(ν)vol(R(μ))w(μ).(1-\varepsilon)\cdot\frac{\mathop{\rm vol}(R(\mu))}{w(\mu)}\leq\frac{\mathop{\rm vol}(R(\nu))}{w(\nu)}\leq\frac{\mathop{\rm vol}(R(\mu))}{w(\mu)}.
  • for any node ν\nu, the hyperrectangles assigned to the children of ν\nu have pairwise disjoint interiors and are contained in R(ν)R(\nu).

Observe that as we go down the tree 𝒯\mathcal{T}, the volumes of the hyperrectangles can start to deviate more and more from their weights. However, the relative volumes of the hyperrectangles of the children of a node ν\nu stay roughly the same and together they still cover R(ν)R(\nu) almost entirely.

For convenience, we will work with the rectangular aspect ratio of a dd-dimensional hyperrectangle rather than using the aspect-ratio definition given earlier. The rectangular aspect ratio asprect(R)\ar_{\rm rect}(R) of hyperrectangle RR with side lengths s1,s2,,sds_{1},s_{2},\ldots,s_{d} is defined as asprect(R):=maxisiminisi\ar_{\rm rect}(R):=\frac{\max_{i}s_{i}}{\min_{i}s_{i}}. It can easily be shown that for 2-dimensional rectangles, the aspect ratio and the rectangular aspect ratio are within a constant factor. We define the rectangular aspect ratio of a rectangular partition as the maximum rectangular aspect ratio of any of the hyperrectangles in the partition.

Our algorithm to construct a rectangular partition always cuts perpendicular to the longest side of a hyperrectangle R(ν)R(\nu). Since we can shrink each of the hyperrectangles of the children of ν\nu by a factor 1ε1-\varepsilon, we have some extra space to keep the aspect ratios under control. We will prove that this means that the longest-side-first strategy can ensure a rectangular aspect ratio of 1/ε1/\varepsilon. The basic tool is the following lemma.

Lemma 6.

Let 0<ε<1/30<\varepsilon<1/3, and let RR be a hyperrectangle with asprect(R)1/ε\ar_{\rm rect}(R)\leq 1/\varepsilon. Let S={w1,,wk}S=\{w_{1},\ldots,w_{k}\} be a set of weights with i=1kwi=(1ε)vol(R)\sum_{i=1}^{k}w_{i}=(1-\varepsilon)\cdot\mathop{\rm vol}(R). Then there exists a set {R1,,Rk}\{R_{1},\ldots,R_{k}\} of pairwise disjoint hyperrectangles, each contained in RR, such that for all 1ik1\leq i\leq k we have vol(Ri)=wi\mathop{\rm vol}(R_{i})=w_{i} and asprect(Ri)1/ε\ar_{\rm rect}(R_{i})\leq 1/\varepsilon.

Proof.

We will prove this by induction on kk. The case k=1k=1 is trivial, so now assume k>1k>1. For a subset SSS^{\prime}\subset S, we define w(S):=wiSwiw(S^{\prime}):=\sum_{w_{i}\in S^{\prime}}w_{i}. Assume without loss of generality that w1=maxiwiw_{1}=\max_{i}w_{i}. There are two cases.

  • If w1(1ε)w(S)w_{1}\leq(1-\varepsilon)\cdot w(S), then we can split SS into subsets SS^{\prime} and S′′S^{\prime\prime} such that w(S)εw(S)w(S^{\prime})\geq\varepsilon\cdot w(S) and w(S′′)εw(S)w(S^{\prime\prime})\geq\varepsilon\cdot w(S). Indeed, if ii^{*} is the minimum index such that i=1iwiεw(S)\sum_{i=1}^{i^{*}}w_{i}\geq\varepsilon\cdot w(S), then i=1iwi(1ε)w(S)\sum_{i=1}^{i^{*}}w_{i}\leq(1-\varepsilon)\cdot w(S) since ε<1/3\varepsilon<1/3. Hence, setting S={w1,,wi}S^{\prime}=\{w_{1},\ldots,w_{i^{*}}\} satisfies the condition.

    We now cut RR perpendicular to its longest side into hyperrectangles RR^{\prime} and R′′R^{\prime\prime} such that

    vol(R)=vol(R)w(S)w(S) and vol(R′′)=vol(R)w(S′′)w(S).\mathop{\rm vol}(R^{\prime})=\mathop{\rm vol}(R)\cdot\frac{w(S^{\prime})}{w(S)}\ \ \mbox{ and }\ \ \mathop{\rm vol}(R^{\prime\prime})=\mathop{\rm vol}(R)\cdot\frac{w(S^{\prime\prime})}{w(S)}.

    Note that this implies that

    w(S)=w(S)vol(R)vol(R)=(1ε)vol(R).w(S^{\prime})=\frac{w(S)}{\mathop{\rm vol}(R)}\cdot\mathop{\rm vol}(R^{\prime})=(1-\varepsilon)\cdot\mathop{\rm vol}(R^{\prime}).

    Since w(S)εw(S)w(S^{\prime})\geq\varepsilon\cdot w(S) and the cut is perpendicular to the longest side, we have asprect(R)1/ε\ar_{\rm rect}(R^{\prime})\leq 1/\varepsilon. Hence, by induction there exists a set of pairwise disjoint hyperrectangles, each contained in RR^{\prime}, whose volumes are the weights in SS^{\prime} and whose aspect ratios are at most 1/ε1/\varepsilon. Similarly, there is a collection of suitable hyperrectangles contained in R′′R^{\prime\prime} for the weights in S′′S^{\prime\prime}. Hence, we have found a set of hyperrectangles for SS satisfying all the conditions.

  • If w1>(1ε)w(S)w_{1}>(1-\varepsilon)\cdot w(S) we split RR into R1R_{1} and RR^{\prime} by cutting perpendicular to the longest side, such that vol(R1)=w1\mathop{\rm vol}(R_{1})=w_{1}. Since

    w1>(1ε)w(S)=(1ε)2vol(R)>εvol(R),w_{1}>(1-\varepsilon)\cdot w(S)=(1-\varepsilon)^{2}\cdot\mathop{\rm vol}(R)>\varepsilon\cdot\mathop{\rm vol}(R),

    we have asprect(R1)1/ε\ar_{\rm rect}(R_{1})\leq 1/\varepsilon. Furthermore, since w(S)=(1ε)vol(R)w(S)=(1-\varepsilon)\cdot\mathop{\rm vol}(R) we certainly have w1<(1ε)vol(R)w_{1}<(1-\varepsilon)\cdot\mathop{\rm vol}(R), and so

    vol(R)=vol(R)w1>εvol(R).\mathop{\rm vol}(R^{\prime})=\mathop{\rm vol}(R)-w_{1}>\varepsilon\cdot\mathop{\rm vol}(R).

    This implies that asprect(R)1/ε\ar_{\rm rect}(R^{\prime})\leq 1/\varepsilon. Finally, we note that

    w(S{w1})vol(R)=w(S)w1vol(R)w1<w(S)vol(R)=1ε.\frac{w(S\setminus\{w_{1}\})}{\mathop{\rm vol}(R^{\prime})}=\frac{w(S)-w_{1}}{\mathop{\rm vol}(R)-w_{1}}<\frac{w(S)}{\mathop{\rm vol}(R)}=1-\varepsilon.

    Hence, we can slightly shrink RR^{\prime} such that w(S{w1})=(1ε)vol(R)w(S\setminus\{w_{1}\})=(1-\varepsilon)\cdot\mathop{\rm vol}(R^{\prime}), which means we can apply the induction hypothesis to obtain a suitable set of hyperrectangles for the weights in S{w1}S\setminus\{w_{1}\} inside RR^{\prime}. Together with the hyperrectangle R1R_{1} for w1w_{1}, this gives us a collection of hyperrectangles for the weights in SS satisfying all the conditions.

We can now prove our final result on partitions with slack.

Theorem 4.

Let 0<ϵ<1/30<\epsilon<1/3, and let d2d\geq 2. Let 𝒯\mathcal{T} be a properly weighted tree. Then there exists a rectangular partition with ε\varepsilon-slack in d{\mathbb{R}}^{d} for 𝒯\mathcal{T} whose aspect ratio is at most 1/ε1/\varepsilon.

Proof.

We construct the rectangular partition recursively, as follows. We start at the root of 𝒯\mathcal{T}, where we set R(root(𝒯))R(\myroot(\mathcal{T})) to the unit hypercube. Note that the rectangular aspect ratio of a hypercube is 1. Now, given a hyperrectangle R(ν)R(\nu) of an internal node ν\nu such that the rectangular aspect ratio is at most 1/ε1/\varepsilon, we will construct hyperrectangles for the children of ν\nu of the required aspect ratio. To this end, for any child μ\mu of ν\nu we define

w(μ):=(1ε)w(μ)vol(R(ν))w(ν).w^{*}(\mu):=(1-\varepsilon)\cdot w(\mu)\cdot\frac{\mathop{\rm vol}(R(\nu))}{w(\nu)}.

Observe that since μw(μ)=w(ν)\sum_{\mu}w(\mu)=w(\nu), we have

μw(μ)=(1ε)vol(R(ν)).\sum_{\mu}w^{*}(\mu)=(1-\varepsilon)\cdot\mathop{\rm vol}(R(\nu)).

Hence, we can apply Lemma 6 with S={w(μ): μ is a child of ν}S=\{w^{*}(\mu):\mbox{ $\mu$ is a child of $\nu$}\} to partition R(ν)R(\nu) into pairwise disjoint hyperrectangles RμR_{\mu}, each contained in R(ν)R(\nu) and of aspect ratio at most 1/ε1/\varepsilon. The volume of each R(μ)R(\mu) will be w(μ)w^{*}(\mu), which is in the allowed range. Finally, we recurse on each non-leaf child. After we the recursive process has finished, we have the desired partition. ∎

7 Embedding ultrametrics into d\mathbb{R}^{d}

Before we describe our algorithm for embedding ultrametrics into d\mathbb{R}^{d}, we define α\alpha-hierarchical well separated trees, or α\alpha-HSTs for short, introduced by Bartal [4]. Let α>1\alpha>1 be a parameter. An α\alpha-HST is a rooted tree 𝒯\mathcal{T} with all leaves on the same level, where each node ν\nu has an associated label l(ν)l(\nu) such that for any node ν\nu with parent μ\mu we have l(μ)=αl(ν)l(\mu)=\alpha\cdot l(\nu). The metric space that corresponds to the HST 𝒯\mathcal{T} is defined on the leaves of 𝒯\mathcal{T}, and the distance between any two leaves in 𝒯\mathcal{T} is equal to the label of the their lowest common ancestor.

Let M=(X,D)M=(X,D) be the given ultrametric. After scaling MM, we can assume that the minimum distance is 1 and the diameter is Δ\Delta. For any α>1\alpha>1, we can embed MM into an α\alpha-HST, with distortion α\alpha [5]. Given MM, we initially compute an embedding of MM into a 22-HST 𝒯\mathcal{T} with distortion 2. Let M𝒯=(X,D𝒯)M_{\mathcal{T}}=(X,D_{\mathcal{T}}) be the metric space corresponding to 𝒯\mathcal{T}. Any embedding of M𝒯M_{\mathcal{T}} into d{\mathbb{R}}^{d} with distortion cc^{\prime}, yields an embedding of MM into d\mathbb{R}^{d} with distortion O(c)O(c^{\prime}). It therefore suffices to embed of M𝒯M_{\mathcal{T}} into d{\mathbb{R}}^{d}. With a slight abuse of notation we will from now on denote the leaf of 𝒯\mathcal{T} corresponding to a point xXx\in X simply by xx.

A lower bound.

To prove the approximation ratio of our embedding algorithm, we need a lower bound on the optimal distortion. We will use the lower bound proved by Bădoiu et al. [9], which we describe next.

Consider an embedding ϕ\phi of M𝒯M_{\mathcal{T}} into d\mathbb{R}^{d}. Assume without loss of generality that ϕ\phi is non-contracting, that is, ϕ\phi does not make any distances smaller. For each node ν𝒯\nu\in\mathcal{T} we define a set AνdA_{\nu}\subset\mathbb{R}^{d} as follows. Let Bd(r)B_{d}(r) denote the ball in d{\mathbb{R}}^{d} centered at the origin and of radius rr. For a leaf ν\nu of 𝒯\mathcal{T}, let AνA_{\nu} be equal to the ball Bd(12)B_{d}(\frac{1}{2}) translated so that its center is ϕ(ν)\phi(\nu). For a non-leaf node ν\nu with children μ1,,μk\mu_{1},\ldots,\mu_{k}, let AνA_{\nu} be the Minkowski sum of i=1kAμi\bigcup_{i=1}^{k}A_{\mu_{i}} with Bd(l(ν))B_{d}(l(\nu)). By the non-contraction of ϕ\phi it follows that for each pair of nodes ν,ν\nu,\nu^{\prime} that are on the same level of 𝒯\mathcal{T}, the regions AνA_{\nu} and AνA_{\nu^{\prime}} have disjoint interiors—see Figure 9 for an example. Intuitively, the volume AνA_{\nu} is necessary to embed all the points corresponding to the leaves below ν\nu such that the embedding is non-contracting. This in turn can be used via an isoperimetric argument to obtain a lower bound on the maximum distance (and, hence, distortion) between the images of these leaves.

Figure 9: The sets AνA_{\nu} for a non-contracting embedding of an HST.

We cannot compute AνA_{\nu} exactly, however, since we do not know the embedding. Hence, following Bădoiu et al. [9] we define for each ν𝒯\nu\in\mathcal{T} a value A(ν)A^{*}(\nu) that estimates the volume of AνA_{\nu}. Intuitively, the estimate on AνA_{\nu} is derived by the Brunn-Minkowski inequality. More precisely, we define A(ν)A^{*}(\nu) as follows.

A(ν)={vol(Bd(12))if ν is a leaf,μ is a child of ν(A(μ)1/d+vol(Bd(l(ν)4))1/d)dotherwise.A^{*}(\nu)=\begin{cases}\mathop{\rm vol}\left(B_{d}(\frac{1}{2})\right)&\mbox{if $\nu$ is a leaf,}\\ \sum_{\mbox{$\mu$ is a child of $\nu$}}\left(A^{*}(\mu)^{1/d}+\mathop{\rm vol}\left(B_{d}\left(\frac{l(\nu)}{4}\right)\right)^{1/d}\right)^{d}&\mbox{otherwise.}\end{cases}

The estimate A(ν)A^{*}(\nu) can be used to obtain a lower bound on the distortion, as made precise in the next lemma. For any V>0V>0, let rd(V)r_{d}(V) be the radius of a dd-dimensional ball with volume VV; thus we have

rd(V)=(VΓ(1+d/2)πd/2)1/d=Θ(dV1/d),r_{d}(V)=\left(\frac{V\cdot\Gamma(1+d/2)}{\pi^{d/2}}\right)^{1/d}=\Theta\left(\sqrt{d}\cdot V^{1/d}\right),

where Γ(z)=0tz1et𝑑t\Gamma(z)=\int_{0}^{\infty}t^{z-1}e^{-t}dt.

Lemma 7 ([9], Corollary 1).

Let opt denote the distortion of an optimal embedding of M𝒯M_{\mathcal{T}} into d\mathbb{R}^{d}. Then

optmaxν is internal node of 𝒯rd(A(ν))l(ν)1.\mbox{{\sc opt}}\geq\max_{\mbox{\rm\small$\nu$ is internal node of $\mathcal{T}$}}\frac{r_{d}(A^{*}(\nu))}{l(\nu)}-1.

The algorithm.

We are now ready to describe the embedding ff of M𝒯M_{\mathcal{T}} into d\mathbb{R}^{d}. The intuition behind our algorithm is as follows. The lower bound given by Lemma 7 implies that an embedding is nearly-optimal if it results in sets AνA_{\nu} with small aspect ratio. Our approach, however, is essentially reversed. We first compute a hyperrectangular partition of d\mathbb{R}^{d} into hyperrectangles with small aspect ratio. The hyperrectangle computed for the leaves in 𝒯\mathcal{T} will roughly correspond to the balls around the embedded points xXx\in X, so given the partition we will be able to obtain the embedding by placing f(x)f(x) at the center of the hyperrectangle computed for xx. The weights we use for the nodes of 𝒯\mathcal{T} will be the values A(ν)A^{*}(\nu), which using Lemma 7 can then be used to bound the distortion.

More precisely, the algorithm works as follows.

  1. 1.

    Compute for each node ν𝒯\nu\in\mathcal{T} the value AνA^{*}_{\nu}.

  2. 2.

    Compute a hyperrectangular partition with slack ε:=min(13,1logΔ)\varepsilon:=\min(\frac{1}{3},\frac{1}{\log\Delta}) for 𝒯\mathcal{T}, where AνA^{*}_{\nu} is used as the weight of a node ν\nu. Note that 𝒯\mathcal{T} is not properly weighted: the weight of root(𝒯)\myroot(\mathcal{T}) will be greater than 1 and the weight of an internal node ν\nu is larger than the sum of the weights of its children. However, we can still apply Theorem 4. Indeed, by scaling the weights appropriately we can ensure that the root has weight 1, and the fact that the weight of an internal node ν\nu is larger than the sum of the weights of its children only makes it easier to obtain a small aspect ratio. Thus we can compute a hyperrectangular partition for 𝒯\mathcal{T} whose rectangular aspect ratio is at most logΔ\log\Delta.

  3. 3.

    Let P(ν)P(\nu) denote the hyperrectangle computed for node ν𝒯\nu\in\mathcal{T} in Step 2. We slightly modify the hyperrectangles P(ν)P(\nu), as follows. Starting from the root of 𝒯\mathcal{T}, we traverse all the nodes of 𝒯\mathcal{T}. When we visit an internal node ν\nu, we shrink all hyperrectangles of the nodes in the subtree rooted at ν\nu by a factor of 11/logΔ1-1/\log\Delta, with the center of the (current) hyperrectangle P(ν)P^{\prime}(\nu) of ν\nu being the fixed point in the transformation. Note that P(ν)P^{\prime}(\nu) itself is not shrunk. Thus the shrinking step moves the hyperrectangles contained inside P(ν)P^{\prime}(\nu) away from its boundary and towards its center, thus preventing points in different subtrees to get too close to each other.

  4. 4.

    Let P(ν)P^{\prime}(\nu) denote the hyperrectangle computed in Step 3. Then we define the embedding f(x)f(x) of a point xXx\in X to be the center of the hyperrectangle P(x)P^{\prime}(x).

It remains to bound the distortion of ff. We will need the following observation, which bounds the diameter of a hyperrectangle in terms of its volume and aspect ratio.

Observation 2.

Let PP be a hyperrectangle in d{\mathbb{R}}^{d} with aspect ratio at most α\alpha. Then, assuming αd1\alpha\geq\sqrt{d-1},

diam(P)α2vol(P)1/d.\diam(P)\leq\alpha\sqrt{2}\cdot\mathop{\rm vol}(P)^{1/d}.

From now on we assume that logΔd1\log\Delta\geq\sqrt{d-1}.

Lemma 8.

The expansion of ff is O(1dlogΔopt)O\left(\frac{1}{\sqrt{d}}\cdot\log{\Delta}\cdot\mbox{{\sc opt}}\right).

Proof.

Consider points x,yXx,y\in X. Let ν\nu be the lowest common ancestor of xx and yy in 𝒯\mathcal{T}. We have D𝒯(x,y)=l(ν)D_{\mathcal{T}}(x,y)=l(\nu). Both f(x)f(x) and f(y)f(y) are contained in P(ν)P^{\prime}(\nu), which in turn is contained in P(ν)P(\nu). Hence, diam(P(ν))\diam(P(\nu)) gives an upper bound on |xy||xy|. Note that asprect(P(ν))logΔ\ar_{\rm rect}(P(\nu))\leq\log\Delta and that vol(P(ν))Aν\mathop{\rm vol}(P(\nu))\leq A^{*}_{\nu}. (We do not necessarily have vol(P(ν))=Aν\mathop{\rm vol}(P(\nu))=A^{*}_{\nu} because of the slack in the partition.) Hence,

|xy|\displaystyle|xy| diam(P(ν))\displaystyle\leq\textstyle\diam(P(\nu))
logΔ2vol(P(ν))1/d\displaystyle\leq\textstyle\log\Delta\cdot\sqrt{2}\cdot\mathop{\rm vol}(P(\nu))^{1/d}
logΔ2(Aν)1/d\displaystyle\leq\textstyle\log\Delta\cdot\sqrt{2}\cdot\left(A^{*}_{\nu}\right)^{1/d}
=O(logΔrd(Aν)1d)\displaystyle=\textstyle O\left(\log\Delta\cdot r_{d}(A^{*}_{\nu})\cdot\frac{1}{\sqrt{d}}\right)
=O(logΔ(opt+1)l(ν)1d)\displaystyle=\textstyle O\left(\log\Delta\cdot(\mbox{{\sc opt}}+1)\cdot l(\nu)\cdot\frac{1}{\sqrt{d}}\right)
=O(logΔoptD𝒯(x,y)1d),\displaystyle=\textstyle O\left(\log\Delta\cdot\mbox{{\sc opt}}\cdot D_{\mathcal{T}}(x,y)\cdot\frac{1}{\sqrt{d}}\right),

where the second-to-last transition follows from Lemma 7. This shows that the expansion is O(logΔopt1d)O(\log{\Delta}\cdot\mbox{{\sc opt}}\cdot\frac{1}{\sqrt{d}}). ∎

Lemma 9.

The contraction of ff is O(dlog2Δ)O\left(\sqrt{d}\cdot\log^{2}{\Delta}\right).

Proof.

Since 𝒯\mathcal{T} is a 2-HST, we have Δ=l(root(𝒯))=2height(𝒯)\Delta=l(\myroot(\mathcal{T}))=2^{\mydepth(\mathcal{T})}. Hence, height(𝒯)=logΔ\mydepth(\mathcal{T})=\log\Delta. It follows that for each node ν𝒯\nu\in\mathcal{T},

vol(P(ν))\displaystyle\mathop{\rm vol}(P^{\prime}(\nu)) =Ω((11logΔ)logΔvol(P(ν)))=Ω(vol(P(ν)))\displaystyle=\Omega\left(\left(1-\frac{1}{\log\Delta}\right)^{\log\Delta}\cdot\mathop{\rm vol}(P(\nu))\right)=\Omega\left(\mathop{\rm vol}(P(\nu))\right)
=Ω((11logΔ)logΔAν)=Ω(Aν).\displaystyle=\Omega\left(\left(1-\frac{1}{\log\Delta}\right)^{\log\Delta}\cdot A^{*}_{\nu}\right)=\Omega\left(A^{*}_{\nu}\right).

Consider points x,yXx,y\in X, and let ν\nu be the lowest common ancestor of xx and yy in 𝒯\mathcal{T}. We will consider the following two cases for ν\nu:

  • Case 1: ν\nu is the parent of xx and yy in 𝒯\mathcal{T}.
    Since the minimum distance in M𝒯M_{\mathcal{T}} is 1, it follows that D𝒯(x,y)=1D_{\mathcal{T}}(x,y)=1. By construction, f(x)f(x) is the center of P(x)P^{\prime}(x). Let tt be the distance between f(x)f(x) and P(x)\bd P^{\prime}(x). Since asprect(P(x))1/ε\ar_{\rm rect}(P^{\prime}(x))\leq 1/\varepsilon, we have

    tεvol(P(x))1/d=Ω(ε(Ax)1/d)=Ω(ε1d)=Ω(1dlogΔ).t\geq\varepsilon\cdot\mathop{\rm vol}(P^{\prime}(x))^{1/d}=\Omega\left(\varepsilon\cdot(A^{*}_{x})^{1/d}\right)=\Omega\left(\varepsilon\cdot\frac{1}{\sqrt{d}}\right)=\Omega\left(\frac{1}{\sqrt{d}\log\Delta}\right).

    Thus, |f(x)f(y)|t=Ω(D(x,y)dlogΔ)|f(x)f(y)|\geq t=\Omega\left(\frac{D(x,y)}{\sqrt{d}\log\Delta}\right).

  • Case 2: ν\nu is not the parent of xx and yy in 𝒯\mathcal{T}.
    Let μ\mu be the child of ν\nu that lies on the path from ν\nu to xx. Let tt be the distance between xx and P(μ)\bd P^{\prime}(\mu). Because of the shrinking performed in Step 3, we know that t(1/logΔ)(s/2)t\geq(1/\log\Delta)\cdot(s/2), where ss is the length of the shortest edge of P(μ)P^{\prime}(\mu). Since asprect(P(μ))1/ε\ar_{\rm rect}(P^{\prime}(\mu))\leq 1/\varepsilon, we have sε11/dvol(P(μ))1/ds\geq\varepsilon^{1-1/d}\cdot\mathop{\rm vol}(P^{\prime}(\mu))^{1/d}. Hence,

    t\displaystyle t 1logΔs2\displaystyle\geq\textstyle\frac{1}{\log\Delta}\cdot\frac{s}{2}
    =Ω(ε11/dlogΔvol(P(μ))1/d)\displaystyle=\textstyle\Omega\left(\frac{\varepsilon^{1-1/d}}{\log\Delta}\cdot\mathop{\rm vol}(P^{\prime}(\mu))^{1/d}\right)
    =Ω(ε11/dlogΔ(Aμ)1/d)\displaystyle=\textstyle\Omega\left(\frac{\varepsilon^{1-1/d}}{\log\Delta}\cdot(A^{*}_{\mu})^{1/d}\right)
    =Ω(1log2Δ(Aμ)1/d)\displaystyle=\textstyle\Omega\left(\frac{1}{\log^{2}\Delta}\cdot(A^{*}_{\mu})^{1/d}\right)
    =Ω(1log2Δl(μ)1d)\displaystyle=\textstyle\Omega\left(\frac{1}{\log^{2}\Delta}\cdot l(\mu)\cdot\frac{1}{\sqrt{d}}\right)
    =Ω(D(x,y)dlog2Δ).\displaystyle=\textstyle\Omega\left(\frac{D(x,y)}{\sqrt{d}\log^{2}\Delta}\right).

Combining Lemmas 8 and 9 we obtain the main result of the section.

Theorem 5.

For any fixed d2d\geq 2, there exists a polynomial-time, O(dlog3Δ)O\left(\sqrt{d}\cdot\log^{3}\Delta\right)-approximation algorithm for the problem of embedding ultrametrics into d\mathbb{R}^{d} with minimum distortion.

We remark that the running time of the above algorithm depends on the way the input is given. If the ultrametric is given as a matrix of pairwise distances, then one needs to first compute a tree representation, with the points being the leaves of the tree. For an nn-point ultrametric, this task takes at least Ω(n2)\Omega(n^{2}) time. Given such a tree representation, for any fixed dimension dd, it is fairly easy to implement our algorithm in roughly quadratic time. It is an interesting open problem to obtain an algorithm with near-linear running time.

As a final comment, note that while the approximation factor is relatively small (for instance, for Δ=nO(1)\Delta=n^{O(1)} and constant dd, it becomes O(log3n)O(\log^{3}n)), the distortion itself can be much larger. For example, embedding the uniform metric on nn vertices (which is an ultrametric as well) into d\mathbb{R}^{d} requires distortion Ω(n1/d)\Omega(n^{1/d}) for constant dd.

Acknowledgments

The authors wish to thank Roberto Tamassia for providing pointers to the applicability of polygonal partitions in visualization.

References

  • [1] M. Balzer and O. Deussen. Voronoi treemaps. In INFOVIS, page 7, 2005.
  • [2] M. Balzer, O. Deussen, and C. Lewerentz. Voronoi treemaps for the visualization of software metrics. In SOFTVIS, pages 165–172, 2005.
  • [3] Y. Bartal. Probabilistic approximation of metric spaces and its algorithmic applications. In 37th Annual Symposium on Foundations of Computer Science (Burlington, VT, 1996), pages 184–193. IEEE Comput. Soc. Press, Los Alamitos, CA, 1996.
  • [4] Y. Bartal. Probabilistic approximation of metric spaces and its algorithmic applications. Annual Symposium on Foundations of Computer Science, 1996.
  • [5] Y. Bartal and M. Mendel. Dimension reduction for ultrametrics. In SODA ’04: Proceedings of the fifteenth annual ACM-SIAM symposium on Discrete algorithms, pages 664–665, Philadelphia, PA, USA, 2004. Society for Industrial and Applied Mathematics.
  • [6] B. B. Bederson, B. Shneiderman, and M. Wattenberg. Ordered and quantum treemaps: Making effective use of 2d space to display hierarchies. ACM Trans. Graph., 21(4):833–854, 2002.
  • [7] J. Bourgain. On lipschitz embedding of finite metric spaces into hilbert space. Isreal Journal of Mathematics, 52:46–52, 1985.
  • [8] D. M. Bruls, C. Huizing, and J. J. van Wijk. Squarified treemaps. In W. de Leeuw, R. van Liere (eds.), Data Visualization 2000, Proceedings of the joint Eurographics and IEEE TCVG Symposium on Visualization, pages 33–42. Springer, 2000.
  • [9] M. Bădoiu, J. Chuzhoy, P. Indyk, and A. Sidiropoulos. Embedding ultrametrics into low-dimensional spaces. In Proceedings of the 22nd ACM Symposium on Computational Geometry, 2006.
  • [10] M. de Berg, B. Speckmann, and V. van der Weele. Treemaps with bounded aspect ratio. CoRR, abs/1012.1749, 2010.
  • [11] M. de Berg, A. F. van der Stappen, J. Vleugels, and M. J. Katz. Realistic input models for geometric algorithms. Algorithmica, 34(1):81–97, 2002.
  • [12] P. Indyk. Tutorial: Algorithmic applications of low-distortion geometric embeddings. Annual Symposium on Foundations of Computer Science, 2001.
  • [13] L. Jin and D. C. Banks. Tennisviewer: A browser for competition trees. IEEE Computer Graphics and Applications, 17(4):63–65, 1997.
  • [14] B. Johnson and B. Shneiderman. Tree-maps: a space-filling approach to the visualization of hierarchical information structures. In Proc., IEEE Conference on Visualization, pages 284–291, 1991.
  • [15] W.-A. Jungmeister and D. Turo. Adapting treemaps to stock portfolio visualization. Technical Report UMCP-CSD CS-TR-2996, College Park, Maryland 20742, U.S.A., 1992.
  • [16] J. Matoušek. Bi-Lipschitz embeddings into low-dimensional Euclidean spaces. Comment. Math. Univ. Carolinae, 31:589–600, 1990.
  • [17] J. Matoušek and A. Sidiropoulos. Inapproximability for metric embeddings into d\mathbb{R}^{d}. In 49th IEEE Symposium on Foundations of Computer Science, 2008.
  • [18] K. Onak and A. Sidiropoulos. Circular partitions with applications to visualization and embeddings. In Proceedings of the 24nd ACM Symposium on Computational Geometry, pages 28–37, 2008.
  • [19] F. P. Preparata and M. I. Shamos. Computational Geometry: An Introduction. Springer-Verlag, New York, NY, 1985.
  • [20] B. Shneiderman. Treemaps for space-constrained visualization of hierarchies. Available at http://www.cs.umd.edu/hcil/treemap-history/index.shtml.
  • [21] B. Shneiderman. Tree visualization with tree-maps: 2-d space-filling approach. ACM Trans. Graph., 11(1):92–99, 1992.
  • [22] B. Shneiderman and M. Wattenberg. Ordered treemap layouts. In IEEE Symposium on Information Visualization, INFOVIS ’01, pages 73–78, 2001.
  • [23] D. Turo and B. Johnson. Improving the visualization of hierarchies with treemaps: Design issues and experimentation. IEEE Visualization, pages 124–131, 1992.
  • [24] R. Vliegen, J. J. van Wijk, and E.-J. van der Linden. Visualizing business data with generalized treemaps. IEEE Transactions on Visualization and Computer Graphics, 12(5):789–796, 2006.
  • [25] S. Wan. Blog treemap visualizer
    (http://www.samuelwan.com/information/archives/000159.html).
  • [26] M. Weskamp. Newsmap. http://marumushi.com/apps/newsmap/newsmap.cfm.
  • [27] K. Wetzel. Using Circular Treemaps to visualize disk usage. Available at http://lip.sourceforge.net/ctreemap.html.