Analysis of Dynamic Voronoi Diagrams in the Hilbert Metric
Abstract
The objective of this paper is to study the properties of Hilbert bisectors and analyze Hilbert Voronoi diagrams in the dynamic setting. Additionally, we introduce dynamic visualization software for Voronoi diagrams in the Hilbert metric on user-specified convex polygons.
1 Introduction
In 1895, David Hilbert introduced the Hilbert metric [11], a projective metric used to measures distances within a convex body. It generalizes the Cayley-Klein model of hyperbolic geometry (on Euclidean balls) to any convex body. Hilbert geometry provides new insights into classical questions from convexity theory and the study of metric and differential geometries (such as Finsler geometries).
In particular, Hilbert Geometry is of interest in the field of convex approximation. To approximate convex bodies, many techniques [4, 1, 3, 8, 20, 9, 14, 2] make use of covering convex bodies with regions that behave like metric balls in the Hilbert metric. These regions go by various names, such as: Macbeath regions, Macbeath ellipsoids, Dikin ellipsoids, and -covers. In this way, a deeper understanding of the Hilbert metric can lead us to a deeper understanding of convex approximation.
The Hilbert metric is applicable to many other fields of study such as quantum information theory [19], real analysis [13], optimization [6], and network analysis [7]. For example, the Hilbert metric is crucial in nonlinear Frobenius-Perron theory [12, 7]. In addition, the Hilbert metric has often been used in the context of optimal mass transport and Schrödinger bridges [5, 6, 7, 18].
There has been little work on the design and analysis of algorithms in the Hilbert geometry on convex polygons and polytopes, and most of it has been done in the last two decades. In this paper, we build off of Nielson and Shao [15] as well as Gezalyan and Mount [10] to implement an algorithm for creating Voronoi diagrams in the Hilbert metric, characterize their bisectors as conics with an explicit formula, and analyze them in the dynamic setting.
2 Preliminaries
2.1 Previous Work
In 2017, Nielsen and Shao [15] presented a characterization of the shape of balls in the Hilbert metric and explored their properties. They showed that the shape of a ball depends on the location its center as well as the vertices of the Hilbert domain. Nielsen and Shao gave an explicit description of Hilbert balls and studied the intersection of two Hilbert balls. In 2021, Gezalyan and Mount [10] expanded on this by studying the geometric and combinatorial properties of Voronoi diagrams in the Hilbert metric. They presented two algorithms, a randomized incremental and a divide and conquer algorithm, for constructing these diagrams. We extend these works to analyze other properties of Voronoi diagrams in the Hilbert geometry, and we develop a software package implementing an incremental algorithm based on the randomized incremental algorithm.
2.2 Defining the Hilbert Metric
A convex body is a closed, compact, full-dimensional convex set. Given two fixed points , let denote the Euclidean distance and denote the Hilbert distance between them. Let denote the chord defined as the intersection of the line passing through and with .
Definition 1 (Cross Ratio)
Given four distinct collinear points in , their cross ratio is defined to be:
Where the orientation of the line determines the sign of each distance.
Note that the cross ratio is invariant under projective transformations [16].
Definition 2 (Hilbert metric)
Given a convex body in and two distinct points , let and denote endpoints of the chord , so that the points are in the order . The Hilbert distance between and is defined as:
It is well known that this is a metric, and in particular, it is symmetric and satisfies the triangle inequality. Moreover, it is well known that if and only if are collinear and are collinear, where is the point where the ray meets [16, Theorem 12.4]. This follows from the Hilbert metric’s characterization as being the average of the forward and backwards Funk metrics. It is also well known that geodesics are unique if and only if is strictly convex [16, Corollary 12.7].
2.3 Voronoi Diagrams in the Hilbert Metric
Let be an open convex region whose boundary, denoted , is a polygon. Let denote a set of sites in . The Voronoi cell of a site is:
The Voronoi diagram of in the Hilbert metric induced by , denoted , is the cell complex of induced by the Voronoi cells , for all . Outside of the dynamic context, we assume that all sites are in general position, and in particular that no three sites are co-linear. It is known that Voronoi cells in the Hilbert Metric are stars and with complexity [10].
It will be helpful to define two terms, spokes and sectors. Given our convex body and a site in it can be seen that the Hilbert distance from our site to a point is dependent on the edges of that intersect . This is characterized by taking the vertices of , which we denote by , and partitioning into cells determined by the chords for all . We define a spoke , to be the intersection of ray and respectively with when is a vertex of . Nielsen and Shao showed that Hilbert balls are -sided polygons whose boundaries are constructed around these spokes [15].
These spokes subdivide into polygonal regions, which we will call sectors. Each sector has the property that for all points , given two sites and there are four edges (not necessarily unique) of , say , such that always intersects at and and at and . We will write to be the unique sector such that for any , we have has in order of intersection and has (see Figure 1). As a consequence of this, we can see that the bisector between two sites, and , is composed of curves which depend piece-wise on the sectors they pass through.
3 Hilbert Bisector analysis
Theorem 3.1.
The equation of the bisector between two sites in any particular sector is of the form , with coefficients depending only on the line equations of the four edges and the sites.
Proof 3.2.
Suppose we are in some arbitrary sector . Let the equation of the edges be , , , and , for , , , and respectively.
Recall the Euclidean distance between a point and a line is given by . Let be an arbitrary point with coordinates . Notice that, without loss of generality, if is the point where chord hits towards , then the ratio can be replaced with the ratio by similar triangles. Using this technique we set and solve, yielding
The equation of the line divides the plane in two, characterized by the sign of the function . Given this, since all our points are on the same side of each line, when we substitute in for the function , we can remove the absolute value bars from our equations. It follows that:
Collecting constants on one side gives us:
Letting the left side be a constant , we find that the bisector satisfies the algebraic equation:
where the coefficients are:
By the symmetry of these equations we can see that the bisector in is the same as the bisector in .111We would like to thank Daniel Skora for comments on a previous version of this proof.
We present several ways to simplify the bisector depending on the sector case.
3.1 Finding Bisectors in a Sector
There are three main sector types: sectors with four distinct edges, sectors with three, and sectors with two. We begin with the four edge case. It is a well known fact from projective geometry that there exists a projective transformation that maps any convex quadrilateral to another (see Figure 2). For the sake of completeness, we present the derivation of this transformation for the special case where the target is the unit square.
Observation 1
Bisectors in the four-edge case can be projectively transformed and solved in the unit square.
Proof 3.3.
Suppose we are in a strictly four-edge sector with edges counter clockwise. Let our edges extend out infinity and let , , , and . Consider the vector:
where and . Then we can calculate the projective transformation matrix such that when sends points on our quadrilateral to the unit square. We force the right corner of to be 1 to fix our scaling factor.
We solve for the elements of T using the following matrices: where , and is:
Since the Hilbert metric is invariant under projective transformations, the final bisector can thus be computed for the canonical case of the unit square and then mapped back using the inverse transformation.
Given this observation, we will assume henceforth that any four edges case is in the unit square.
Lemma 3.4.
When the four edges corresponding to a sector lie on four distinct lines, the bisector is either a hyperbola or a parabola.
Proof 3.5.
Let be an arbitrary sector with four distinct edges. By applying Observation 1, we may assume without loss of generality that , , , lie on the lines , , , and , respectively. The discriminant of equation for our bisector is given by . Substituting in for our variables, we get as our discriminant, which is nonnegative.
Next, let us consider the three-edge case. We will refer to the edge that is hit twice by the Hilbert metric in the sector as the shared edge, we have the following three cases, depending on whether the shared edge is behind both points with respect to the sector, in front of both (see Figure 3), or behind one and in front of the other (see Figure 4). As in the four-edge case, we can projectively transform the problem to a canonical form, as given in the following lemma. Define the unit simplex in to be the right triangle with vertices at , , and .
Observation 2
Bisectors in the three-edge case can be projectively transformed and solved in the unit simplex.
Proof 3.6.
The affine transformation between triangles is well known and inherently projective. We provide it here. A triangle with corners can be projectively transformed into the unit simplex with the matrix , where:
Observe that sends a point on the left from our original triangle to the unit simplex.
Lemma 3.7.
Given any three-edge sector, where the shared edge is in front or behind of both sites, the bisector between the two sites in the sector is a straight line through the vanishing point of the non-shared edges.
Proof 3.8.
We prove this geometrically for both cases with edges and with edges .
Consider the case in which the edge is in front of both sites, . Let be a point in the sector such that , and let be vanishing point of and . We claim the bisector is a straight line through . Let be a point on the segment in the sector. Using the geodesic triangle inequality in the Funk metric we get and [16]. By definition, . Substituting in our previous equations and cancelling we have . Using properties of similar triangles and rearranging the equation we can see that . Note that . Substituting in and using the definition of the Funk metric we get , yielding . By choosing to be the lowest point on the bisector in the sector we get our characterization of the bisector as a line.
Note the case where the shared edge is behind both sites follows from the symmetry of the general equation of the bisector.
Lemma 3.9.
Given a three-edge sector in which the shared edge is in front of one site and behind the other, the bisector between the sites can be a conic of any type (ellipse, parabola, or hyperbola) depending on their relative positions. Further, when either site is fixed, there exists a line such that the type of conic is determined by the location of the other site with respect to this line (an ellipse if it lies on one side, hyperbola if on the other side, and parabola if lies on the line).
Proof 3.10.
We prove this algebraically for, without loss of generality, with edges , and all other edges lying on distinct lines.
By Observation 2, it suffices to assume that the triangle has been mapped to the unit simplex. Let the edge lie on the line , and lie on the line , and lie on the line . By applying Theorem 3.1 with these values, the bisector is given by , where . The discriminant of the equation of the bisector is , which reduces to . By standard results on conics, the type of conic depends on the sign of the discriminant. Note that is always positive since and are in the unit simplex. Given this, the discriminant changes sign when . Thus, the conic type is given by the sign of the function . Observe that when either or is fixed, this is a linear equation in coordinates of the other site. Thus, fixing yields a line, and the type of conic (ellipse, hyperbola, or parabola) is determined by the location of relative to this line. The elliptical case holds when is on one side, the hyperbolic case when it is on the other, and the parabolic case when it lies on the line. This applies symmetrically for .
Figure 4 illustrates four examples of conics as described by Lemma 3.9. The site coordinates and discriminant are given in Table 1. Note that the ellipse case and hyperbola case happen in general position.
Discriminant | |||
Ellipse | (0.2,0.2) | (0.45,0.4) | -3 |
Hyperbola | (0.2,0.2) | (0.25,0.4) | 0.84 |
Circle | (0.1,0.15) | (0.5,0.3) | -4 |
Parabola | (0.1,0.1) | (0.2,0.7) | 0 |
Now that we have evaluated the three-edge case we will evaluate the two-edge case.
Note that given a sector with and , we can choose a point on , on , and let and affinely map the triangle into the unit simplex using Observation 2.
Lemma 3.11.
Given a two edge sector, with as , and as , the bisector between and is given by the following linear equation: which passes through the vanishing point of and where .
Proof 3.12.
Plugging in to the general equation for the bisector in a sector give us with and solving gives us one viable solution . It is clear that this goes through the vanishing point of and .
4 Analysis of Hilbert Voronoi Diagrams
The Hilbert metric has some unique features that are not present in the Euclidean metric, In particular, in degenerate cases bisectors in the Hilbert metric can contain two dimensional polygons. Next, we present a necessary and sufficient condition for this occurrence.
Lemma 4.1.
The bisector between two sites and contains a Hilbert ball of some radius if and only if both sites lie on a ray through a vertex at the vanishing point of two edges and of and the sector exists.
Proof 4.2.
() Consider that the Hilbert distance from and to any point in , from the perspective of both and , is equal by the invariance of the cross ratio. Hence, the entire sector in which both and are between and is part of the bisector between and . By assumption, is a bounded convex polygonal body, so our bisector will contain some fully 2-dimensional region. Note that we can always fit a Euclidean ball in any 2-dimensional region, and by we therefore must be able to fit a Hilbert ball in one as well [16].
() Suppose the bisector between two sites and contains a Hilbert ball . Then there exists a ball nested in so that lies entirely within one sector . Note that the cross ratio between either site and any point in must be equivalent. We assert that is defined by at most two edges of .
Suppose that there were more than two unique edges defining . Consider a point, , in . Take a pair of edges with respect to one site and consider the ray from the vanishing point of that pair of edges through . Note that moving along this line will not change its distance to the site, however, since this sector is defined by more than two edges, it will from the other site. Hence, there can be only two edges of defining .
By the continuity of the Hilbert Metric, it must be that both sites lie on the same side of the bisector in T. Otherwise, we could move closer to one site and further from the other. Since both sites lie on the same side of their bisector, share two edges with respect to every point in , and are the same distance to every point in , they must lie on a ray through .
Given this, we can see that any dynamic Hilbert Voronoi diagram will contain discontinuities whenever a site passes over a ray from a vanishing point of a pair of edges and another site. (See Figure 6 for an example.)
Another property of Hilbert Voronoi diagrams that is distinct from Euclidean Voronoi diagrams is that three sites in general position do not necessarily create a Voronoi vertex. In particular given two site and , there exists a space of positive measure such no ball containing a point in that space on its boundary can contain both and on its boundary.
Lemma 4.3.
There exists a quadrilateral region of positive measure between any two sites and in a convex polygonal , such that for all , there is no Hilbert ball whose boundary passes through , and .
Proof 4.4.
Let have edges, denoted . Let and be two sites in . Take to be the set of vanishing points on pairs of edges when refers to the vanishing point of edges and . Let be the area between rays and intersected with . Let .
Let . By definition, is a polygon whose edges pass through both s and t, which always contains st. Note that it is equal to st if and only if s and t lie on a ray through an element of O.
Consider the boundary of Z. We begin by proving that is a quadrilateral. Without loss of generality let us consider only the top half of above the line . Let the first two rays leaving and and forming part of the boundary of be denoted and , respectively. Let and intersect at a point . If is not in , there must exist some line that intersects both and and either or , and therefore, must be one of the original rays or . This contradicts the fact that is not in . Hence we know must be a quadrilateral. Next, we prove that no ball through and can intersect the interior of on its boundary.
To do this, we prove that any ball containing and must contain . Consider an arbitrary Hilbert ball with and on its boundary. Note that the boundary of must be made of segments along rays passing through elements of . Since and are on the boundary , it must be that if an edge, of , intersects it would cut through, without loss of generality, the top half of the quadrilateral. Extending , we see that it must intersect and at exactly one point each. Let come from a ray passing through . Consider segments through and created by the rays through . Note that must be either above or below and , or otherwise either or would not be on the boundary. However, is contained in the region between and , so cannot cut through it, contradiction. Hence we can see that must contain the interior of .
5 Software
In this section we present our software for Dynamic Voronoi Diagrams in the Hilbert metric.
Our software is built on the structure provided by the software presented by Nielsen and Shao [15]. We contributed by implementing a dynamic insertion algorithm. The insertion process works as follows.
Given an existing convex body with a set of sites , suppose the user chooses to insert a new site . Our software will subdivide into sectors from the perspective of . Then for each site our software calculates . This is done by tracing the bisector through the cell decomposition on induced by the sectors of both and using the method described in [10]. While the bisector is approximated using line segments, the equation of the bisector is printed to the terminal window along with the sector information. Our algorithm will then update the Voronoi cell of all previously calculated ’s as , and insert into the Voronoi diagram. Our software runs in quadratic time in terms of the number of sites and vertices of and is available at https://github.com/caesardai/Voronoi_In_Hilbert/tree/main/src.
6 Concluding Remarks
In this paper, we presented an analysis of dynamic Voronoi diagrams in the Hilbert metric and presented software for the creation of such diagrams. As discussed in the introduction, the Hilbert metric is useful in the study of quantum information theory [19], real analysis [13], optimization [6], and network analysis [7]. Research in these fields may benefit from further extensions of algorithmic results in Euclidean to Hilbert geometry.
References
- [1] Ahmed Abdelkader, Sunil Arya, Guilherme Dias da Fonseca, and David M. Mount. Approximate nearest neighbor searching with non-euclidean and weighted distances. In Proc. 30th Annu. ACM-SIAM Sympos. Discrete Algorithms, pages 355–372, 2019. doi:10.1137/1.9781611975482.23.
- [2] Rahul Arya, Sunil Arya, Guilherme Dias da Fonseca, and David M. Mount. Optimal bound on the combinatorial complexity of approximating polytopes. In Proc. 31st Annu. ACM-SIAM Sympos. Discrete Algorithms, pages 786–805, 2020. doi:10.1137/1.9781611975994.48.
- [3] Sunil Arya, Guilherme Dias da Fonseca, and David M. Mount. Near-optimal -kernel construction and related problems. In Proc. 33rd Internat. Sympos. Comput. Geom., pages 10:1–15, 2017.
- [4] Sunil Arya, Guilherme Dias da Fonseca, and David M. Mount. On the combinatorial complexity of approximating polytopes. Discrete Comput. Geom., 58(4):849–870, 2017. doi:10.1007/s00454-016-9856-5.
- [5] Yongxin Chen, Tryphon Georgiou, and Michele Pavon. Optimal mass transport over bridges. In Internat. Conf. Geom. Sci. of Inf., pages 77–84. Springer, 2015.
- [6] Yongxin Chen, Tryphon Georgiou, and Michele Pavon. Entropic and displacement interpolation: a computational approach using the hilbert metric. SIAM J. Appl. Math., 76(6):2375–2396, 2016.
- [7] Yongxin Chen, Tryphon T Georgiou, Michele Pavon, and Allen Tannenbaum. Relaxed schrödinger bridges and robust network routing. IEEE Trans. Contr. Netw. Sys., 7(2):923–931, 2019.
- [8] Friedrich Eisenbrand, Nicolai Hähnle, and Martin Niemeier. Covering cubes and the closest vector problem. In Proc. 27th Annu. Sympos. Comput. Geom., pages 417–423, 2011.
- [9] Friedrich Eisenbrand and Moritz Venzin. Approximate CVPs in time . Journal of Computer and System Sciences, 2021.
- [10] Auguste H. Gezalyan and David M. Mount. Voronoi diagrams in the Hilbert metric. In Proc. 39th Internat. Sympos. Comput. Geom., pages 35:1–35:16, 2023. doi:10.4230/LIPIcs.SoCG.2023.35.
- [11] D. Hilbert. Ueber die gerade linie als kürzeste verbindung zweier punkte. Mathematische Annalen, 46:91–96, 1895.
- [12] Bas Lemmens and Roger Nussbaum. Nonlinear Perron-Frobenius Theory, volume 189. Cambridge University Press, 2012.
- [13] Bas Lemmens and Roger Nussbaum. Birkhoff’s version of hilbert’s metric and its applications in analysis. arXiv preprint arXiv:1304.7921, 2013.
- [14] Márton Naszódi and Moritz Venzin. Covering convex bodies and the closest vector problem. arXiv preprint arXiv:1908.08384, 2019.
- [15] Frank Nielsen and Laetitia Shao. On balls in a Hilbert polygonal geometry (multimedia contribution). In Proc. 33rd Internat. Sympos. Comput. Geom., pages 67:1–67:4, 2017. doi:10.4230/LIPIcs.SoCG.2017.67.
- [16] Athanase Papadopoulos and Marc Troyanov. From Funk to Hilbert geometry. arXiv preprint arXiv:1406.6983, 2014.
- [17] Athanase Papadopoulos and Marc Troyanov. From Funk to Hilbert geometry. In Handbook of Hilbert geometry, volume 22 of IRMA Lectures in Mathematics and Theoretical Physics, pages 33–68. European Mathematical Society Publishing House, 2014. doi:10.4171/147-1/2.
- [18] Gabriel Peyré, Marco Cuturi, et al. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning, 11(5-6):355–607, 2019.
- [19] David Reeb, Michael J Kastoryano, and Michael M Wolf. Hilbert’s projective metric in quantum information theory. Journal of mathematical physics, 52(8):082201, 2011.
- [20] Thomas Rothvoss and Moritz Venzin. Approximate CVP in time – now in any norm! arXiv preprint arXiv:2110.02387, 2021.