Computational Geometric Learning Jean-Daniel Boissonnat
Fr´ ed´ eric Chazal November 5, 2012
Mariette Yvinec
2
Contents
1 Introduction
9
2 Basic notions of topology 2.1
I
11
Comparing topological spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.1
Homeomorphism, isotopy and homotopy . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.2
Distance between shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2
Simplicial complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3
Nerve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4
Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Geometric data structures
19
3 Convex hulls 3.1
3.2
23
Convex hulls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.1.1
The planar case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.2
Convex hulls in R3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.3
In higher dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Polarity and duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3
4
CONTENTS 3.3
3.4
Combinatorial bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.1
Polytopes in R3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.2
Beyond the third dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.4.1
An incremental algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.4.2
Can we do better ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4.3
Randomisation helps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5
Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.6
Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4 Voronoi diagrams and Delaunay triangulations
37
4.1
Lower envelopes and minimization diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2
Voronoi diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.3
Delaunay triangulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.4
Combinatorial and algorithmic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5
Natural coordinates and function interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.6
Exercises
4.7
Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5 Affine diagrams 5.1
47
Laguerre geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.1.1
Laguerre diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.1.2
Regular Triangulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.1.3
From balls to weighted points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.1.4
Complexity of Laguerre diagram and regular triangulations . . . . . . . . . . . . . . . 51
5
CONTENTS 5.2
Affine diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.3
Examples of affine diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.3.1
Quadratic distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.3.2
k-order Voronoi diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.3.3
Bregman diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.4
Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.5
Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6 Alpha shapes 6.1
6.2
II
59
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.1.1
Alpha complexes and alpha shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1.2
Weigthed alpha complexes and weighted alpha shapes . . . . . . . . . . . . . . . . . . 60
6.1.3
The alpha filtration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Computing alpha shapes and alpha filtrations . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.2.1
Face classification
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.2.2
Gabriel simplices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.2.3
Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.3
Union of balls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.4
Exercises
6.5
Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Triangulation of smooth submanifolds
7 Restricted Delaunay triangulation and surface mesh generation 7.1
67 69
Restricted Delaunay triangulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6
CONTENTS 7.2
Reach and sampling conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.2.1
Projection map, medial axis and reach . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.2.2
Sampling conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.2.3
Basic lemmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
7.3
Simplex quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.4
Approximation of surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.5
Surface mesh generation by Delaunay refinement . . . . . . . . . . . . . . . . . . . . . . . . . 84 7.5.1
A greedy algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.5.2
Properties of the algorithm and of the output mesh
7.5.3
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
. . . . . . . . . . . . . . . . . . . 86
7.6
Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.7
Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8 Manifold reconstruction
97
III
99
Geometric inference
9 Distance functions
101
9.1
Distance function and Hausdorff distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
9.2
Critical points of distance functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
9.3
Topology of the offsets of dK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
9.4
(Un)stability of the critical points of dK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.5
The critical function of a compact set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.6
Sampling conditions and µ-reach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
9.7
Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7
CONTENTS 9.8
Remarks and further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.9
Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
10 Topological persistence
119
10.1 Filtrations of complexes and simplicial homology . . . . . . . . . . . . . . . . . . . . . . . . . 119 10.1.1 Alpha-complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.1.2 Rips complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.1.3 Witness complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.1.4 Filtration associated to a function defined on the vertices of a complex . . . . . . . . . 120 10.2 Homology and Betti numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.2.1 The space of k-chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.2.2 The boundary operator and homology groups . . . . . . . . . . . . . . . . . . . . . . . 121 10.3 Singular homology and topological invariance of Betti numbers . . . . . . . . . . . . . . . . . 123 10.4 An algorithm to compute Betti numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 10.5 Topological persistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 10.5.1 A simple example
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
10.5.2 Topological persistence for a filtration . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 10.5.3 Persistent diagrams and persistent Betti numbers . . . . . . . . . . . . . . . . . . . . . 132 10.5.4 Topological persistence for functions and stability of persistence diagrams . . . . . . . 132 10.6 Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
11 Distance to measures
137
11.1 Back to distance-based inference: the problem of outliers . . . . . . . . . . . . . . . . . . . . . 137 11.2 Measures and the Wasserstein distance W2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
11.2.1 Replacing compact sets by measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8
CONTENTS 11.2.2 The Wasserstein distance W2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 11.3 Distance function to a probability measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 11.3.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 11.3.2 Equivalent formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 11.3.3 Stability of the distance function to a measure . . . . . . . . . . . . . . . . . . . . . . 146 11.3.4 The distance to a measure is distance-like. . . . . . . . . . . . . . . . . . . . . . . . . . 147 11.4 Applications to geometric inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 11.4.1 Extending the sampling theory for compact sets . . . . . . . . . . . . . . . . . . . . . 150 11.4.2 Distance to a measure vs. distance to its support . . . . . . . . . . . . . . . . . . . . . 152 11.4.3 Shape reconstruction from noisy data . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 11.5 Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Chapter 1
Introduction Intro on geometric data analysis. see e.g. the intro of the european project. This book intends to provide a geometric and algorithmic view of machine learning. The main motivation is to provide effective algorithms to analyze data. Instead of surveying the many approaches that have been proposed in the literature, we focus on provably correct methods. In a first part (chapters 3-5), we introduce Voronoi diagrams and their dual Delaunay triangulations. These are fundamental data structures that have been extensively studied in computational geometry. Given n points (also called sites) of Rd , the associated Voronoi diagram subdivides Rd into regions, each region consisting of the points of Rd that are closer to one of the sites. We establish a connexion between Voronoi diagrams and polytopes that allows to derive tight combinatorial bounds and efficient algorithms to construct Voronoi diagrams. This first part is a (very brief) introduction to computational geometry. The interested reader will find more material in the textbooks devoted to the subject [14, 15, 36, 56]. In a second part (chapters ??-??), we discuss some fundamental geometric algorithms used in machine learning. Since the data are usually living in some high dimensional space, exact algorithms have to be replaced by approximate algorithms. In a third part (chapters 7-8), we show how Voronoi diagrams and Delaunay triangulations can be used to sample and approximate a smooth manifold. The main tool is the concept of Delaunay triangulation restricted to a surface. Under some sample conditions, we will show that the restricted Delaunay triangulation of a surface S is a good approximation of S, both in a topological and in a geometric sense. We will present and analyze an algorithm to compute such an approximation, and present some results.
9
10
CHAPTER 1. INTRODUCTION
In the last part (chapters 9-11), we introduce geometric inference. Notations : We identify a point x ∈ Rd and the vector of its coordinates. We note x · y the dot product and x2 = x · x = kxk2 the squared euclidean norm of x. B(c, r) denotes the ball of center c and radius r, aff(f ) the affine hull of f . Remark : The latest version of these notes can be downloaded
ftp://ftp-sop.inria.fr/... All comments are welcome and can be addressed to the authors.
[email protected] [email protected] [email protected]
Chapter 2
Basic notions of topology Basic mathematical notions useful in the sequel of this book are given in this chapter. For conciseness, the definitions and results are not always given in their full generality. They are restricted to the simplest version necessary to follow and understand the results and proofs of this book.
2.1
Comparing topological spaces
There are many ways to compare and to measure how close two shapes are.
2.1.1
Homeomorphism, isotopy and homotopy
In topology, two topological spaces are considered to be the same when they are homeomorphic. Definition 2.1 Two topological spaces X and Y are homeomorphic if there exists a continuous bijective map h : X → Y such that its inverse h−1 is also continuous. As an example, a circle and a simple closed polygonal curve 1 are homeomorphic. On the other hand, a circle and a segment are not homeomorphic. If X is homeomorphic to the standard unit ball of Rd , X is called a topological ball. 1 A continuous polygonal curve P with consecutive edges e1 = [p1 , p2 ], e2 = [p2 , p3 ], · · · en = [pn , pn+1 ] is simple and closed if and only if ei ∩ ej = ∅ whenever 2 ≤ |i − j| mod (n), ei ∩ ei+1 = pi+1 for i = 1, · · · n − 1 and en ∩ e1 = p1
11
12
CHAPTER 2. BASIC NOTIONS OF TOPOLOGY
When the considered spaces X and Y are subspaces of Rd , the notion of isotopy is stronger than homeomorphy to ditinguish between spaces. Definition 2.2 An isotopy between X and Y is a continuous application F : X × [0, 1] → Rd such that F (., 0) is the identity map on X, F (X, 1) = Y and for any t ∈ [0, 1], F is an homeomorphism between X and F (X, t). An ambient isotopy between X and Y is a map F : Rd × [0, 1] → Rd such that F (., 0) is the identity map on Rd , F (X, 1) = Y and for any t ∈ [0, 1], F is an homeomorphism of Rd . Intuitively, the previous definition means that X can be continuously deformed into Y without creating any self-intersection or topological changes. Note that restricting an ambient isotopy to X × [0, 1] gives an isotopy. In fact, a classical result of differential topology states that the converse is also true under some quite general conditions: if X and Y are isotopic, then they are ambient isotopic (see [59]). As a consequence, in the sequel of this notes we do not pay attention to the considered notion of isotopy. The notion of isotopy is stronger than homeomorphy in the sense that if X and Y are isotopic, then they are obviously homeomorphic. In general two homeomorphic subspaces of Rd may not be isotopic. This is the case for a knotted and an unknotted torus embedded in R3 as the ones on figure 2.1. Note that proving these two surfaces are not isotopic is a non obvious task that require some background in algebraic topology.
Figure 2.1: Two surfaces embedded in R3 homeomorphic to a torus that are not isotopic. In general deciding whether two spaces are homeomorphic or not is a very difficult task. It is often more convenient to work with a weaker notion of equivalence between spaces called homotopy equivalence. A classical convenient way to characterize and quantify topological properties and features of spaces is to
13
2.1. COMPARING TOPOLOGICAL SPACES
consider their topological invariants. They are mathematical objects (numbers, groups, polynomials,...) associated to each topological space that have the property of being the same for homeomorphic spaces. An important advantage of homotopy equivalence is that it preserves all the topological invariants that are considered in the sequel. Given two topological spaces X and Y , two maps f0 , f1 : X → Y are homotopic if there exists a continuous map H : [0, 1]×X → Y such that for all x ∈ X, H(0, x) = f0 (x) and H(1, x) = f1 (x). Homotopy equivalence is defined in the following way (see [53], pp. 171-172 or [66] p. 108 for more details). Definition 2.3 Two topological spaces X and Y have the same homotopy type (or are homotopy equivalent) if there exist two continuous maps f : X → Y and g : Y → X such that g ◦ f is homotopic to the identity map in X and f ◦ g is homotopic to the identity map in Y . The homotopy type is clearly a topological invariant: two homeomorphic spaces are homotopy equivalent. The converse is false: a point and a segment are homotopy equivalent but they are not homeomorphic. When Y is a subset of X, the homotopy equivalence between X and Y can be characterized using the following result. Proposition 2.1 If Y ⊂ X and if there exists a continuous map H : [0, 1] × X → X such that: • ∀x ∈ X, H(0, x) = x • ∀x ∈ X, H(1, x) ∈ Y • ∀y ∈ Y and ∀t ∈ [0, 1], H(t, y) ∈ Y then X and Y are homotopy equivalent. If the last property of H is replaced by the stronger one ∀y ∈ Y and ∀t ∈ [0, 1], H(t, y) = y, then, by definition, H defines a deformation retract of X to Y .
2.1.2
Distance between shapes
Given a compact set X of Rd , define X ε to be the tubular neighborhood or offset of X of radius ε, i.e. the set of all points at distance at most ε from X X ε = {y ∈ Rd : inf kx − yk ≤ ε} = x∈X
[ x∈X
B(x, ε)}.
14
CHAPTER 2. BASIC NOTIONS OF TOPOLOGY
Figure 2.2: Two curves whose Haudorff distance is small compared to their Fr´echet distance.
Definition 2.4 The Hausdorff distance dH (X, Y ) between two closed subsets X and Y of Rd is the infimum of the ε ≥ 0 such that X ⊂ Y ε and Y ⊂ X ε . Equivalently, ! dH (X, Y ) = max sup( inf kx − yk), sup ( inf kx − yk) . y∈Y x∈X
x∈X y∈Y
The Hausdorff distance defines a distance on the space of compact subsets of Rd . In some cases, the Hausdorff distance is not always a good measure of the similarity of two shapes. This is illustrated in Figure ?? where two curves are close for the Hausdorff distance but look quite different. A more satisfactory measure of the similarity of two shapes is the so-called Fr´echet distance. Definition 2.5 The Fr´echet distance between two subsets X and Y of Rd is dF (X, Y ) = inf sup d(p, h(p)), h
p∈X
where h ranges over all homeomorphisms from X to Y . Observe that the Fr´echet distance is finer than the Hausdorff distance to compare shapes (dF (X, Y ) ≥ dH (X, Y )) but it is more restrictive since it only allows to compare shapes that are homeomorphic. Note that if F : X × [0, 1] → Rd is an isotopy between X and Y , then supx∈X kF (x, 0) − F (x, 1)k is an upper bound on the Fr´echet distance between X and Y . Other criteria are also useful when considering smooth curves and surfaces. Of upmost importance is the approximation of the normal field. As illustrated in Figure 7.5, a triangulated surface can be arbitrarily close to a cylinder for the Hausdorff or even the Fr´echet distance, while the normal fields of the two surfaces are very different. As a consequence, it is impossible to estimate the area of the cylinder from the area of the triangulated surface.
15
2.2. SIMPLICIAL COMPLEXES
Figure 2.3: By connecting the points as on the left side, the normals of the two facets can be made arbitrarily close to perpendicular to the normals to the cylinder at their vertices. Differently, the normals of the two triangles on the right side are close to the normals of the cylinder at their vertices. Arbitrarily many points can be put on the cylinder and connected in either way.
2.2
Simplicial complexes
Geometric shapes like curves, surfaces or more generally manifolds are “continuous” mathematical objects that cannot be directly encoded as a finite discrete structure usable by computers or computing devices. It is thus necessary to find representations of these shapes that are rich enough to faithfully encode their geometric structure and to comply with the contraints inherent to the discrete and finite nature of implementable data structures. On another side, when the only available data are point clouds sampled around unknown shapes, it is necessary to be able to build some continuous space on top of the data that faithfully encode the topology and the geometry of the underlying shape. Simplicial complexes offer a classical and flexible solution to overcome these difficulties. Simplicial complexes are made of simplices we first define. The points of a finite set {p0 , p1 , · · · pk } in Rd are said to be affinely independent if they are not contained in any affine subspace of dimension less than k. The set of convex combinations of k + 1 affinely independent points p0 , . . . , pk k X i=0
λi pi , with
k X i=0
λi = 1 and λi ≥ 0
is called a k-dimensional simplex or a k-simplex for short. A 0-simplex is a point, a 1-simplex is a line segment, a 2-simplex is a triangle, a 3-simplex is a tetrahedron. The faces of a simplex s whose vertex set is P are the simplices of lower dimensions obtained as convex combinations of subsets of P . The k-faces of a l-simplex s, l > k, are obtained by taking the convex
16
CHAPTER 2. BASIC NOTIONS OF TOPOLOGY
combinations of all the subsets of k + 1 vertices of s. For example, the faces of a triangle [p0 , p1 , p2 ] are the simplices ∅, [p0 ], [p1 ], [p0 , p1 ], [p1 , p2 ], [p2 , p0 ] and [p0 , p1 , p2 ]. Observe that, by convention, ∅ is usually added to the faces as the simplex spanned by the empty subset of the vertices. Definition 2.6 (Simplicial complex) A (finite) simplicial complex C is a finite union of simplices such that: – any face of any simplex of C is a simplex of C, – the intersection of any two simplices of C is either empty or a common face of both. The simplices of C are called the faces of C. The dimension of C is the highest dimension of its simplices. A complex of dimension k is also called a k-complex. A subset of the simplices of C which is itself a simplicial complex is called a subcomplex of C. The j-skeleton Skj (C) of C is the union of the simplices of dimension at most j; Skj (C) is a subcomplex of C.
Figure 2.4: Left: an example of a simplicial complex. Right: a union of simplices which is not a simplicial complex For a simplicial complex C in Rd , its support |C| is the subset of Rd that is the union of the simplices of C. When there is no risk of confusion, we do not clearly make the distinction between a complex in Rd and its support. In the definition above, the faces of C are geometric simplices of Rd and C is embedded in Rd . However, since each face of C is determined by its vertices, a simplicial complex can be defined in a purely combinatorial way: given a finite set of points P = {p1 , · · · pn } (not necessarily from an Euclidean space) an abstract simplicial complex C is a subset {σ1 , · · · , σm } of the set of subsets of P such that, for any i = 1 · · · m, all
2.3. NERVE
17
the subsets of σi are in C and for all i, j = 1 · · · m, σi ∩ σj is in C. Here the faces of C are not considered as geometric simplices in Rd but just as sets of vertices. JD : I need cell complexes MY: I would need cofaces to be defined
2.3
Nerve
JD : useful even in the early chapters to def. Delaunay and alpha-shapes. definition. State without proof the nerve th.
2.4
Exercises
Exercise 2.1 Show that n hyperplanes are in general position iff their dual points are in general position. Exercise 2.2 Let X be a segment (i.e. a space homeomorphic to [0, 1]) and let Y be a point. Prove that X and Y are homotopy equivalent but not homeomorphic. Exercise 2.3 A simplicial complex C is said to be (path-)connected if for any pair of points (x, y) ∈ C there exists a continuous path γ : [0, 1] → C such that γ(0) = x and γ(1) = y. Prove that a simplicial complex C is connected if and only if its 1-skeleton is connected. Exercise 2.4 Give examples of simplicial complexes in R3 that are homeomorphic to a ball, a sphere, and a torus. ————————————————————————-
18
CHAPTER 2. BASIC NOTIONS OF TOPOLOGY
Part I
Geometric data structures
19
21 ————————————————————————-
22
Chapter 3
Convex hulls 3.1
Convex hulls
Let E be a finite set of points of Rd . The convex hull conv(E) of a finite set of points E = {p1 , . . . , pn } is the smallest convex set (for the inclusion relation) that contains E or, equivalently, the set of all convex combinations of the pi conv(E) =
n X i=1
λi pi , with
k X i=0
λi = 1, and λi ≥ 0, i = 1 . . . , n.
The convex hull of a finite set of points is called a polytope. Hence, a polytope is a closed bounded subset of Rd . Simplices are polytopes. Let P be a polytope. We say that a hyperplane h supports P if h ∩ P 6= ∅ and if P belongs to one of the two half spaces defined by h. The intersection of P with a supporting hyperplane h is called a face of P . A polytope has a finite number of faces. Each of its faces is itself a polytope. The boundary of P is the union of its faces. The faces of dimension 0 are called the vertices of P . The vertices of conv(E) are among the points of E and conv(E) is also the convex hull of its vertices. The faces of dimension 1 are called the edges and we will call the faces of dimension d − 1 facets. A point set is said to be in general position when no subset of j + 2 points lie in a same affine subspace of dimension j for j = 1, ..., d − 1. When the vertices of P are in general position, all the faces of P are simplices and P is called simplicial. The set of faces of P is a simplicial complex (see exercise ??), called the boundary complex of P and denoted by bd(P ). When the points are not in general position, some faces may not be simplices. Still, the faces of P satisfy the two incidence properties of a simplicial complex. We say that the set of faces of P is a cell complex. 23
24
CHAPTER 3. CONVEX HULLS
Alternatively, P can be defined as the intersection of a finite number of half-spaces. Specifically, let h be the affine hull of a (d − 1)-face of P and h− the half-space bounded by h that contains P . P is the intersection of all such half-spaces. In the sequel, we will be assume that the points are in general position.
3.1.1
The planar case
conv(E) will be represented by a circular list L whose elements are the vertices of conv(E) sorted in counterclockwise order. The numerical operations that will be used are comparing the x or y coordinates of two points of E, and computing the orientation of a triangle, which reduces to evaluating the sign of a wedge product or, equivalently, of the determinant of a 3 × 3 matrix 1 1 orient(pi pj pk ) = (pi − pj ) ∧ (pi − pk ) = pi pj
1 1 1 = x xj pk i yi yj
1 xk yk
.
orient(pi pj pk ) is 0 when pi , pj and pk are colinear, positive if the triangle pi pj pk is oriented positively (counterclockwise), negative if pi pj pk is oriented clockwise. Observe that the output of the numerical operations above belongs to the discrete set {−, 0, +}. We call them predicates. The orientation predicate is mandatory. Comparisons are not necessary but make things easier.
3.1.2
Convex hulls in R3
A vertex s of conv(P ) is represented by a pointer to the corresponding point point(s). Each vertex points to one of its incident facets. Each facet of conv(P ) has three pointers to its three vertices p1 , p2 , p3 and three pointers to its three incident facets, f1 , f2 , f3 . By convention, fi is the facet that has not pi as a vertex. The important predicate is still the orientation predicate orient(pi , pj , pk , pl ) =
1 1 xi xj yi yj z i zj
1 1 xk xl = ((pj − pi ) ∧ (pk − pi )) · (pl − pi ). yk yl zk zl
If orient(pi , pj , pk , pl ) = 0, the points pi , pj , pk , pl are coplanar.
25
3.1. CONVEX HULLS pi
0
2 t2
0
0
1 t1
t 1 pj
1 2
2 1
2 pk
t0 0
Figure 3.1: Representation of a convex hull in R3 .
We require, in the sequel, that the convex hull is oriented, meaning that all its facets are oriented negatively. A facet f = pi pj pk is oriented negatively if, for any p ∈ P , orient(pi , pj , pk , p) < 0.
3.1.3
In higher dimensions
We can represent a convex hull in Rd in very much the same way as we did in R3 . We store for each (d − 1)-face its d vertices and its d neighboring facets. A simplex pi0 . . . pid is oriented positively, negatively or is degenerate (the affine subspace generated by its vertices has dimension < d) depending whether
1 orient(pi0 , . . . , pid ) = sign p i0
. . . 1 = sign|pi1 − pi0 . . . pid − pi0 | . . . p id
is positive, negative or zero. A geometric interpretation that will be useful is the following. Let us note h the hyperplane passing through pi0 , . . . , pid−1 and π(p) the projection of point p onto xid = 0. If h is not vertical and if orient(π(pi0 ), . . . , π(pid−1 )) > 0, orient(pi0 , . . . , pid ) is > 0, < 0 or 0 whether the point pid is above, below or in h.
26
CHAPTER 3. CONVEX HULLS
h3 h∗3
h1
h2
*
s
h∗1
s
h∗2
Figure 3.2: Point-line duality.
3.2
Polarity and duality
Let h be a non vertical line of R2 of equation y = ax − b. We associate to h the polar point h∗ = (a, b). Conversely, to point p = (x, y), we associate the polar line p∗ = {(a, b) : b = xa − y}. Note that p∗ consists of the polar points of the lines passing through p. The mapping
∗
• is involutive and thus is bijective : h∗∗ = h and p∗∗ = p • preserves incidences : p = (x, y) ∈ h ⇐⇒ y = ax − b ⇐⇒ b = xa − y ⇐⇒ h∗ ∈ p∗ . Moreover, if h+ = {(x, y) : y > ax − b}, the mapping • reverses inclusions
∗
p ∈ h+ ⇐⇒ h∗ ∈ p∗+ .
Let us consider a set H of n lines h1 , . . . , hn and note P the (unbounded) polygon that is the intersection of the half-planes h+ i . Each vertex s of P is the intersection point of two lines hi and hj , and s lies above all the other lines hk , k 6= i, j. The polar point s∗ of s is therefore the line lij = (h∗i h∗j ). Moreover, by the inclusion-reversing property of the mapping ∗ , no point of H ∗ = {h∗1 , . . . , h∗n } lie below lij . It follows that lij supports the lower hull of H ∗ , i.e. the simplicial complex noted lowerhull(H ∗ ) that consists of the faces of the convex hull of H ∗ whose supporting hyperplanes are not above any point of H ∗ . In this way, we reduce the construction of P to the construction of a lower hull. In higher dimensions, we can proceed in a similar way and define a polarity between points and hyperplanes, which will lead to a dual correspondence between convex hulls and intersections of half-planes.
27
3.3. COMBINATORIAL BOUNDS
Let h be a non vertical hyperplane of Rd of equation xd = a · x − b, where x = (x1 , . . . , xd−1 ) ∈ Rd−1 . We associate to h the polar point h∗ = (a, b) of Rd . Conversely, to a point p = (x, xd ) ∈ Rd−1 × R, we associate the polar hyperplane p∗ = {(a, b) ∈ Rd−1 × R : b = x · a − xd }. Consider now a set of n hyperplanes h1 , . . . , hn . We denote by P the (unbounded) polyhedron that is the 0 intersection of the half-planes h+ i and by P the cell complex of its faces (of dimensions 0, . . . , d − 1). Let f be a face of P and assume without loss of generality that h1 , . . . , hk are the k hyperplanes that contain f . If p denotes a point of Rd , we deduce from the discussion above p ∈ h1 ∩ . . . ∩ hk ⇐⇒ h∗1 , . . . , h∗k ∈ p∗ .
(3.1)
+ Moreover, if p ∈ f , p ∈ h+ i for all i = 1, . . . , n and p ∈ int hi for all k < i ≤ n. Equivalently,
∀i, k < i ≤ n, h∗i ∈ int p∗+ .
(3.2)
Let H ∗ = {h∗i }i=1,...,n . We deduce from (3.1) and (3.2) that, if p ∈ f , p∗ is a hyperplane that supports the convex hull conv(H ∗ ) and that f ∗ = conv(h∗1 , . . . , h∗k ) is a face of the lower hull of H ∗ , noted P 0∗ . We now associate to each face f of P 0 the corresponding face f ∗ of P 0∗ : this correspondence is involutive (and therefore bijective) and reverses inclusions. We say that the two cell complexes P 0 and P 0∗ are dual. More generally, two cell complexes C1 and C2 are said to be dual if there exists an involutive correspondence between the faces of C1 and the faces of C2 that reverses the inclusions, i.e. for any two faces f and g of C1 , their dual faces f ∗ and g ∗ satisfy: f ⊂ g ⇒ g ∗ ⊂ f ∗ . If the n hyperplanes hi are in general position, meaning that the intersection of any subset of k of them is an affine space of dimension d − k, P is called simple. The dual of a k face of P is a (d − 1 − k)-face of P 0∗ .
3.3 3.3.1
Combinatorial bounds Polytopes in R3
The number of vertices s, edges a and facets f are related by the celebrated Euler’s formula : s − a + f = 2. Let P be a polytope of R3 . The Schlegel diagram of P is a planar model obtained when P is seen in perspective from a position just outside the center of one facet. This facet appears as a large polygon with all the remaining faces filling its interior.
28
CHAPTER 3. CONVEX HULLS
Figure 3.3: Schlegel diagrams of a tetrahedron and of a cube. We prove Euler’s formula for any connected planar map. We build the map from a single vertex by adding edges one-by-one. At each step, the edge to be inserted to the current map C has one or two vertices in C. In the first case, s does not change while a and f both increase by 1. In the other case, f does not change while s and a both increase by 1. In both cases, s − a + f remains invariant. At the beginning s = f = 1 and a = 0, and thus s − a + f = 2. This value 2 is maintained troughout the whole construction. The formula is thus true for any connected planar map and, in particular, for any Schlegel diagram, and therefore for any bounded convex polyhedron of R3 . Each edge is incident to two facets and each facet has at least three edges. We thus have 2a ≥ 3f, with an equality in the case where all facets are triangles. Using this inequality in Euler’s formula, we get a ≤ 3s − 6
f ≤ 2s − 4 with an equality when all facets are triangles.
3.3.2
Beyond the third dimension
The combinatorial complexity of a polyhedron defined as the intersection of n half-spaces of Rd is given by the celebrated upper bound theorem.
29
3.3. COMBINATORIAL BOUNDS
s � = s� a =a+1 f� = f + 1
s�� = s + 1 a =a+1 f� = f
Figure 3.4: The induction step in the proof of Euler’s formula.
Theorem 3.1 (Upper Bound Theorem) d The total number of faces of a polytope defined as the interd section of n half-spaces of R is Θ nb 2 c .
Proof We present a simple proof of the asymptotic version of the upper bound theorem due to Seidel [74]. Let P be the polytope and let p one of its vertices. We assume that all the vertices of P are incident to exactly d edges (which is the general situation). Otherwise, we can slightly perturb the hyperplanes bounding the half-spaces defining P so that the hyperplanes become in general position. During this process, the number of faces of P can only increase. In addition, we assume without loss of generality that no two vertices have the same xd coordinate. Among the edges that are incident to p (there are d such edges, see exercise ??), at least d d2 e edges are in the half-space h+ : xd ≥ xd (p) or at least d d2 e edges are in the half-space h− : xd ≤ xd (p). Therefore, p is a vertex of extremal xd -coordinate of at least one face of dimension d d2 e since the affine hull of any subset of k edges of a simple polytope supports a d − k-face of the polytope (exercice 3.4). Since any face has at most one vertex of maximal xd coordinate and one vertex of minimal xd -coordinate, the number of vertices of P is at most twice the number of d d2 e-faces of P . Under the general position assumption, a k-face is the intersection of d − k of the hyperplanes that define d n P (see exercise ??). We conclude that the number of k-faces is = O(nd−k ), which is O(nb 2 c ) for d−k d
k = d d2 e. From the above discussion, we then conclude that the number of vertices of P is O(nb 2 c ).
Under the general position assumption, the number of faces (of any dimension) that are incident to a vertex is bounded by a constant that depends on d but not on n. Hence, the upper bound holds also for the number of faces of any dimension.
30
CHAPTER 3. CONVEX HULLS
The duality introduced in section 3.2 immediately implies that the same bound holds for polytopes defined as the convex hull of n points.
3.4 3.4.1
Algorithms An incremental algorithm
We start with the case of a set P of n points in R2 . 1. We sort the points by lexicographic order. We therefore have for any two indices i < j x(pi ) < x(pj ) or
x(pi ) = x(pj ) y(pi ) < y(pj )
We represent conv(P ) by two lists that share the same first element p1 and the same last element pn . The first one, L+ , represents the vertices of the upper hull, located above p1 p2 , the other one, L− , represents the vertices of the lower hull, located below p1 p2 . We describe only the construction of L+ , the construction of L− being entirely symetrical. 2. L+ is initialized with p1 and p2 . 3. Loop :
for i = 3, . . . , n while tail(L+ ) 6= head(L+ ) and orient(pi , tail(L+ ), pred(tail(L+ ))) ≤ 0 remove tail(L+ ) from L+ ; pi ← tail(L+ ). The initial sorting can be done using O(n log n) comparisons. In step 3, a unique new element is inserted in L+ . The other elements of L+ that are considered are, all except the last one, removed from the list and won’t be inserted again. The total cost of step 3 is therefore O(n). Observe that the cost of a single iteration can be Ω(n); nevertheless the total amortized cost is also linear. The overall complexity of the algorithm is therefore O(n log n). Note that the algorithm executes O(n log n) comparisons of coordinates and only O(n) orientation tests.
3.4. ALGORITHMS
3.4.2
31
Can we do better ?
It is known that sorting n elements requires at least log2 (n!) = Ω(n log n) comparisons. We deduce that computing the convex hull of n points requires at least Ω(n log n) comparisons and orientation tests. Indeed, take n numbers x1 , . . . , xn . We associate to each xi the point pi = (xi , x2i ). The pi lie on the parabola y = x2 . If we know the convex hull of the pi , we can deduce in linear time the list of the xi sorted by increasing values. Observe that the orientation test reduces in this case to three comparisons. Indeed, xi − xj xi − xk 2 x − x2 x2 − x2 = (xi − xj )(xj − xk )(xk − xi ). i j i k As any sorting algorithm must execute Ω(n log n) comparisons, we conclude that any convex hull algorithm using comparisons and orientation tests only must execute Ω(n log n) such operations.
3.4.3
Randomisation helps
The algorithm of section 3.4.1 can be extended to Rd but its complexity cannot remain O(n log n). In fact, no incremental algorithm can have an O(n log n) complexity in dimensions 3 and higher (see exercise 3.6). Nevertheless, optimal incremental algorithms can be obtained if we introduce some randomness. The algorithm is incremental and introduces the points one by one. We denote by pi the point introduced at Step i. We first describe the case of a point set P of R2 . Let o be a point in the interior of conv(P ), e.g. the barycenter of three non collinear points. We denote by Pi the subset of the i first points that have been inserted. The algorithm maintains two data structures. First, we maintain the current convex hull conv(Pi ) at step i. Second, we maintain a graph called conflict graph. The conflict graph is a bipartite graph that links any point pj that has not been inserted yet (i.e. j > i) to an edge e of the current convex hull conv(Pi ) that is intersected by the line segment opj . A point and an edge that are joined by an arc in the conflict graph are said to be in conflict. Consider step i + 1. An edge of conv(Pi ) is said to be red if its supporting line intersects the line segment opi+1 . An edge that is not red is said to be blue. If conv(Pi ) is oriented positively, an edge ab is red if and only if orient(a, b, pi+1 ) < 0. The union of the red edges is a connected portion of the boundary of conv(Pi ). Let s and t be its endpoints. Updating conv(Pi ) consists in replacing the red edges by the two new edges spi+1 and pi+1 t. Let e be an edge of conv(Pi ) in conflict with pi+1 . As e is intersected by opi+1 , e is red and must be removed. To find the other red edges, we walk on the boundary of conv(Pi ) (in both directions) until we meet a blue edge : we thus get s and t, and we can construct conv(Pi+1 ) in time proportional to the number of red edges.
32
CHAPTER 3. CONVEX HULLS
It remains to update the conflict graph. For each point of index j > i + 1 whose conflict edge has just been removed, we determine which of the two new edges is intersected by the half-line [opj ). Let e0 = a0 b0 be that edge. If orient(a0 b0 pj ) ≥ 0, pj cannot be a vertex of conv(P ) and is no longer considered. Otherwise, we add an arc in the conflict graph joining pj and e0 . In higher dimensions, the algorithm is similar. An edge in the conflict graph links now a point to be inserted and a facet of the current convex hull which is called the conflicting facet of the point. The main difference comes from the fact that the boundary of the convex hull is a triangulated surface and not a polygonal curve and that the number of facets incident to a vertex is not bounded by a constant. We identify the red facets by traversing the adjacency graph of the facets of conv(Pi ). Let R be the union of the red faces. To construct conv(Pi+1 ), we create new faces fk = conv(pi+1 , gk ) for all (d − 2)-faces gk of the boundary of R, and remove the red facets. The adjacency graph is updated accordingly. We then need to update the conflict graph. This is done as follows. We traverse the adjacency graph of the red facets of conv(Ei ) that are in conflict with a not yet inserted point pj , j > i + 1. Such facets are thus in conflict with two points, namely pi+1 and pj . Let Fj denote the set of such facets. It is easy to see that Fj is connected and that, if pj lies outside conv(Ei+1 ), the new facets that are in conflict with pj are connected to Fj by (d − 2)-faces of the boundary of the union R of the red facets. More precisely, using the conflict graph, we detect the points not yet inserted whose conflicting facet is red. We consider in turn each such point. Let pj , j > i + 1, be such a point and let fj be the red facet of conv(Ei ) in conflict with pj . Starting from fj , we walk on the adjacency graph of the red facets that are in conflict with pj . Let f be a red facet in conflict with pj that is encountered during the walk. We visit its adjacent facets that have not yet been visited. Let g be a facet of conv(Ei ) adjacent to f . If one of the two following cases occur, pj gets a new conflicting facet, the walk is stopped, and another point not yet inserted is considered. Case 1 :
if g conflicts with q but not with pi+1 , create an edge in the conflict graph between g and pj
Case 2 : if g does not conflict with q nor with pi+1 , there exists a new facet f 0 containing the (d − 2)-face g ∩ f . If f 0 conflicts with pj , then create an edge in the conflict graph between f 0 and pj . If the walk traverse all red facets in conflict with pj without encountering one of the above two cases, pj lies inside conv(Ei+1 ) and is discarded. We deduce from the above discussion that this procedure will find a new conflict for all points pj , j > i + 1, that lie outside conv(Ei+1 ) and whose conflicting facet is red and is to be removed. To analyze this algorithm, we assume that the points are inserted in random order. For a random sample R of size r, we call facet any d-uplet of points of R and denote by F (R) the set of facets of R. We denote by F0 (R) the set of facets of conv(R) (the facets with no conflict), and by F1 (R) the set of facets of R
33
3.4. ALGORITHMS
with one conflict, i.e. f ∈ F1 (R) iff one of the two open halfspaces defined by aff(f ) contains exactly one point of R. We further write C0 (r, X) and C1 (r, X) for the expected sizes of F0 (R) and F1 (R) respectively where the expectation is taken over all random subsets R ⊂ X of size r. By the upper bound theorem, d C0 (r, E) = O(rb 2 c ). The next lemma shows that the same bound holds for C1 (r, E). d
Lemma 3.1 C1 (r, E) = O(rb 2 c ). Proof Let R0 be a subset of R obtained by removing a random point p from R. A facet f of F0 (R0 ) is either a facet of F1 (R) if p is the point in conflict with f (which happens with probability 1r ), or a facet of F0 (R) if all the d points that are the vertices of f remains in R0 (which happens with probability r−d r ). Taking the expectation, we get
1 r−d |F1 (R)| + |F0 (R)| r r 1 r−d C0 (r − 1, E) = C1 (r, E) + C0 (r, E) r r C1 (r, E) = d C0 (r, E) − r (C0 (r, E) − C0 (r − 1, E)) d = O(rb 2 c ) C0 (r − 1, R) =
Let us bound the expected number of facets created at step i. In R2 , this number is 2. Consider the situation in Rd . Since the algorithm inserts the points of E in random order, Ei is a random subset of E of size i. We bound the expected number N (i) of facets created at step i. We have X
N (i) =
f ∈F (E)
proba(f ∈ F0 (Ei )) ×
d i
since a face of conv(Ei ) has been created at step i if and only if one of its d vertices is pi , which arises with probability di . Using the upper bound theorem, we deduce N (i) =
d d b d c O i 2 = O(nb 2 c−1 ). i
In particular, when d = 2 or 3, E(ni ) = O(1). By summing over all i and using linearity of expectation, d we obtain that the expected total number of created (and therefore also removed) facets is O(nb 2 c ). This bound bounds also the space used by the algorithm.
34
CHAPTER 3. CONVEX HULLS
We now bound the cost of updating the conflict graph. The cost of updating the conflict graph over all steps is proportional to the total number of conflicts between facets that have been created and points not yet inserted. We first count the number of conflicts between the new facets of conv(Ei ) and the remaining points pj , j > i. Since the algorithm inserts the points of E in random order, Ei is a random subset of E and pj is a random point of E \ Ei . It follows that Ei+ = Ei ∪ {pj } is a random subset of i + 1 points of E. We bound N (i, j) (with i < j), the expected number of conflicts between the facets of conv(Ei ) that are created at step i and in conflict with the j-th point pj . We have N (i, j) =
X f ∈F (E)
proba(f ∈ F1 (Ei+ )) ×
d 1 d C1 (i + 1) × = i i+1 i (i + 1)
since the point that conflicts with f can be any point of Ei+ with the same probability before, the probability for a facet of conv(Ei ) to be created at step i is di .
1 i+1
and, as seen
By summing over all steps i and all remaining points, and using the linearity of expectation, we obtain that the expected total cost of updating the conflict graph is n X n X
d
N (i, j) = O(n log n + nb 2 c ).
i=1 j=i+1
We sum up the results of this section in the following theorem. d Theorem 3.2 The convex hull of n points of Rd can be constructed in time Θ n log n + nb 2 c . Using the duality introduced in section 3.2, we immediately deduce the following corollary d Corollary 3.1 The intersection of n half-spaces of Rd can be constructed in time Θ n log n + nb 2 c using d Θ nb 2 c space.
3.5
Exercises
Exercise 3.1 Show that a polytope P is the convex hull ot its vertices. Exercise 3.2 Let P be a polytope and let H be the set of hyperplanes that support its facets. To each hyperplane h ∈ H, we associate the half-space h+ bounded by h that contains P . Show that P = ∩h∈H h+ .
3.6. BIBLIOGRAPHICAL NOTES
35
Exercise 3.3 Show that the intersection of any finite set of faces of a polytope is also a face of the polytope. Exercise 3.4 Prove that if P is a simple polyhedron and p a vertex of P , the affine hull of any subset of k < d edges incident to p contains a face of P of dimension d − k. (Hint: use exercise 3.3 and duality) Exercise 3.5 Extend the discussion of section 3.2 to the case of the intersection H of n general half-spaces (not necessarily all above their bounding line) assuming we know a point o in H. (Hint : To the point p, we associate the polar line p∗ p∗ = {∀x ∈ p∗ , (x − o) · (p − o) = 1}. To a line h not passing through o, we associate the polar point h∗ : (h∗ − o) · (x − o) = 1, ∀x ∈ h. If we denote by h+ the half-space bounded by h not containing o, we can easily adapt the above discussion and get a bijection between the faces of the intersection of the half-spaces and the convex hull of the polar points.) Exercise 3.6 Show that any incremental algorithm that constructs the convex hull of n points of R3 takes Ω(n2 ) time in the worst-case. (Hint : take half of the points on a circle in the plane x = 0 centered at O and the other points on the x-axis, x > 0. Insert the points on the circle before the points on the x-axis.) Exercise 3.7 Show that we can remove a point from the convex hull of a set of n points in expected time O(log n).
3.6
Bibliographical notes
A modern introduction to the theory of polytopes can be found in Ziegler’s book [78]. The original proof of the upper bound theorem has been established by McMullen in 1970. The simple asymptotic version given in Theorem 3.1 is due to Seidel [74]. Chazelle [28] has proposed a deterministic algorithm to compute the convex hull of a finite point set in any dimension. However, the algorithm is mostly of theoretical interest and no implementation is known. An excellent introduction to algorithms can be found in the book of Cormen, Leiserson and Rivest [35]. The theory of randomized algorithms is well-developed and finds applications in many areas of computer science. See the book by Motwani and Raghavan for a broad perspective [64].
36
CHAPTER 3. CONVEX HULLS
Chapter 4
Voronoi diagrams and Delaunay triangulations Voronoi diagrams are fundamental data structures that have been extensively studied in Computational Geometry. In this chapter, we introduce Euclidean Voronoi diagrams of points and establish a correspondence between those diagrams and polyhedra in a one dimension higher space. This allows to derive tight bounds on their combinatorial complexity.
4.1
Lower envelopes and minimization diagrams
Let F = {f1 , . . . , fn } be a set of d-variate continuous functions defined over Rd . The lower envelope of F is defined as F − = min fi . 1≤i≤n
From F and F − , we define a natural partition of Rd called the minimization diagram of F. For a point x ∈ Rd , we define the index set I(x) of x as the set of all indices i such that F − (x) = fi (x). An equivalence relation noted ≡ can then be defined between two points of Rd if they have the same index set: x ≡ y ⇔ I(x) = I(y). The equivalence classes Rd / ≡ are relatively open sets that cover Rd . Their closures are called the faces of the minimization diagram of F (see Fig. 4.1). The index set of a face is defined as the largest subset of 37
38
CHAPTER 4. VORONOI DIAGRAMS AND DELAUNAY TRIANGULATIONS 1
2
1
3
2
4
1
3
4
Figure 4.1: The upper envelope of a set of univariate functions. The maximization diagram is drawn on the horizontal line with the corresponding indices. The face of index {1} consists of two components. indices common to all the points of the face. Conversely, the face of index set I is the set of all points x such that I ⊂ I(x). Upper envelopes and maximization diagrams can be defined analogously.
4.2
Voronoi diagrams
Let P = {p1 , . . . , pn } be a set of points of Rd . To each pi , we associate its Voronoi region V (pi ) V (pi ) = {x ∈ Rd : kx − pi k ≤ kx − pj k, ∀j ≤ n}. Region V (pi ) is the intersection of the n − 1 half-spaces bounded by the bisector hyperplanes of pi and each of the other points of P . V (pi ) is therefore a convex polyhedron, possibly unbounded. Observe that V (pi ) contains pi and therefore is not empty. The collection of the Voronoi regions and their faces, together with their incidence relations, constitute a cell complex called the Voronoi diagram of P . Since any point of Rd belongs to at least one Voronoi region, the Voronoi diagram of P is a subdivision of Rd . We now establish a useful correspondence between Euclidean Voronoi diagrams of Rd and a class of polyhedra of Rd+1 . The Euclidean Voronoi diagram of P can alternatively be defined as the minimization diagram of the distance functions δi , . . . , δn , where δi (x) = kx − pi k.
39
4.2. VORONOI DIAGRAMS
Figure 4.2: The Voronoi diagram of a set of 9 points.
In other words, the Euclidean Voronoi diagram of P is the minimization diagram of a set of functions whose graphs are vertical1 cones of revolution of Rd+1 . Since minimizing kx − pi k over i is the same as minimizing (x − pi )2 , the Euclidean Voronoi diagram of P can alternatively be defined as the minimization diagram of the smooth functions (x − pi )2 whose graphs are translated copies of the vertical paraboloid of revolution of Rd+1 of equation xd+1 = x2 . Observing further that, for any x, arg mini (x − pi )2 = arg maxi (2pi · x − p2i ), we obtain that the Euclidean Voronoi diagram of P is the maximization diagram of a set of affine functions, namely the functions di (x) = 2pi · x − p2i whose graphs are hyperplanes of Rd+1 . Let us call hpi , i = 1, . . . , n, those hyperplanes and let h+ pi denote the half-space lying above hpi . The maximization diagram of the di is obtained by projecting the polyhedron + V(P ) = h+ p1 ∩ · · · ∩ hpn .
vertically onto Rd . See Fig. 4.3. In other words, the faces of the Voronoi diagram Vor(P ) of P are the vertical projections of the faces of the convex polyhedron V(P ). 1
By vertical, we mean that the axis of revolution is perpendicular to Rd .
40
CHAPTER 4. VORONOI DIAGRAMS AND DELAUNAY TRIANGULATIONS
Figure 4.3: The polyhedron V(P ), with one of its faces projected onto Rd .
It follows from the above correspondence that the combinatorial complexity of the Voronoi diagram of n points of Rd is at most thecombinatorial complexity of a polyhedron defined as the intersection of n half d d+1 e d spaces of R , which is O n 2 as shown in section 3.3. This bound is tight. In particular, the Voronoi diagram of n points of R3 may be quadratic (see exercise 4.7).
4.3
Delaunay triangulation
A triangulation of a finite set of points P of Rd is a simplicial complex embedded in Rd that covers the convex hull of P . A given set of points admits, in general, many triangulations. The Delaunay triangulation of P , which is defined from the Voronoi diagram of P , is a canonical triangulation that has interesting properties and finds numerous applications. Let P be a finite set of points in Rd and Vor(P ) its Voronoi diagram. The nerve of the collection of all Voronoi faces of Vor(P ) is an abstract simplicial complex called the Delaunay complex of P . Specifically, let f be a face of dimension k of Vor(P ) and intf be the set of points of f that do not belong to any proper subface of f . All the points of intf have the same subset Pf of closest points in P , and f is the intersection of the cells of the points in Pf . Accordingly, there is a simplex f ∗ in the Delaunay complex. The Delaunay complex cannot always be embedded in Rd . Consider, for example, the case of a set P consisting of m > d + 1 points lying on a same hypersphere. The center of the hypersphere belongs to the Voronoi cells of all the m points, which implies that the Delaunay complex contains the (m − 1)-simplex whose vertex set is P . This simplex cannot be embedded in Rd since m − 1 > d. However, if the set of points P is in general position, which means that no subset of d + 2 points of P lie on a
4.3. DELAUNAY TRIANGULATION
41
Figure 4.4: The empty ball property.
same hypersphere, the situation is simpler and the canonical embedding that maps a vertex of the Delaunay complex to its corresponding point of P and a simplex to the convex hull of its vertices embeds the Delaunay complex in Rd . Moreover, the union of its simplices covers the convex hull of P . In other words, under the general position assumption, the Delaunay complex of P is a triangulation of P . To prove this fundamental result due to Delaunay, we will introduce a mapping between hyperspheres of Rd and points in Rd+1 and use the polarity introduced in section 3.2. Before we give the proof, we mention an equivalent definition of the Delaunay complex in terms of empty balls. A ball b ∈ Rd is said to be empty of points of P if the interior of b includes no points of P . We say that a d-ball circumscribes a finite subset of points if the sphere bounding b passes through all the points of the subset. JD : i let the lemma but this is really another view of the def Lemma 4.1 (The empty ball property) Any subset σ ⊂ P is a simplex of the Delaunay complex of P iff it has a circumscribing ball empty of points of P . Such a ball is called a Delaunay ball. We associate to the hypersphere σ of Rd of equation σ(x) = x2 − 2c · x + s = 0 the point φ(σ) = (c, s) of Rd+1 .Similarly to what we did in section 3.2, we associate to this point φ(σ) the so-called polar hyperplane hσ of Rd+1 of equation xd+1 = 2c · x − s. Observe that if σ is reduced to a point c, hσ is identical to the hyperplane hc that has been introduced in section 4.2. It should also be observed that the intersection of hσ with the paraboloid Q projects vertically onto σ (see figure 4.6). We deduce the remarkable following property : x ∈ σ if and only if φ(x) = (x, x2 ) ∈ hσ and σ encloses x if and only if φ(x) is below hσ . Consider now a set P = {p1 , . . . , pn } of n points in general position. Let V(P ) denote, as in section 4.2, the polyhedron defined as the intersection of the n halfspaces above the n polar hyperplanes hpi , and let V 0 (P )
42
CHAPTER 4. VORONOI DIAGRAMS AND DELAUNAY TRIANGULATIONS
Figure 4.5: The Delaunay triangulation of a point set (in bold) and its dual Voronoi diagram (thin lines).
P
h(σ)
σ
Figure 4.6: The polar hyperplane of a hypersphere.
4.4. COMBINATORIAL AND ALGORITHMIC PROPERTIES
43
denote the boundary complex of V(P ). We write D(P ) and D0 (P ) respectively for the convex hull and the lower convex hull of the points φ(pi ), i = 1, . . . , n. D0 (P ) projects vertically onto a cell complex of Rd whose vertices are the points of P . Because the projection is 1-1, this projected cell complex is properly embedded in Rd and, since the projection preserves convexity, it covers the convex hull of P . Under the general position assumption, D0 (P ) is simplicial and the projected complex is a triangulation of P . The duality between the faces of V 0 (P ) and the faces of D0 (P ) implies that the projection of D0 (P ) is the Delaunay triangulation Del(P ) of P introduced at the beginning of this section. This concludes the proof that, under the general position assumption, the Delaunay triangulation Del(P ) is a triangulation of P . It also establishes a dual correspondence between Vor(P ) and Del(P ). We sum up our construction in the following diagram: V 0 (P ) = bdV(P ) ↑ lifting map ↓ Voronoi Diagram Vor(P )
duality
←→
D0 (P ) = lowerhull(φ(P )) ↑ lifting map ↓ Delaunay Triangulation Del(P )
If the points of P are not in general position, some simplices may be of dimension greater than the dimension d of the embedding space and the Delaunay complex cannot be embedded in Rd . We define the shadow of a simplex σ of the Delaunay complex as the convex hull of of its vertices in the canonical embedding. If the points are in general position, it follows from the above result that the shadow of each simplex of the Delaunay complex is a simplex of Rd . If the points are not in general position, the shadow of some simplices of the Delaunay complex may not be simplices but more general polytopes. Nevertheless, it is easy to see that the above diagram still holds. The only difference is that the complexes D0 (P ) and Del(P ) are no longer simplicial. An embedded triangulation can then be obtained by triangulating the shadows that are not simplices (see exercise 4.11). Any such triangulation is called a Delaunay triangulation. Since there are several ways of triangulating the faces of a polytope, the Delaunay triangulation of P is no longer unique.
4.4
Combinatorial and algorithmic properties
It follows from the duality established in the previous section that the combinatorial complexity of the Delaunay triangulation of n points is the same as the combinatorial complexity of its dual Voronoi diagram. Moreover, the Delaunay triangulation of n points of Rd can be deduced from the dual Voronoi diagram or vice versa in time proportional to its size. We also deduce from what precedes that computing the Delaunay triangulation of n points of Rd reduces to constructing the convex hull of n points of Rd+1 . The following theorem is then a direct consequence of known results on convex hulls (see Theorems 3.1 and 3.2). Theorem 4.1 The combinatorial complexity of the Voronoi diagram of n points of Rd and of their Delaunay
44
CHAPTER 4. VORONOI DIAGRAMS AND DELAUNAY TRIANGULATIONS
d d triangulation is Θ nd 2 e . Both structures can be computed in optimal time Θ n log n + nd 2 e . The bounds in this theorem are tight. In particular, the Voronoi diagram of n points of R3 may be quadratic (see exercise 4.7). These bounds are worst-case bounds. Under some assumptions on the point distribution, better bounds can be obtained (see exercise 4.9).
4.5
Natural coordinates and function interpolation
JD : i removed the standard properties of DT and am ready to expand the exercise below which sounds more appropriate in the context of the CG book Exercise 4.1 (Natural coordinates) Let E be a finite set of points p1 , ..., pn of Rd . As usual, Vor(E) denotes the Voronoi diagram of E and V (pi ) the cell of pi in Vor(E). Given a point x ∈ conv(E), we write E + = E ∪ {x}, V + (x) for the Voronoi cell of x in Vor(E + ), V + (x, pi ) = V + (x) ∩ V + (pi ) and W (x, pi ) = + + + V Pnv¯i (x) = vi (x)/kx − pi k and v¯(x) = Pn(x) ∩ V (pi ) = V (pi ) \ V (pi ). Now we define vi (x) = vol(V (x, pi )), ¯i (x). In addition, we define wi (x) = vol(W (x, pi )) and w(x) = i=1 wi (x). i=1 v We call Laplace coordinates the n functions λ1 , . . . , λn defined by λi (x) = v¯i (x)/¯ v (x) for x 6∈ E, and λi (pj ) = δij otherwise, where δij is the Kronecker delta. We call Sibson’s coordinates the n functions ςi (x) = wi (x)/w(x), i = 1, . . . , n. Show that the set of λi is a partition of unity. Same question for the set of ςi . (Hint : for the Laplace coordinates, apply exercise 5.3 to V + (x). For the Sibson’s coordinates, apply exercise 5.3 to the polytope D(E + ) \ D(E) of Rd+1 , where D(E) is defined in section 4.3).
4.6
Exercises
Exercise 4.2 Show that the combinatorial complexity of the upper envelope of n univariate functions whose graphs intersect pairwise in at most two points is O(n). Show that the envelope can be computed in optimal time Θ(n log n). Exercise 4.3 Let Q be the paraboloid of Rd+1 of equation xd+1 = x2 . Show that the hyperplane hpi is tangent to Q at the point (pi , p2i ). Exercise 4.4 To a hypersphere σ of center c and radius r of equation σ(x) = (x − c)2 − r2 = x2 − 2c · x + s = 0,
4.6. EXERCISES
45
where s = σ(0) = c2 − r2 , we associate the point of Rd+1 φ(σ) = (c, s). Show that the image by φ of a point, considered as a hypersphere of radius 0, is a point of the paraboloid Q. Show that the image by φ of the hyperspheres that pass through a given p of Rd is the hyperplane hp of Rd+1 xd+1 = 2p · x − p2 . Exercise 4.5 What are the preimages by φ of the points of Rd+1 that lie 1. above Q ? 2. on the boundary of V(P ) ? in the interior of V(P ) ? 3. on a line ? − Exercise 4.6 Consider the diagram obtained by projecting the faces of h− p1 ∩· · ·∩hpn vertically. Characterize the points that belong to a face of this diagram.
Dualy, project vertically the faces of the upper convex hull of the φ(pi ). Show that we obtain a triangulation of the vertices of conv(P ) such that each ball circumscribing a simplex contains all the points of P . Exercise 4.7 Show that if we take points on two non coplanar lines of R3 , say n1 + 1 on one of the lines and n2 + 1 on the other, their Delaunay triangulation has n1 n2 tetrahedra (or, equivalently, that their Voronoi diagram has n1 n2 vertices). Exercise 4.8 Show, using Euler’s formula, that any triangulation of a set P of n points in the plane has 2n − 2 − ne triangles if ne is the number of points of P that are vertices of conv(P ). Show, using also Euler’s formula, that, for any triangulation T (P ) of a set P of points of R3 , we have t < e − n where e and t are respectively the number of edges and tetrahedra of T (P ). Prove that any set of n points of R3 with no 3 points on a same line admits a triangulation of size O(n). Exercise 4.9 Let D be a bounded domain of Rd and let P be an ε-net of D, i.e. a set of points of D such that any point of D is at distance less than ε from a point of P and such that no two points of P are at distance less than κ ε, where κ is some positive constant. Denote by p a point of D lying at distance at least ε from the boundary of D. Show that the circumradius of any Delaunay simplex incident to p is less than ε. Deduce that all the Delaunay simplices incident to p lie in the ball B(p, 2ε). Show next, using a packing argument, that the number of Delaunay edges incident to p is a constant that depends exponentially on d. Bound the total complexity of the star of p.
46
CHAPTER 4. VORONOI DIAGRAMS AND DELAUNAY TRIANGULATIONS
Exercise 4.10 Let S be a hypersphere of Rd passing through d + 1 points p0 , . . . , pd . Show that a point pd+1 of Rd lies on S, in the interior of the ball BS bounded by S or outside BS , depending whether the determinant of the (d + 2) × (d + 2) matrix 1 ··· 1 in sphere(p0 , . . . , pd+1 ) = p0 · · · pd+1 p2 · · · p2 0 d+1 is 0, negative or positive. This predicate is the only numerical operation that is required to check if a triangulation is a Delaunay triangulation. Exercise 4.11 Describe an algorithm to triangulate a bounded polytope (Hint: proceed by faces of increasing dimensions). Exercise 4.12 Let P be a finite set of points of Rd . A spanning tree of P is a tree whose vertices are the points of P . A spanning tree is called a minimum spanning tree (MST) if the sum of the lengths of its edges is minimal among all spanning trees. Show that MST(P ) ⊂ Del(P ).
4.7
Bibliographical notes
To know more about the space of spheres, one may read the books by Pedoe [68] and Berger [6]. An entire book is devoted to Voronoi diagrams [67]. One may also look at the survey by Aurenhammer and Klein [5] and the part of the textbook by Boissonnat and Yvinec [14, 15] devoted to Voronoi diagrams. The result of exercise 4.9 holds (in expectation) for random sets of points, as shown by Dwyer [38]. Natural coordinates (exercise 4.1) have been introduced by Sibson [76, 75].
Chapter 5
Affine diagrams A construction similar to what we did for the Euclidean Voronoi diagrams of points and their dual Delaunay triangulations can be done for the so-called power or Laguerre diagrams. Here we take as our finite set of objects a set of hyperspheres (instead of points) and consider as distance function of a point x to a hypersphere σ the power of x to σ. Laguerre diagrams include Voronoi diagrams as special cases and, as we will see, most of the properties of Voronoi diagrams still hold for Laguerre diagrams. Voronoi and Laguerre diagrams are affine diagrams, i.e. maximization diagrams of affine functions. We will show that any affine Voronoi diagram of Rd is in fact identical to the Laguerre diagram of some set of hyperspheres of Rd , therefore showing that the class of affine Voronoi diagrams is identical to the class of Laguerre diagrams. Lastly, we will introduce some important examples of affine diagrams.
5.1 5.1.1
Laguerre geometry Laguerre diagrams
MY: Calling balls b and sets of balls B avoid conflicting with notation τ for simplices of FC We call power of a point x to a hypersphere σ of center c and radius r the real number σ(x) = (x − c)2 − r2 . Let S = {σ1 , . . . , σn } be a set of hyperspheres of Rd . We denote by ci the center of σi , ri its radius, σi (x) = (x − ci )2 − ri2 the power function to σi , and si = c2i − ri2 the power of the origin. To each σi , we associate the region L(σi ) consisting of the points of Rd whose power to σi is not larger than their power to 47
48
CHAPTER 5. AFFINE DIAGRAMS
Figure 5.1: A Laguerre diagram. the other hyperspheres of S: L(σi ) = {x ∈ Rd : σi (x) ≤ σj (x), 1 ≤ j ≤ n}. The set of points that have equal power to two hyperspheres σi and σj is a hyperplane, noted πij , called the radical hyperplane of σi and σj . Hyperplane πij is orthogonal to the line joining the centers of σi and σj . i the half-space bounded by π consisting of the points whose power to σ is smaller than We denote by πij ij i i , j 6= i. If this intersection is not their power to σj . The region L(σi ) is the intersection of all half-spaces πij empty, it is a convex polyhedron, possibly not bounded. We call Laguerre regions the non empty regions L(σi ). We define the Laguerre diagram of S, noted Lag(S), as the cell complex whose cells are the Laguerre regions and their faces. When all hyperspheres have the same radius, their Laguerre diagram is identical to the Voronoi diagram of their centers. MY: What about adding the following Laguerre regions and Laguerre diagrams are commonly called respectively power regions and power diagrams. Equivalently, the Laguerre diagram of S can be defined as the minimization diagram of the functions σi , . . . , σn . Observing that for any x arg min σi (x) = arg max(2ci · x − si ), i
i
49
5.1. LAGUERRE GEOMETRY we obtain that the Laguerre diagram of S is the maximization diagram of the set of affine functions di (x) = 2ci · x − si
whose graphs are the polar hyperplanes hσi ⊂ Rd+1 of σi (see section 4.3). Let h+ σi denote the half-space lying above hσi . The maximization diagram of the di is obtained by projecting vertically the faces of the convex polyhedron + L(S) = h+ σ1 ∩ · · · ∩ hσn . Hence, the faces of the Laguerre diagram Lag(S) are the vertical projections of the faces of the convex polyhedron L(S). Laguerre diagrams are very similar to Voronoi diagrams: the main difference is that some hyperplane may not contribute a face. In other words, some hypersphere σi may have an empty Laguerre region (see the small circle in the upper left corner of figure 5.1). MY : For the purpose of Alpha-shapes, I need to give for regular triangulations the equivalent of the empty sphere property. For this I must define orthogonal balls, closer and further than orthoganal balls. Because the whole is going to be a bit long, I propose to make a section for regular triangulations as there is one for Delaunay triangulations
5.1.2
Regular Triangulations
We proceed now as in section 4.3. To a hypersphere σ = (c, r) of Rd , we associate the point φ(σ) = (c, c2 −r2 ) of Rd+1 . Consider the convex polyhedron R(S) = conv(φ(S)). By the results of section 3.2, lowerhull(R(S)) is dual to bd(L(S)). The vertical projection of lowerhull(R(S)) is a cell complex which, in general, is a simplicial complex. We call such a complex the regular triangulation of S and denote it by reg(S). We have the following diagram : L0 (S) = bd (L(S)) l Laguerre diagram Lag(S)
←→ ←→
R0 (S) = lowerhull(φ(S)) l Regular triangulation reg(S)
MY: Simplices in regular triangulations have characteristic properties analog the empty ball properties of Delaunay simplices. To enounce them we have to extend the notion of power to pairs of balls and define the orthogonality of balls Let b1 (c1 , r1 ) and b2 (c2 , r2 ) be two balls with respective centers c1 and c2 and radii r1 and r2 . We call power product π(b1 , b2 ) of b1 and b2 the following π(b1 , b2 ) = (c1 − c2 )2 − r12 − r22 .
50
CHAPTER 5. AFFINE DIAGRAMS
Two balls are said to be orthogonal if their power product is null. They are said to be further (respectively closer) than orthogonal if their power pro We also say that a ball b is orthogonal (resp further or closer than orthogonal) to a finite set B of balls if b is orthogonal (resp further or closer than orthogonal) to any ball bi ∈ B. Lemma 5.1 Let B : {bi (ci , ri )} be a finite set of balls in Rd with set of centers C. Any simplex s whose vertices are the centers of a subset Bs of balls in B is a simplex in the Laguerre diagram Lag(B) iff there is a d-ball orthogonal to all Bs and further to orthogonal to B \ Bs . A triangulation T with vertices on the centers of a subset B 0 ⊂ B is a regular trianguation of B iff every d-simplex τ ∈ T admits a ball orthogonal to the subset Bτ ⊂ B 0 corresponding to the vertices of τ and further than orthogonal to B \ Bτ , MY:
5.1.3
From balls to weighted points
A ball is often described as a weighted point, i.e. as an element of Rd × R where the point in Rd is the center of the ball, and the scalar weight in R is the square of the radius. The definitions of power, power product, Laguerre diagram and regular triangulation thus verbatim translate from their description in terms balls to the description in terms of weighted points: the power distance from point x to the weigthed point pˆ = (p ∈ Rd , w ∈ R) is d(x, pˆ) = xp2 − w and the power product of two weighted points pˆ1 = (p1 , w1 ) and pˆ2 = (p2 , w2 ) is π(p1 , p2 ) = (p1 − p2 )2 − w1 − w2 . Two weigthed points are said to be orthogonal if their power product is null. They are said to be further (respectively closer) than orthogonal if their power product is positive (respectively negative). We also say that a weighted point pˆ is orthogonal (resp further or closer than orthogonal) to a finite set Pˆ of weighted points if pˆ is orthogonal (resp further or closer than orthogonal) to any ball pˆi ∈ Pˆ . As long as weighted points describe balls, their weights are positive because they are the square of the radii. Observe nevertheless than nothing in the definitions of power distance, power products, Laguerre diagrams and regular triangulation prevent the weights to be negative. Therefore, in the following, we admit negative weights (or equivalentely balls with imaginary radii) and consider the power distance, Laguerre diagram and regular triangulation to be defined for weighted points with weights in the whole R. In this setting, Lemma ?? is still valid and can be rephrased as follows
5.2. AFFINE DIAGRAMS
51
Lemma 5.2 Let Pˆ be a finite set of weigted points in Rd × R. A simplex τ whose vertices correspond to a subset Pˆτ of Pˆ , is a simplex of the regular triangulation reg(Pˆ ) iff there is a weighted point orthogonal to Pˆs and further than orthogonal to Pˆ \ Pˆs . A triangulation T whose vertices correspond to a subset Pˆ 0 ⊂ Pˆ is a regular triangulation of Pˆ iff for any d-simplex τ of T there is a weigthed point orthogonal to the subset Pˆτ of Pˆ corresponding to the vertices of τ and further than orthogonal to Pˆ \ Pˆτ .
5.1.4
Complexity of Laguerre diagram and regular triangulations
The following theorem states that computing the Laguerre diagram of n weighted points of Rd × R (or equivalently its dual regular triangulation) has the same asymptotic complexity as computing the Euclidean Voronoi diagram or the Delaunay triangulation of n points of Rd . The theorem is a direct consequence of section 5.1.2 and of results on convex hulls (see Theorems 3.1 and 3.2). d Theorem 5.1 The combinatorial complexity of the Laguerre diagram of n weigthed points of R × R d and of its dual regular triangulation are Θ nd 2 e . Both structures can be computed in optimal time d Θ n log n + nd 2 e .
5.2
Affine diagrams
We have seen that the Laguerre diagram of n spheres is the maximization diagram of n affine functions. The converse is also true. Lemma 5.1 The maximization diagram of n affine functions defined over Rd is the Laguerre diagram of n hyperspheres of Rd . Proof Let hi (x) = 2ci · x − si be n affine fonctions defined over Rd . Write hi for the graph of hi (x), i.e. + the hyperplane of Rd+1 defined by xd+1 = 2ci · x − si , and let P = h+ 1 ∩ · · · ∩ hn . We associate to hi the hypersphere σi of Rd (possibly imaginary) whose center is ci and whose squared radius is c2i − si . hi is the polar hyperplane of σi and, as shown in section 5.1, the faces of the Laguerre diagram of the σi are the vertical projections of the faces of P . Let us call for short affine diagram the minimization diagram of a finite set of affine functions. The above lemma and the converse statement just show that the class of Laguerre diagrams is identical to the class of affine diagrams. Trivial consequences of this correspondence are the following facts
52
CHAPTER 5. AFFINE DIAGRAMS
Fact 5.1 The image of an affine diagram by an affine transformation is an affine diagram. Fact 5.2 The intersection of an affine diagram of Rd by an affine subspace A ⊂ Rd is an affine diagram of A. (see exercise 5.4).
5.3 5.3.1
Examples of affine diagrams Quadratic distance
We equip Rd with a non Euclidean metric defined by kx − ykQ = (x − y) Q (x − y)t , where Q is a symmetric matrix, i.e. Q = Qt . Given n points p1 , . . . , pn of Rd , the Voronoi diagram of those points for the quadratic distance is the cell complex consisting of the n regions VQ (pi ) = {x ∈ Rd : (x − pi ) Q (x − pi )t ≤ (x − pj ) Q (x − pj )t , ∀1 ≤ j ≤ n}. When Q is taken to be the inverse of the covariance matrix, the quadratic distance is known as the Mahalanobis distance, extensively used in computer vision. Lemma 5.2 The Voronoi diagram of a set of n points P = {p1 , . . . , pn } for the distance k.kQ is the Laguerre diagram of n spheres σ1 , . . . , σn of Rd . The center ci of σi is the point pi Q and its squared radius is ri2 = ci · ci − pi Q pti . Proof kx − pi kQ < kx − pj kQ ⇐⇒ −2 pi Q xt + pi Q pti < −2 pj Q xt + pj Q ptj ⇐⇒ σi (x) < σj (x).
5.3.2
k-order Voronoi diagrams
Let P be a set of n points of Rd and let Pk be the set of all subsets of k points of P for some fixed k ∈ [1, n−1]. We define the Voronoi region of a subset K ∈ Pk as the set of points of Rd that are closer to all the sites in K than to any other site in P \ K: Vk (K) = {x ∈ Rd : ∀pi ∈ K, ∀pj ∈ P \ K, kx − pi k ≤ kx − pj k}.
53
5.3. EXAMPLES OF AFFINE DIAGRAMS
Figure 5.2: The 2-order Voronoi diagram of a set of points (in bold line) and the corresponding 1-order Voronoi diagram (in thin line).
Let us consider the subsets of Pk whose Voronoi regions are not empty. These regions are polytopes and form a cell complex whose domain is Rd called the k-order diagram of P (see figure ??). For k = 1, we obtain the usual Voronoi diagram. Theorem 5.2 The k-order diagram of P is the Laguerre diagram of a set of n hyperspheres of Rd . Proof Let K1 , . . . , Ks be the s =
n k
subsets of k points of P . For any point x ∈ Rd , we have
⇐⇒
1 X 1 X (x − p)2 ≤ (x − q)2 ∀j, 1 ≤ j ≤ s k k p∈Ki q∈Kj X X X 1 1 1 1 X 2 x2 − 2 p · x + p 2 ≤ x2 − 2 q · x + q k k k k
⇐⇒
σi (x) ≤ σj (x)
x ∈ Vk (Ki ) ⇐⇒
p∈Ki
p∈Ki
q∈Kj
q∈Kj
2 − 2c · x + s is the power of x with respect to the hypersphere σ centered at the center where σi (x) = xP i i i P of mass ci = k1 p∈Ki p of Ki and si = k1 p∈K k p2 . Hence, x ∈ Vk (Ki ) iff x lies in the Laguerre region of i σi .
54
5.3.3
CHAPTER 5. AFFINE DIAGRAMS
Bregman diagrams
Let X be a convex domain of Rd and F a strictly convex and differentiable function F (called the generator function of the divergence) defined over X . For any two points p = (p1 , . . . , pd ) and q = (q1 , . . . , qd ) of X , the Bregman divergence DF (·||·) : X 7→ R of p to q associated to F is defined as DF (p||q) = F (p) − F (q) − h∇F (q), p − qi, ∂F where ∇F = [ ∂x ... 1
∂F T ∂xd ]
(5.1)
denotes the gradient operator, and hp, qi the inner (or dot) product:
Pd
i=1 pi qi .
Informally speaking, Bregman divergence DF is the tail of the Taylor expansion of F . Geometrically, the ˆ = (p, F (p)) and the hyperplane Bregman divergence DF (p||q) is measured as the vertical distance between p ˆ : DF (p||q) = F (p) − Hq (p). Hq tangent to the graph F of F at point q We now give some basic properties of Bregman divergences. First, observe that, for most functions F , the associated Bregman divergence is not symmetric, i.e. DF (p||q) 6= DF (q||p) (the symbol || is put to emphasize this point). Hence, it is not a distance. Nevertheless, the strict convexity of generator function F implies that, for any p and q in X , DF (p||q) ≥ 0, with DF (p||q) = 0 if and only if p = q.
Examples of Bregman divergences Examples of Bregman divergences are the squared Euclidean distance (obtained for F (x) = kxk2 ) and the quadratic distance function F (x) = xT Qx where Q is a symmetric positive definite matrix (see section 5.3.1). The notion of Bregman divergence encapsulates various information measures based on entropic functions such as the Kullback-Leibler divergence based on the Shannon entropy which is widely used inP information theory, image processing and various fields.P Let p be a discrete probability distribution so that di=1 pi = 1. The Shannon entropy is defined as F (p) = i pi log2 pi . F is a convex function and the associated Bregman divergence between two probability distributions p and q is easily shown to be
DF (p||q) =
d X i=1
pi log2 pi −
d X i=1
qi log2 qi − hp − q, ∇F (q)i =
d X i=1
pi log2
pi qi
def
= KL(p||q).
KL(p||q) is called the Kullback-Leibler divergence or the relative entropy of the two probability distributions p and q.
5.3. EXAMPLES OF AFFINE DIAGRAMS
55
Bregman diagrams Let P = {p1 , ..., pn } be a finite point set of X ⊂ Rd . To each point pi , we associate to each site pi the distance function, Di (x) = DF (x||pi ). The minimization diagram of the Di , i = 1, . . . , n, is called the Bregman Voronoi diagram of P , which we denote by VorF (P ). The d-dimensional cells of this diagram are in 1-1 correspondence with the sites pi and the d-dimensional cell of pi is defined as def
VF (pi ) = {x ∈ X | DF (x||pi ) ≤ DF (x||pj ) ∀pj ∈ P }. It is easy to see that the minimization diagram of the n functions DF (x||pi ) i = 1, . . . , n, is the maximization of the n affine functions hi (x) = hx − pi , p0i i, i = 1, . . . , n. Hence, Bregman diagrams are affine diagrams. More precisely, we have Theorem 5.3 The Bregman Voronoi diagram of n sites is identical to the restriction to X of the Laguerre diagram of the n Euclidean spheres of equations hx − p0i , x − p0i i = hp0i , p0i i + 2(F (pi ) − hpi , p0i i), i = 1, . . . , n. where p0i = ∇F (pi ). Proof We have DF (x||pi ) ≤ DF (x||pj ) ⇐⇒ −F (pi ) − hx − pi , p0i i ≤ −F (pj ) − hx − pj , p0j i. Multiplying twice the last inequality, and adding hx, xi to both sides yields ⇐⇒
hx, xi − 2hx, p0i i − 2F (pi ) + 2hpi , p0i i ≤ hx, xi − 2hx, p0j i − 2F (pj ) + 2hpj , p0j i hx − p0i , x − p0i i − ri2 ≤ hx − p0j , x − p0j i − rj2 ,
where ri2 = hp0i , p0i i + 2(F (pi ) − hpi , p0i i) and rj2 = hp0j , p0j i + 2(F (pj ) − hpj , p0j i). The last inequality means that the power of x with respect to the Euclidean (possibly imaginary) ball B(p0i , ri ) is no more than the power of x with respect to the Euclidean (possibly imaginary) ball B(p0j , rj ). It is to be observed that not all Laguerre diagrams are Bregman Voronoi diagrams. Indeed, in Laguerre diagrams, some balls may have empty cells while each site has necessarily a non empty cell in a Bregman Voronoi diagram.
Bregman triangulations ˆ be the lifted image of E on the graph F of F , i.e. E ˆ = {(p, F (p)), p ∈ E} ∈ Rd+1 . Write T for the Let E ˆ i.e. the collection of facets of the convex hull of E ˆ whose supporting hyperplanes are below lower hull of E,
56
CHAPTER 5. AFFINE DIAGRAMS
ˆ We assume in this section that E is in general position, meaning that there is no point x ∈ X whose E. divergences to d + 2 points of E are equal. Equivalently (see Fig. ??), E is in general position if it contains ˆ lying on a same hyperplane. no subset of d + 2 points of E For the same reasons as for Delaunay triangulations (see section 4.3), the vertical projection of T onto X is a triangulation DelF (E) of E embedded in X ⊆ Rd . We call DelF (E) the Bregman triangulation of E, noted also Breg(E) when we don’t want to insist on a specific F . When F (x) = ||x||2 , DelF (E) is the Delaunay triangulation of E. We now show that the empty sphere property of Delaunay triangulations (Lemma 4.1) naturally extends to Bregman triangulations. We define the Bregman ball centered at c and of radius r as BF (c, r) = {x ∈ X | DF (x||c) ≤ r}. The boundary of a Bregman ball is called a Bregman sphere. It is easy to see that any Bregman sphere σ is obtained as the vertical projection of the intersection of F with a hyperplane noted hσ (see Fig. 4.6 for the case where F = kxk2 ). A Bregman sphere is said to be empty if it does not enclose any point of E. Let s = conv(p0 , . . . , pd ) be ˆ 0, . . . , p ˆ d is a hyperplane h of Rd+1 whose a d-simplex of Breg(E). The affine hull of the lifted points p intersection with F projects vertically on the (unique) Bregman sphere σ(s) that circumscribes s. Since, by ˆ σ(s) must be empty. ˆ d ) ∈ h is a facet of the lower hull of E, construction, conv(ˆ p0 , . . . , p Lastly, we show that Bregman triangulations and diagrams are dual structures. Let Breg(E) be the Bregman diagram of E, Lag(E 0 ) = Breg(E) the associated Laguerre diagram and let T (E 0 ) denote the regular triangulation that is dual to Lag(E 0 ). The image by ∇−1 F of T (E 0 ) is an embedded curved triangulation T 0 (E) of E. We claim that T 0 (E) and DelF (E) are isomorphic. Indeed, both triangulations are embedded in Rd and their d-simplices are in bijection with the vertices of the Bregman diagram of E.
5.4
Exercises
Exercise 5.1 Let σ = (c, r) be a hypersphere of Rd and, as in exercise 4.3.2, φ(σ) be the point (c, s = c2 −r2 ) of Rd+1 . We can define a distance between two spheres σ1 = (c1 , r1 ) and σ2 = (c2 , r2 ) as q d(σ1 , σ2 ) = (c1 − c2 )2 − r12 − r22 . Show that if d(σ1 , σ2 ) = 0, σ1 and σ2 are orthogonal. In addition, show that the image by φ of the spheres that are orthogonal to a given sphere σ is the hyperplane hσ . Exercise 5.2 Show that the only numerical operation that is required to check if a triangulation is the regular triangulation of a set of hyperspheres σi is the evaluation of the sign of the determinant of the
57
5.5. BIBLIOGRAPHICAL NOTES (d + 2) × (d + 2) matrix 1 ··· c0 ··· power test(σ0 , . . . , σd+1 ) = c2 − r2 · · · 0 0
1 cd+1 2 c2d+1 − rd+1
where ci and ri are respectively the center and the radius of σi . Exercise 5.3 Prove the following conservation law for flows entering L(σi ) normally to P a Laguerre region cj −ci the facets of the region: if fij , j ∈ J, are the facets of L(σi ), we have j∈J vol(fij ) kcj −ci k = 0. This property makes Voronoi and Laguerre diagrams useful when applying finite volume methods P in fluid dynamics. (Hint : show that if P is a convex polyhedron and fj , j ∈ J, are its facets, we have j∈J vol(fj ) ~nj = 0, where ~nj is the unit normal vector to fj oriented towards the outside of P ). Exercise 5.4 Let H be a k-dimensional affine space of Rd . Show that the intersection LH of H with the Laguerre diagram of n hyperspheres of Rd is the Laguerre diagram of n hyperspheres (i.e., (k−1)-dimensional spheres) of H. Show how to modify the predicates of an algorithm that computes a Laguerre diagram in Rk so that the algorithm will compute LH . Exercise 5.5 Show that the combinatorial complexity of the union of n balls of Rd is the same as the combinatorial complexity of their Laguerre diagram. Design a worst-case optimal algorithm to compute such a union of balls. Exercise 5.6 (**) Show that the combinatorial complexity of all ≤ k-order Voronoi diagrams is Θ(k d Propose an efficient algorithm to compute all these diagrams.
5.5
d+1 2
e nb d+1 2 c ).
Bibliographical notes
To know more about Laguerre diagrams, also called power diagrams, one may look at the survey paper by Aurenhammer [4]. A recent survey on affine and curved Voronoi diagrams can be found in [13]. The solution to exercise 5.6.1 is due to Clarkson and Shor [32] (see also [14, 15]). Bregman Voronoi diagrams have been studied by Boissonnat, Nielsen and Nock [10].
58
CHAPTER 5. AFFINE DIAGRAMS
Chapter 6
Alpha shapes Alpha shapes and weighted alpha shapes are families of shapes defined respectively from set of points and sets of weighted points. They are closely related to subcomplexes of respectively the Delaunay and weighted Delaunay triangulations. Those shapes families are parameterized by a scalar usually called α, hence their name. Alpha shapes is one of the first tool that was introduced in the area of shape reconstruction where one seeks to reconstruct the shape of a three dimensional objects from a sets of points measured on the boundary surface of the object. Owing to their capacity of representing union of balls, cavities and pockets formed by union of balls, alpha shapes play a central role in the description of protein or macro molecules, docking studies and drug design.
6.1 6.1.1
Definitions Alpha complexes and alpha shapes
Let P be a set of points in Rd . From lemma 4.1 we know that simplices in the Delaunay triangulation Del(P ) have a circumscribing ball empty of points in P . For any α ∈ R, we consider the set A(P, α) of simplices in Del(P ) having a circumscribing ball empty of points in P with square radius at most α. Because any circumscribing ball of a simplex is also a circumscribing ball of the simplex subfaces, the simplices in A(P, α) form a subcomplex of Del(P ) that is called the α-complex. The alpha shape of the set P for the parameter value α is simply defined as the union of simplices in the alpha complex A(P, α). The alpha complex evolves when alpha increases, from the empty set for α < 0, to the set of vertices of Del(P ) when α = 0, and finally to the whole Delaunay triangulation Del(P ) when α is 59
60
CHAPTER 6. ALPHA SHAPES
big enough. Note that the maximal dimension of the complex A(P, α) is the dimension d of the embedding space. However the alpha complex may have a lower k < d dimension. It may also not be a pure complex, having some simplices which are not faces of simplices with the maximal dimensions. Some applications, requiring a pure complex consider the regularized version of the alpha complex defined as the subcomplex Ar (α) of Del(P ) formed by the simplices of A(P, α) with maximal dimension and their subfaces.
6.1.2
Weigthed alpha complexes and weighted alpha shapes
The definition of alpha complexes and alpha shapes extend in the weighted case. Let Pˆ be a set of weighted points. From lemma 5.2, for each simplex τ in the weighted Delaunay triangulation reg(Pˆ ) there is a weighted point orthogonal to all the weighted points corresponding to the vertices of τ and suborthogonal to the all other weighted points in Pˆ . Such a weighted point is called an empty orthogonal weigthed point of τ with respect to Pˆ . For any value of α ∈ R, we consider the subset W(Pˆ , α) of simplices admitting, with respect to Pˆ , empty orthogonal weighted points with weight at most α. The simplices in W(Pˆ , α) form a subcomplex of reg(Pˆ ) which is the α-complex. The weigthed alpha shape of the set Pˆ for the parameter value α is simply defined as the union of simplices in the alpha complex A(Pˆ , α). Since alpha shapes are a special case of weighted alpha shapes with all weights equal to zero, we only consider weighted alpha shapes in the following.
6.1.3
The alpha filtration
Let K be a finite simplicial complex. A filtration of K is a sequence of nested subcomplexes of K ∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K, such that any subcomplex in the sequence is obtained fron the previous one by the addition of a single simplex: K i+1 = K i ∪ σ i+1 , where σ i+1 is a simplex of K. Alternatively, a filtration of K can be defined as an ordering of the simplices of K such that any prefix subset Ki , formed by the first i simplices in the ordering, is a subcomplex in K. Any ordering of the simplices of K such the rank of a simplex is at least as big as the rank of any of its subfaces defines a filtration. Let Pˆ be a set of weighted points, and reg(Pˆ ) a regular triangulation of Pˆ . If we order the simplices of reg(Pˆ ) according to the value α at which they enter the alpha shape W(Pˆ , α), breaking ties according to increasing dimension, we got a filtration of reg(Pˆ ), called an alpha filtration. The subcomplexes sequence of an alpha filtration of Pˆ includes all the possible alpha complex W(Pˆ , α).
61
6.1. DEFINITIONS
Figure 6.1: Allpha shapes in 2D. Courtesy of
62
CHAPTER 6. ALPHA SHAPES
Figure 6.2: Alpha shapes in 3D. Courtesy of
6.2. COMPUTING ALPHA SHAPES AND ALPHA FILTRATIONS
6.2 6.2.1
63
Computing alpha shapes and alpha filtrations Face classification
Let Pˆ be a set of weighted points in Rd . Each simplex τ of the weighted Delaunay triangulation reg(Pˆ ) can be classified with respect to the alpha complex W(Pˆ , α) as follows: • A d-simplex of reg(Pˆ ) is either external if it does not belong to W(Pˆ , α) or interior if it does. • A k-simplex τ with dimension k < d is classified as external if it does not belong to W(Pˆ , α), as singular if it belongs to W(Pˆ , α) but none of its coface in reg(Pˆ ) does, boundary if it belongs to the boundary of the alpha complex and is not singular, and at last internal if it belongs to the alpha complex and not to its boundary. Therefore, for any face τ of reg(Pˆ ), there is at most three critical values αmin (τ ) ≤ αmed (τ ) ≤ αmax (τ ) at which the status of τ with respect to the alpha shapes changes from external to singular and then to boundary and interior. In the following, we note Pˆτ , the subset of Pˆ corresponding to the vertices of τ and we say that a weighted point is orthogonal to a set of weighted points when it is orthogonal to any weighted point in the set. For a d-simplex τ , there is a unique weighted point cˆ(Pˆτ ) = (c(Pˆτ ), w(Pˆτ ))) orthogonal to Pˆτ . The alpha spectrum of τ has a single critical value at where the simplex changes from external to interior : αmin (τ ) = αmed (τ ) = αmax (τ ) = w(Pˆτ ) When α tends to +∞, W(Pˆ , α) is just reg(Pˆ ) and any simplex becomes interior except for simplices on the convex hull which remain boundary. Therefore we set αmax (τ ) = +∞ for a simplex τ on the convex hull.
6.2.2
Gabriel simplices
Let τ be k-simplex of reg(Pˆ ) with dimension k < d. As before Pˆτ the subset of Pˆ corresponding to the vertices of τ , and we note cˆ(Pˆτ ) = (c(Pˆτ ), w(Pˆτ )) the weighted point with smallest weight orthogonal to Pˆτ . The simplex τ is said to be a Gabriel face of reg(Pˆ ) if the weigthed point cˆ(c(Pˆτ )) is further than orthogonal to Pˆ \ Pˆτ . In other words, τ is a Gabriel face of reg(Pˆ ) if the center c(Pˆτ ) of cˆ(Pˆτ ) belongs to the interior of the region Lag(Pˆτ ), dual of τ in the Laguerre diagram Lag(Pˆ ). Let us consider the fonction w(p) giving for each point p in Lag(Pˆτ ) the weight of the weighted point (p, w(p)) centered in p and orthogonal to Pˆτ . This function w is convex and Lag(Pˆτ ) is a polytope.
64
CHAPTER 6. ALPHA SHAPES • If τ is not a Gabriel face, the minimun of w on Lag(Pˆτ ) is reached on the boundary of Lag(Pˆτ ), meaning that τ enters the alpha complex at the same time as one of its coface σ and can’t be a singular face in W(Pˆ , α). In this case, we set αmin (τ ) = αmed (τ ) =
min
σ∈Lag(Pˆ ),σ⊃τ
αmin (σ).
• If τ is a Gabriel face, the minimum of w is reached at point c(Pˆτ ) and τ is a singular simplex of W(Pˆ , α) for any value α ∈ [αmin (τ )αmed (τ )] where: αmin (τ ) = αmed (τ ) =
6.2.3
min
p∈Lag(Pˆτ )
min
w(p) = w(Pˆτ )
p∈bd(Lag(Pˆτ ))
w(p) =
min
σ∈Lag(Pˆ ),σ⊃τ
αmin (σ)
Algorithm
From the above paragraph, we deduce the following algorithm to compute the alpha spectrum of any simplex τ in Lag(Pˆ ), from which the alpha complex W(Pˆ , α) and the alpha shape can easily been obtained for any value of α. For any τ ∈ reg(Pˆ ) with dimension k < d, we note U (τ ) the set of cofaces of τ in reg(Pˆ ) with dimension k + 1. • Initialisation For each d-simplex τ ∈ reg(Pˆ ) αmin (τ ) = αmed (τ ) = αmax (τ ) = w(Pˆτ )
• For each k = {d-1, . . . , 0 } for each k-simplex τ ∈ reg(Pˆ ) if τ ∈ convex hull of P , αmax (τ ) = +∞ else αmax (τ ) = maxσ∈U (τ ) αmin (σ) αmed (τ ) = minσ∈U (τ ) αmin (σ) if τ is Gabriel, αmin (τ ) = w(Pˆτ ) else αmin (τ ) = αmed (τ )
6.3. UNION OF BALLS
65
Figure 6.3: Homotopy between union of balls and alpha shapes. Courtesy of ?
6.3
Union of balls
6.4
Exercises
Exercise 6.1 (Union of balls and alpha shapes) Let B be a set of balls in Rd , we note also B the set of associated S weighted S points. Show that b∈B b = b∈B b ∩ Lag(b), where Lag(b) is the region of bSin the Laguerre diagram Lag(B). S Show that the alpha shape W(B, α = 0) is the nerve of the S cover of b∈B b by b∈B b ∩ Lag(b). Deduce by the nerve theorem that the union of balls b∈B b and the alpha shapes |W(B, α = 0)| are homotopy equivalent. See Figure 6.3.
6.5
Bibliographical notes
Alpha shapes were introduced by Edelsbrunner and M¨ ucke [46, 39] and widely used in the early algorithms of shapes reconstruction from sets of data points measured on the surface of an [47] . Alpha shapes are also famous for their ability to represent union of balls through the nerve theorems. They are widely used in study of macro molecular structure and docking, see e.g [44, 61, 43] Exercise 6.1 is directly insprired from [40].
66
CHAPTER 6. ALPHA SHAPES
Part II
Triangulation of smooth submanifolds
67
Chapter 7
Restricted Delaunay triangulation and surface mesh generation In this chapter, we present an algorithm to approximate a smooth surface S of R3 . The algorithm relies on the concept of restricted Delaunay triangulation. Given a finite set of points P on S, called a sample, the Delaunay triangulation of P restricted to S, noted DelS (P ), is a subcomplex of the Delaunay triangulation of P . The main structural result of this chapter (Theorem 7.1) states that, if the sample P is dense enough, DelS (P ) is a good approximation of S both in a geometric and in a topological sense. It is then shown that an algorithm can then construct the sample in a greedy way and maintain at each step the restricted Delaunay triangulation until an error bound is satisfied. The definition of restricted Delaunay triangulations is not limited to surfaces and can be extended to any subset of Rd and, in particular, to submanifolds of any dimension k ≤ d. However, several difficulties, both of a mathematical and of an algorithm nature, led us to discuss first the approximation of surfaces and to postpone the discussion on higher dimensional manifolds to Chapter 8. In preparation for the treatment of higher dimensional manifolds in Chapter 8, we state the results in full generality when the results and the proofs hold about the same for manifolds of any dimension. To avoid ambiguity, we use the notation M for a smooth submanifold of arbitrary dimension k of Rd , and use the notation S for a surface, i.e. a manifold of dimension 2. We define the angle between two vectors u and v as ∠(u, v) = arccos
u v · kuk kvk
where · stands for the dot product. Hence, ∠(u, v) ∈ [0, π]. The angle between two vector spaces U and V , dim U ≤ dim V , is then defined as ∠(U, V ) = minu∈U maxv∈V ∠(u, v). The angle between affine subspaces 69
70CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION and is defined as the angle between the corresponding parallel vector subspaces. jd : put elsewhere?
7.1
Restricted Delaunay triangulation
Definition 7.1 Let M be a k-dimensional submanifold of Rd and P a finite set of points of Rd . The restriction of the Delaunay complex to M is the nerve of the collection of the non empty f = F ∩ M where F is a face of Vor(P ). In other words, the restricted Delaunay complex is the subcomplex of the (abstract) Delaunay complex of P that consists of the simplices of the Delaunay complex of P whose dual Voronoi faces intersect M. Equivalently, a face f of the Delaunay complex is also a face of the restricted Delaunay complex iff there exists a point of M that is at equal distance from the vertices of f and not further from those vertices than to any other point of P . The restricted Delaunay complex embeds naturally in Rd under a genericity assumption on P . We say that P is a generic sample of M if no point of M is equidistant from k + 2 points of P . It is always possible to slightly perturb P so that it is generic and this will be assumed throughout. Under this genericity condition, the abstract restricted Delaunay complex can be realized as a geometric complex by mapping each of its vertices to the corresponding point of P , and by defining a simplex as the convex hull of its vertices. We call this geometric realization of the restricted Delaunay complex the restricted Delaunay triangulation of P to M , noted DelM (P). jd : we depart from the standard notion of triangulation in topology where a triangulation ofM is an abstract simplicial complex K and a homeomorphism between K and M. Under the genericity assumption on P , no face of Vor(P ) of dimension less than d − k intersect M. Therefore DelM (P) does not contain (k + 1)-simplices and is a k-complex. We will call facets the faces of DelM (P) of dimension k. An example is shown in Figure 7.1. In this example, M is a planar closed curve and DelM (P) is a simple closed polygon that correctly approximates M. This is not coincidence, and it can be proved that DelM (P) is indeed a good approximation of M when P is a sufficiently dense sample of the curve (Exercise 7.3). In Section 7.4, we will consider the case where M is a surface of R3 and provide sampling conditions under which DelM (P) is a good approximation of M . By definition, any facet f of DelM (P ) has a dual Voronoi edge that intersects M. Each point of this intersection is the center of a ball that circumscribes f and does not contain any point of P in its interior. We call such a ball a M-centered Delaunay ball. Notice that a facet may have several (possibly an infinite
7.2. REACH AND SAMPLING CONDITIONS
71
Figure 7.1: The Voronoi diagram and the Delaunay triangulation of a point set restricted to a planar closed curve. The edges of the Voronoi diagram that intersect the curve and the edges of the restricted Delaunay triangulation of the sample points are in bold lines. number of) M-centered Delaunay balls.
7.2 7.2.1
Reach and sampling conditions Projection map, medial axis and reach
We define the medial axis of M, noted axis(M), as the closure of the set of points x ∈ Rd that have more than one closest point on M (see Figure 7.2). Equivalently, the medial axis can be defined as the locus of the centers of the open balls that are tangent to M in at least two points and that do not intersect M. Such a ball will be called a medial ball. We define the projection onto M as the mapping Π : Rd \ axis(M) → M that maps a point x to its unique closest point on M. Let x be a point of M and write Π−1 (x) for the set of points of Rd \ axis(M) whose (unique) closest point
72CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION
Figure 7.2: The medial axis of a closed curve. We only show the component of the medial axis that is contained in the domain bounded by the curve. Various offsets of the curve are also shown in thin line.
on M is x. We call reach of x and write rch(x), the supremum of the set of all numbers r for which {y, ky − xk < r} ⊂ Π−1 (x). The reach of M is the minimum over all points x of M of rch(x). Note that rch(M) is also the minimum distance between a point of M and the medial axis of M. The reach of a manifold is a global quantity that is related to the curvature of M. First, if the curvature is defined everywhere on M and does not vanish, rch(M) is positive. Moreover, since any medial ball tangent to M at a point x cannot contain any point of M, its radius is not greater than the radius of the osculating sphere at x. In this chapter as well as in the following chapter, we will restrict our attention to the class of manifolds of (strictly) positive reach. This class of manifolds include all manifolds of class C 2 and even some manifolds whose curvature may be discontinuous along subsets of dimension 0. Such an example is the r-offset of a cube, i.e. the set of points at distance at most r from the cube.
7.2.2
Sampling conditions
Definition 7.2 (ε-sample) We say that a finite point set P is an ε-sample of a manifold M of positive reach if P ⊂ M and if any point x of M is at distance at most ε rch(M) from a point of P (the distance is the Euclidean distance in Rd ). We call ε rch(M ) the sampling radius. This definition does not allow the sampling radius to vary over the manifold. Hence, we are confined with uniform samples, which may be quite restrictive in practice. A simple way to allow non-uniform samples is to replace rch(M) by rch(x) in the definition above. The results of this chapter can be extended to such non-uniform ε-samples but, in order to both simplify the exposition and better outline the key ideas, we
7.2. REACH AND SAMPLING CONDITIONS
73
will restrict our attention to uniform ε-samples. We let the extension to non-uniform ε-samples as Exercise 7.1 (see also the bibliographic notes). Definition 7.3 ((ε, η)-sample) An ε-sample of a manifold M is said to be η-sparse if, for any two points p, q ∈ P , we have kp − qk ≥ η rch(M). A η-sparse ε-sample is simply called an (ε, η)-sample. Although this definition looks very natural, it involves a condition for all the points of M and is thus not very handy in practice. In particular, it is not easy in general to check if a given P ⊂ M is an ε-sample for a given ε. The following concept relaxes this condition to a finite set of points. Definition 7.4 (Loose ε-sample) Let S be a surface of positive reach and P a finite set of points P ⊂ S. We denote by V the intersection of the edges of Vor(P ) with S (In general, V consists of a finite set of points). We say that P is a loose ε-sample of S if 1. P ⊂ S and DelS (P ) has at least one vertex on each connected component of S, 2. for any x ∈ V , there exists a point in P at distance at most ε rch(S) (equivalently, the radius of any S-centered Delaunay ball of any facet of DelS (P ) is at most ε rch(S)). Clearly, an ε-sample is a loose ε-sample. Interestingly, the converse is almost true as stated in Exercise 7.6.
7.2.3
Basic lemmas
The following lemma may give an indication of the importance of the concept of reach in the context of manifold approximation. jd not used in this chapter → exo? Lemma 7.1 Let B be a ball that intersects M. If B ∩ M is not a topological ball, then B contains a point of the medial axis of M. Proof Write r for the radius of B and x for its center. The result is trivial when x belongs to the medial axis of M. Therefore assume that x 6∈ axis(M). We denote by Bx the largest ball centered at x whose interior does not intersect M (if x ∈ M, Bx is reduced to point x). Let rx be its radius. Bx is tangent to M in a unique point y since x does not belong to axis(M) (see Figure 7.3). Hence Bx ∩ M = {y} is a topological ball. Since B ∩ M is not a topological ball, there exists
74CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION S
z
y
x
Bx Bc B
Figure 7.3: For the proof of Lemma 7.1.
a point z of M at distance rc > rx from x such that the ball Bc = B(x, rc ) is tangent to M at z. Consider the set B of balls that are tangent to M at z and are centered on the line segment [zx]. Note that Bc is the ball of B centered at x. Since Bc contains y and therefore intersects M, there must exist a maximal ball Bz ∈ B that does not intersect M. Bz is a medial ball and we have Bz ⊂ Bc ⊂ B. Since the center of Bz belongs to axis(M), the lemma is proved. If x ∈ M, B(x, r) cannot intersect the medial axis of M for any r < rch(M). Lemma 7.1 thus implies Lemma 7.2 For any x of M, and any r < rch(M), the intersection of M with the ball B(x, r) centered at x of radius r is a topological ball. Lemma 7.3 Let x and y be two points of M. We have 1. sin ∠(xy, Tx ) ≤
kx−yk 2 rch(M) ;
2. the distance from y to Tx is at most
kx−yk2 2 rch(M) .
Proof 1. Let y 0 be the orthogonal projection of y onto Tx and let H be the plane (xyy 0 ). Let in addition B be the disk of H of radius rch(M) that is tangent to M at x and whose center is on the same side of Tx ∩ H as y (Refer to Figure 7.4). By definition of the reach, y does not belong to the interior of B. Let y 00 be the intersection other than x between the line segment [xy] and the boundary of B. We have kx − yk ≥ kx − y 00 k = 2 rch(M) sin ∠(xy, Tx ) which proves the first statement.
75
7.2. REACH AND SAMPLING CONDITIONS
2θ
B S θ
y 00
x
Tx
y
y0
Figure 7.4: For the proof of Lemma 7.3.
2. We have ky − y 0 k = kx − yk sin ∠(xy, Tx ) ≤
kx−yk2 2 rch(M) .
We show that the projection Π : Rd \ axis(S) → S that maps a point to its closest point on S is Lipschitz and therefore continuous. Lemma 7.4 (Continuity of Π) Let x and y be two points of Rd \axis(M). Write x0 = Π(x) and y 0 = Π(y) for their (unique) projections on M. If kx − x0 k ≤ α rch(M) and ky − y 0 k ≤ α rch(M) with α < 1, then 1 kx0 − y 0 k ≤ 1−α kx − yk. Proof By Lemma 7.3, we have (x − x0 ) · (x0 − y 0 ) ≥ −
α 0 α kx − y 0 k2 and (y − y 0 ) · (y 0 − x0 ) ≥ − k x0 − y 0 k2 . 2 2
Therefore, kx − yk × kx0 − y 0 k ≥ (x − y) · (x0 − y 0 ) =
(x0 − y 0 ) + (x − x0 ) + (y 0 − y) · (x0 − y 0 )
≥ (1 − α) k(x0 − y 0 )k2 from which the lemma follows.
Lemma 7.5 (Angle between tangent spaces) Let S be a surface of positive reach of R3 , and let x and 2α y be two points of S such that kx − yk ≤ 2α rch(S), α < 1. Then sin ∠(Tx , Ty ) ≤ 1−α .
76CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION Proof Let γ be the projection by Π of the line segment [xy] on S. For any point t on [xy], write t0 for its projection onto γ. Plainly, kt − t0 k ≤ min(kt − xk, kt − yk) ≤ α rch(S). Let s be the point of γ where the maximal absolute normal curvature of S is maximal and let κ(s) denote this maximal curvature. We know that κ(s) ≤ 1/rch(S) (see Section 7.2 and Exercise 7.2). Write nx for the unit normal vector at x and ny for the unit normal at y (the normals are supposed to be oriented consistently). Writing |γ| for the length of γ, we have (∗)
knx − ny k ≤ κ(s) |γ| ≤
1 kx − yk 2α ≤ rch(S) 1 − α 1−α
Inequality (*) is obtained by using Lemma 7.4 and the fact that kt − t0 k ≤ α rch(S) for any t ∈ [xy]. The ∠(nx ,ny ) ≥ sin ∠(nx , ny ). lemma follows since knx − ny k = 2 sin 2
7.3
Simplex quality
We will use the following notations. If σ is a simplex we denote by ∆(σ) its diameter (or the length of a longest edge), by L(σ) the length of a shortest edge. For any vertex p ∈ σ, the face oppposite p is the face determined by the other vertices of σ, and is denoted σp . The altitude of p in σ is D(p, σ) = d(p, aff(σp )), and the altitude D(σ) of σ is the minimum over all vertices p of σ of D(p, σ). A poorly-shaped simplex can be characterized by the existence of a relatively small altitude. The thickness of a j-simplex σ is the dimensionless quantity ( 1 if j = 0 Θ(σ) = D(σ) otherwise. j∆(σ) We say that σ is Θ0 -thick, if Θ(σ) ≥ Θ0 . If σ is Θ0 -thick, then so are all of its faces. Indeed if τ ≤ σ, then the smallest altitude in τ cannot be smaller than that of σ, and also ∆(τ ) ≤ ∆(σ). We recall some well known results on matrices and their the singular values. If A is a k × j matrix, k ≤ j, we denote its ith singular value by si (A). We have s1 (A) = kAk = supkxk=1 kAxk and sj (A) = inf kxk=1 kAxk. We will employ the following standard observation: Lemma 7.6 If η > 0 is an upper bound on the norms of the columns of A, then s1 (A) = kAk ≤
√
jη.
We will also be interested in obtaining a lower bound on the smallest singular value, for which the following observation is useful:
77
7.3. SIMPLEX QUALITY
Lemma 7.7 If A is a k × j matrix of rank j ≤ k, then the pseudo inverse A† = (AT A)−1 AT is the unique left inverse of A whose kernel is the orthogonal complement of the column space of A. Furthermore, si (A† ) = sj−i+1 (A)−1 . In particular, sj (A) = s1 (A† )−1 . Lemma 7.8 (Thickness and singular value) Let σ = [p0 , . . . , pj ] be a non-degenerate j-simplex in Rd , with j > 0, and let P be the d × j matrix whose ith column is pi − p0 . Then p sj (P) ≥ D(σ)/ j Proof Let wiT be the ith row of the pseudo inverse matrix P† = (PT P)−1 PT . Then wi belongs to the column space of P, and it is orthogonal to all (pi0 − p0 ) for i0 6= i. Let ui = wi /kwi k. It follows from the definition −1 T that uT i (pi − p0 ) = D(pi , σ). Thus wi = D(pi , σ) ui . Since si (A ) = si (A) for any matrix A, we have √ √ p 1 j j † = = s1 (P ) ≤ j max 1≤i≤j D(pi , σ) min1≤i≤j D(pi , σ) D(pi , σ) by Lemma 7.6. Thus Lemma 7.7 yields D(σ) sj (P) ≥ √ j The proof of Lemma 7.8 shows that the pseudoinverse of P has a natural geometric interpretation in terms of the altitudes of σ, and thus the altitudes provide a convenient lower bound on sj (P). By Lemma 7.6, √ s (P) s1 (P) ≤ j∆(σ), and thus Θ(σ) ≤ s1j (P) . In other words, Θ(σ)−1 provides a convenient upper bound on the condition number of P. The following lemma due to Whitney states that the affine hull of a thick simplex makes a small angle with any hyperplane which lies near all the vertices of the simplex. Lemma 7.9 (Whitney angle bound) Suppose σ is a j-simplex whose vertices all lie within a distance η from a hyperplane, H ⊂ Rd . Then 2j η sin ∠(aff(σ), H) ≤ D(σ) Proof Suppose σ = [p0 , . . . , pj ]. Choose p0 as the origin of Rd , and let U ⊂ Rd be the vector subspace defined by aff(σ). Let W be the (d − 1)-dimensional subspace parallel to H, and let π : Rd → W be the orthogonal projection onto W .
78CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION For any unit vector u ∈ U , sin ∠(aff(σ), H) = sin ∠(U, W ) ≤ ku − πuk. Since the vectors vi = (pi − p0 ), i ∈ {1, . . . , j} form a basis for U , we may write u = P a, where P is the m × j matrix whose ith column is vi , and a ∈ Rj is the vector of coefficients. Then, defining X = P − πP, we get ku − πuk = kXak ≤ kXk kak. Since d(pi , H) ≤ η for all 0 ≤ i ≤ j, W is at a distance less than η from H, and kvi − πvi k ≤ 2η. It follows then from Lemma 7.6 that p kXk ≤ 2 jη. Observing that 1 = kuk = kPak ≥ kak inf kxk=1 kPxk = sj (P)kak, we find kak ≤
1 , sj (P)
and the result follows from Lemma 7.8.
7.4
Approximation of surfaces
In this section, we consider a surface S of R3 which is compact and closed and has positive reach. We will denote by Tx the tangent space to S at point x. In addition, P denotes an ε-sample of S for some ε < 1. Our goal is to provide sufficient conditions on the sampling radius ε so that the restricted Delaunay triangulation DelS (P ) is a good approximation of S. For convenience, we will slightly modify the definition of DelS (P ), and define DelS (P ) as the collection of facets of Del(P ) whose dual Voronoi edge intersects S. Hence, we do not consider edges in DelS (P ) with no incident facet or isolated vertices. This is no real loss of generality since the two definitions are equivalent when the sample is dense enough as shown in Exercise 7.7. When we want to emphasize the distinction, we will call this variant the regularized restricted Delaunay triangulation. jd : cette def est + naturelle (algo) et aussi plus simple, e.g. lemmas 7.10 and 7.12 The main result of this chapter states that, if ε is sufficiently small, DelS (P ) and S are homeomorphic, and that the Fr´echet distance between S and DelS (P ) is at most ε (Theorem 7.1). A crucial fact is that the facets of DelS (P ) approximate well the tangent bundle of S when P is a good sample of S. As shown in Figure 7.5, this is not the case of any triangulation T (P ) of P : even when P is dense, there may exist facets whose normals are almost perpendicular to S. Hence, there may exist triangulations T (P ) that approximate S well for the Hausdorff distance but do not approximate well the tangent bundle of S. However, it is a remarkable fact that this cannot happen with DelS (P ) provided that P is dense and sparse enough. This is a consequence of Whitney’s Lemma 7.9.
79
7.4. APPROXIMATION OF SURFACES
Figure 7.5: The two trangulations approximate well the surface in the Hausdorff sense but only the left one provides a good approximation of normals.
In this section, f will denote a facet of DelS (P ). We write Bf for a S-centered Delaunay ball circumscribing f , cf for its center and rf or R(f ) for its radius. Since P is an ε-sample of S, we have rf ≤ ε rch(S). It follows that DelS (P ) is contained in an ε rch(S)-offset of S. Since ε < 1, DelS (P ) does not intersect axis(S). Let Ψ denote the restriction of Π to DelS (P ), i.e. the mapping that maps a point of DelS (P ) to its closest point on S. For simplicity and without real loss of generality, we use here the regularized version of DelS (P ). Observe that Ψ is well defined since DelS (P ) does not intersect axis(S). We now prove that, for small enough ε, Ψ is a homeomorphism. In addition, we will prove that DelS (P ) is close to S for the Fr´echet distance. The proof is organized as follows. We first observe that Ψ is continuous (by Lemma 7.4). We then prove that Ψ is injective (Lemma 7.13) and surjective (Lemma 7.14). Hence, Ψ is a continuous bijective map from the compact set DelS (P ) to the Hausdorff1 space S. It follows that Ψ is a homeomorphism between DelS (P ) and S. jd add a ref ? mention this result in chapter 0? Lemma 7.10 (Continuity of Ψ) If P is a loose ε-sample of S, then Ψ : DelS (P ) → S is continuous.
1 1−ε -Lipschitz
Proof Let x and y be two points of DelS (P ) belonging to the facets fx and fy respectively. Write px for the vertex of fx closest to x, and py for the vertex of fy closest to y. Since fx has a S-centered ball of radius r ≤ ε rch(S), we have kx − Π(x)k ≤ kx − px k ≤ ε rch(S).
and the same inequality holds also for y. We can thus apply Lemma 7.4 which implies that Ψ is continuous. 1
1 1−ε -Lipschitz
A topological space X is a Hausdorff space if any two distinct points of X can be separated by neighborhoods.
80CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION Lemma 7.11 (Injectivity of Ψ|star(p) ) Assume that P is a loose (ε, η)-sample of S such that ε/η ≤ ξ0 where ξ0 is a positive constant. Then, there exists a positive constant εS depending on ξ0 such that, for ε ≤ εS , the restriction of Ψ to the star of p in DelS (P ) is injective for any p ∈ P . Proof Let x be a point of S, nx a unit vector normal to S at x and lx the normal fiber at x, [x − ε rch(S) nx , x + ε rch(S) nx ]. Observe that the normal fibers at two distinct points of S are disjoint. Let f be a facet of DelS (P ) intersected by a fiber l(x) and let p be any vertex of f . Denoting by y a point of l(x) ∩ f , we have kx − pk ≤ kx − yk + ky − pk ≤ 3ε rch(S)
since ∆(f ) ≤ 2R(f ), where R(f ) denotes the radius of a S-centered Delaunay ball circumscribing f , and R(f ) ≤ ε rch(S) since P is a loose ε-sample of S. It then follows from Lemma 7.3 that d(p, Tx ) ≤
kx − pk2 9 ε2 ≤ rch(S). 2 rch(S) 2
Applying Whitney’s Lemma 7.9, we get sin ∠(aff(f ), Tx ) ≤
4 d(p, Tx ) 36 ε3 ≤ 2 ≤ 36 ξ02 ε D(f ) η
(7.1) 2
L (f ) The last inequality comes from the fact that the minimal altitude D(f ) of f satisfies D(f ) ≥ 2R(f ) , that R(f ) ≤ ε rch(S) as observed above, and that the length of a shortest edge of f , L(f ), satisfies L(f ) ≥ η rch(S) since P is η-sparse.
The same bound clearly holds for the angle between aff(f 0 ) and Tx . 1. We first prove that the restriction of Ψ to a facet of DelS (P ) is injective. Assume for a contradiction that lx contains two points of a facet f of DelS (P ), say y and z, that project onto the same point x of S. The line xy is normal to S at x, and f must contain the line segment [yz]. Hence, ∠(aff(f ), lx ) = 0. Since lx is def
orthogonal to Tx , we obtain a contradiction with (7.1) for ε < 1/(36 ξ02 ) = ε0S . 2. We now prove that the restriction of Ψ to two facets of DelS (P ) that share a common vertex is injective. Let f and f 0 be two facets of DelS (P ), and assume for a contradiction that lx intersects f at a point y, and f 0 at a point y 0 6= y. Let h = aff(f ) ∩ aff(f 0 ) and denote by uh a unit vector of h. We also write vpy = y − p, vpy0 = y 0 − p, and nf (resp., nf 0 ) for the unit vectors aligned with vpy ∧ uh (resp., vpy0 ∧ uh ). Since lx intersects both facets and y 0 = y + λnx , we have, (nf · nx ) × (nf 0 · nx ) > 0 We orient uh so that nf · nx > 0 and nf 0 · nx > 0.
(7.2)
81
7.4. APPROXIMATION OF SURFACES
Let Bf (resp., Bf 0 ) be a S-centered Delaunay ball of f (resp., f 0 ), and write H for the plane that contains the intersection of the two spheres bounding Bf and Bf 0 . Since Bf and Bf 0 are Delaunay balls, f and f 0 lie on two distinct sides of H. Hence, if uH denotes a unit vector of H not parallel to h, and nH = uh ∧ uH , we have det(vpy , uh , uH ) × det(vpy0 , uh , uH ) = (vpy · nH ) × (vpy0 · nH ) = (nf · uH ) × (nf 0 · uH ) < 0,
(7.3)
where det(v1 , v2 , v3 ) denotes the determinant of the 3 × 3 matrix whose elements are the coordinates of the vectors v1 , v2 , v3 . We show now that inequalities (7.2) and (7.3) lead to a contradiction by choosing a vector uH close to nx . Observe that the segment [cf cf 0 ] joining the centers of the S-centered Delaunay balls of f and f 0 is perpendicular to H. Since P is a loose ε-sample, we have kcf − cf 0 k ≤ 2εrch(M) and, by Lemma 7.3, sin(cf cf 0 , Tx ) = sin(nH , Tx ) = sin(H, nx ) ≤ sin(cf cf 0 , Tcf ) + sin(Tcf , Tx ) ≤ ε +
ε < 3ε. 1 − ε/2
(7.4)
Let uH be the unit vector of H that makes the smallest angle with nx . We assume that uH is not parallel to uh ; otherwise, we perturb take uH by an infinitesimal amount. We thus have sin(nx , uH ) ≤ 3 ε, and therefore knx − uH k ≤ 3 ε. In addition, taking ε < ε0S = 1/(36 ξ02 ), we deduce from (7.1) q q nf · nx = |nf · nx | ≥ 1 − (36ξ02 ε)2 ≥ 1 − 36 ξ02 ε ≥ 1 − 18 ξ02 ε, (7.5) and the same bound holds also for nf 0 · nx . Now, using (7.4) an (7.5), we get nf · uH
= nf · nx − nf · (nx − uH ) > 1 − 3 ε − 18ξ02 ε.
Plainly, the same bound applies to nf 0 · uH . Hence, if ε00S = 1/(3 + 18 ξ02 ) and ε < ε00S , nf · uH and nf 0 · uH are both positive. This contradicts (7.3). Taking for εS the minimum of ε0S and ε00S , the lemma is proved.
The previous lemma states that the restriction of Ψ to the star of any point p ∈ P in DelS (P ) is injective. Our goal is to extend this result to Ψ itself. We will need the two preliminary lemma that establishes that DelS (P ) is a triangulated surface. Lemma 7.12 (Triangulated surface) Under the same conditions as in Lemma 7.11, DelS (P ) is a triangulated surface. Proof For simplicity and without real loss of generality, we prove the lemma for the regularized version of the restricted Delaunay triangulation DelS (P ) (see Exercise 7.7).
82CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION We first observe that an edge of DelS (P ) is incident to exactly two facets of DelS (P ). First, we observe that an edge cannot be incident to more than two facets without violating Lemma 7.11. It is thus enough to show that any edge e of DelS (P ) belongs to at least two facets of DelS (P ). Assume the contrary and let e = [pq] be an edge belonging to only one facet f of DelS (P ). Consider the dual setting and write e∗ for the Voronoi facet dual to e and f ∗ for the Voronoi edge dual to f . Plainly f ∗ is an edge of e∗ . Our assumption then becomes : S intersects exactly one edge, namely f ∗ , of e∗ . Since, by Jordan’s theorem, the number of intersection points between the closed compact surface S and the boundary of e∗ is even, S must intersect f ∗ twice, which is impossible (see Exercise 7.8). Consider now a vertex p of DelS (P ) whose star boundary is not a simple closed polygon. By the discussion above, the star of p consists of several components we call umbrellas. Each umbrella of p is a triangulated cone with apex p. All umbrellas of p have p in common but two distinct umbrellas have distinct edges and facets. Since the restriction of Ψ to the star of p is continuous by Lemma 7.10 and 1-1 by Lemma 7.11, the same is true for the restriction of Ψ to any umbrella U of p. Hence, the restriction of Ψ to U is a homeomorphism between U and its image on S. Therefore Ψ(U ) is a topological disk on S with p in its interior. Having more than one umbrella would lead to several topological disks around p, which violates Lemma 7.11. We conclude that the star of each vertex of DelS (P ) is a topological disk, which proves the lemma.
We can now extend the local Lemma 7.11 to the following global lemma. Lemma 7.13 (Injectivity of Ψ) Under the same conditions as in Lemma 7.11, Ψ is injective. Proof It follows from the proof of the previous lemma that Ψ is a local homeomorphism in the sense that Ψ maps each star star(p) of DelS (P ) homeomorphically onto its image. In topological terms, (DelS (P ), Ψ) is a covering space of Ψ(DelS (P )). A standard result in topology then asserts that Ψ covers all the points of a connected component of its image Ψ(DelS (P )) the same number of times. Let us show that this number is exactly one. It cannot be zero by definition. Neither can it be more than one since, otherwise, some sample point p would be covered more than once, which would contradict the following claim. It follows that Ψ maps DelS (P ) homeomorphically onto its image Ψ(DelS (P )) and is thus injective. Claim 7.1 Let p ∈ P , and let Bp be a ball centered on the medial axis of S and tangent to S at p. We denote by mp the center of Bp . The segment [pmp ] can only intersect DelS (P ) at point p. Proof [Claim] We prove that the open segment pmp cannot intersect DelS (P ). Assume that pmp intersects a facet f of DelS (P ). ∂Bp and ∂Bf necessarily intersect. Indeed, Bp ∩ Bf 6= ∅ since Bp and Bf both contain
83
7.4. APPROXIMATION OF SURFACES
Bf H+
cf f
H−
mp
Bp
p
Figure 7.6: For the proof of Lemma 7.1.
f ∩ [pmp ] and none of the balls can be contained in the other since the vertices of f cannot belong to the interior of Bp and p cannot belong to the interior of Bf . Let H be the plane containing the intersection of the spheres bounding Bp and Bf , H + be the open halfspace limited by H that contains Bf \ Bp , and H − the other open halfspace which contains Bp \ Bf (see Figure 7.6). Since p does not belong to the interior of Bf and is on the boundary of Bp , p must belong to H − ∪ H. On the other hand, mp belongs to H − since otherwise mp would belong to Bf , which would contradict the assumption that R(f ) ≤ ε rch(S) < rch(S). Hence the open segment pmp is contained in the open half space H − , and therefore cannot intersect f which is contained in H + ∪ H . It remains to prove that Ψ is surjective. Lemma 7.14 (Surjectivity of Ψ) Under the same conditions as in Lemma 7.11, Ψ is surjective on S. Proof By definition of loose ε-samples, every connected component C of S contains at least one vertex that is incident to a facet of DelS (P ). This ensures that Ψ(DelS (P )) contains that vertex. Since, by Lemma 7.12, DelS (P ) is a compact surface without boundary, its image by Ψ is also a surface without boundary. Hence Ψ(DelS (P )) = S. By the previous results, Ψ is a continuous bijective mapping between DelS (P ) and S. Since DelS (P ) is compact and S is a Hausdorff space, Ψ is a homeomorphism. Moreover, the distance between any point
84CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION x ∈ f ⊂ DelS (P ) and Ψ(x) is at most kx − cf k ≤ ε rch(S). We have thus proved the following theorem. Theorem 7.1 (Homeomorphism) Let S be a closed and compact surface of positive reach embedded in R3 , and let P be a loose (ε, η)-sample of S, where ε/η ≤ ξ0 for some positive constant where ξ0 . Then, if ε ≤ εS , where εS is the constant depending on ξ0 that has been defined in Lemma 7.11, the Delaunay triangulation of P restricted to S is homeomorphic to S, and the Fr´echet distance between DelS (P ) and S is at most ε rch(S). The theorem can be strengthened without too much effort. It can be shown that DelS (P ) and S are in fact ambient isotopic (see Exercise 7.11). The bound on the Fr´echet distance can also be improved to O(ε2 ) (Exercise 7.10). A variant of the theorem holds also for non uniform samples. A finite set of points P is called a non-uniform ε-sample of S if, any point x ∈ S is at distance at most rch(x) from a point of P (Exercise 7.1).
7.5
Surface mesh generation by Delaunay refinement
In this section, we present an algorithm that constructs a sample and the associated restricted Delaunay triangulation so as to satisfy the conditions of Theorem 7.1. As in the previous section, we restrict the presentation to the case of surfaces that are compact, closed and of positive reach.
7.5.1
A greedy algorithm
The algorithm is greedy. We initialize the construction with a small set of points P0 ⊂ S. Then, the algorithm inserts points one by one and maintains the current set P , the Delaunay triangulation Del(P ) and its restriction DelS (P ) to S (regularized). The sampling density is controlled by a positive function ϕ defined over S. For simplicity, we restrict our attention to the case of a constant function ϕ = ϕ0 rch(S) > 0 but the results can be extended to non uniform Lipschitz functions ϕ (see Exercise 7.1). We define a bad facet as a facet f of DelS (P ) that has a circumscribing surface-centered Delaunay ball Bf = B(cf , rf ) satisfying rf > ϕ0 rch(S). The algorithm maintains a list L of bad facets of DelS (P ). As long as L is not empty, it inserts the center of the S-centered Delaunay ball of a bad facet (Figure 7.7). The insertion of this new point kills the bad facet but may create new bad facets (see Algorithm 1 refine bad facet(f )). The algorithm stops when there are no more bad facets (which eventually happens as we will see). It then returns the final ˆ = DelS (Pˆ ). sample Pˆ and the surface mesh S The surface does not need to be given explicitly but is queried through an oracle that, given a line segment f ∗ (to be the edge of Vor(P ) dual to a facet f of DelS (P )), determines whether f ∗ intersects S and, in the
7.5. SURFACE MESH GENERATION BY DELAUNAY REFINEMENT
85
d"
>!
Figure 7.7: A surface-centered Delaunay ball whose center is a candidate for being inserted in P .
affirmative, returns its intersection point furthest from the vertices of f . In addition, we need to know the reach of S or, at least, a lower bound on rch(S). Computing the reach of S depends on the representation of S. For the case of an implicit surface, see Exercise 7.2. Plainly, the algorithm constructs a sample that satisfies the second condition of a loose φ0 -sample (see ˆ has Definition 7.4). We also make sure that the first condition of a loose sample is satisfied, namely that S a vertex on each connected component of S. This is done by constructing, during the initialization phase, facets with a sufficiently small circumradius. More precisely, we construct one such facet per connected component of S. This can easily be done using the oracle. Such facets will remain in the restricted Delaunay triangulation all along the refinement phase. The first condition of a loose sample will therefore be satisfied.
Lemma 7.15 (Persistent facets) If the radius of a S-centered ball Bf circumscribing a facet f ∈ DelS (P0 ) is less than φ0 rch(S)/2, then this facet will never be killed by the refinement process.
Proof Assume for a contradiction that f has been killed by the insertion of a point x. Thus, x must belong to Bf . Let rf denote the radius of Bf . If v denotes any vertex of f , we have kv − xk ≤ 2rf ≤ φ0 rch(S). At the time x has been inserted, it was the center of a S-centered Delaunay ball B of radius larger than φ0 . Hence, B contained v, which contradicts the fact that B was a Delaunay ball.
86CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION Algorithm 1 refine bad facet(f ) insert cf in P and in Del(P ) ; update DelS (P ) by 1. removing the facets that are no longer facets of Del(P ); 2. adding the new facets of Del(P ) whose dual Voronoi edges intersect S; update L by 1. removing the elements of L that are no longer facets of DelS (P ); 2. adding the new facets of DelS (P ) that are bad;
7.5.2
Properties of the algorithm and of the output mesh
Lemma 7.16 The algorithm terminates after a finite number of steps. The set of inserted points Pˆ \ P0 is φ0 -sparse. Proof We call radius of insertion of a point p the distance of p to the current set P , just before inserting p. We denote it by ρp . We show that ρp ≥ ϕ0 rch(S) for all points p ∈ Pˆ \ P0 . Indeed, at each step, we insert the center cf of a surface-centered Delaunay ball that circumscribes a bad facet f . If rf denotes the radius of this ball, we have ρcf = rf . And, as f is a bad facet, rf > ϕ0 rch(S) > 0. The insertion radius of any point of Pˆ \ P0 is therefore always greater than ϕ0 rch(S). It follows that Pˆ \ P0 is φ0 -sparse and thus finite. Indeed, the balls of radius ϕ0 rch(S)/2 centered at the points of Pˆ \ P0 have disjoint interiors. The surface being compact, there can only be a finite number of such balls, which proves that the algorithm can only insert a finite number of points and must terminate. Lemma 7.17 The algorithm outputs a loose φ0 -sample. Proof The initialization phase creates persistent facets with vertices on all the connected components of S. Moreover, the algorithm kills all facets with a S-centered circumscribing ball of radius greater than φ0 rch(S). ˆ with at most one vertex in P0 . Then its fatness is at least 1/8. Moreover, Lemma 7.18 Let f be a facet of S if p is a vertex of f and Tp denotes the tangent space of S at p, we have sin(aff(f ), Tp ) ≤ 16 φ0 .
7.5. SURFACE MESH GENERATION BY DELAUNAY REFINEMENT
87
ˆ we have L(f ) ≥ φ0 rch(S). Indeed, let v be the vertex of the shortest edge that Proof For any facet f ∈ S, has been inserted last. This vertex does not belong to P0 and therefore L(f ) is at least the insertion radius of v which is at least φ0 rch(S). Moreover, R(f ) ≤ φ0 rch(S). Hence, Θ(f ) =
D(f ) L(f )2 1 1 ≥ × ≥ . 2∆(f ) 2R(f ) 4R(f ) 8
By Lemma 7.3, the distance from the vertices of f to Tp is at most ∆2 (f )/(2 rch(S)). Then, by Lemma 7.9, sin(aff(f ), Tp ) ≤
16 rf 8 ∆(f ) ≤ ≤ 16 φ0 . rch(S) rch(S)
The previous lemmas together with Theorem 7.1, lead to the main result of this section. Theorem 7.2 (Delaunay refinement) Let S be a closed and compact surface of positive reach embedded in R3 and assume that we are given a constant φ0 ∈ (0, εS /2) and an oracle that can report an intersection point between any line segment and S. Then the Delaunay refinement algorithm computes a sparse loose ˆ that is homeomorphic to S. The Fr´echet distance between φ0 -sample Pˆ of S and a triangulated surface S ˆ is at most φ0 rch(S). The angle between the normal to a facet and the normal to S at any of its S and S vertices is at most arcsin(16 φ0 ).
7.5.3
Applications
Meshing implicit surfaces Assume that S is given as an implicit surface f (x, y, z) = 0 where f is defined over R3 and differentiable, and 0 is a regular value of f . Then S is differentiable and the two conditions of Section 7.5.2 are rather easy to fulfill. First, solving ∂f (x,y,z) = 0 will provide at least two points per connected component (In x fact, it will provide all local extrema of S with respect to the x-axis). Second, rch(S) can be computed (see Exercise 7.2). A weaker oracle can be used instead of the general oracle. The weaker oracle only detects if a given line segment intersects S an odd number of times (see Exercise 7.13), which can be easily implemented by testing the sign of f at the two end points of the line segment. This leads to a much faster algorithm. We present some experimental results on algebraic surfaces. The surface on the left of Figure 7.8 has genus 3. The surface on the right is the standard trefoil knot. In both cases, the topology is correctly captured.
88CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION
Figure 7.8: Two meshes of implicit algebraic surfaces.
Meshing isosurfaces in 3D images A 3D image is a 3 × 3 grid where each vertex of the grid is a sample point of a function f (x, y, z). The problem is then to compute an approximation of an iso-surface f (x, y, z) = c, where c is a given constant. S may correspond, for example, to the boundary of some organ in a medical image. Since f and therefore S is only known at the grid points, we cannot directly use the oracle on S. We need some kind of interpolation to be able to intersect S with a line-segment as required by the oracle of the meshing algorithm. The easiest one is to use trilinear interpolation inside each cell of the grid (see Figure 7.9). Although the resulting surface S is polyhedral and therefore not smooth, if S is an approximation of a smooth surface (such as an organ), Theorem 7.1 and the meshing algorithm can be extended so as to remain valid (see the bibliographical notes in Section 7.7). Figure 7.10 shows a result on an image of the brain.
Meshing point-set surfaces A point-set surface is a surface that is only known at a finite number of points. Differently from the previous section, these points are unorganized. Let S be a surface and P a finite set of points on S. Constructing a good approximation of S from P is known as the surface reconstruction problem. There are many approaches to this problem. Chapter ?? will present a general approach for reconstructing submanifolds of any dimension. In the case of a surface of R3 , the codimension of the surface is 1 and we can solve the problem in two steps in a way similar to what has been done above for the case of 3D images. First, we define an implicit ˜ of S. Then, we mesh S. ˜ function whose zero-set is a good approximation S There are several ways to define a suitable implicit function and we refer the interested reader to the references in Section 7.7. A simple method consists in first estimating the direction of the normal to the
7.5. SURFACE MESH GENERATION BY DELAUNAY REFINEMENT (x, 1, 1)
(0, 1, 1)
89
(1, 1, 1)
(x, y, 1) (0, 0, 1)
(0, 1, 1) (x, 0, 1)
p
(1, 1, 0)
(x, y, 0)
(0, 0, 0)
(x, 0, 0)
(0, 1, 0)
Figure 7.9: Trilinear interpolation in the unit cube. We project point p = (x, y, z) onto the bottom and top faces of the cube, yielding the two points (x, y, 0) and (x, y, 1). Each of those two points is then projected onto the edges parallel to the x-axis of the corresponding faces, yielding to the points (x, 0, 0) and (x, 1, 0) on the bottom face, and (x, 0, 1) and (x, 1, 1) on the top face. We then proceed in reverse order : f (x, i, j) = (1−x)f (0, i, j)+xf (0, i, j), f (x, y, i) = (1−y)f (x, 0, i)++yf (x, 1, i), f (x, y, z) = (1−z)f (x, y, 0)+zf (x, y, 1), for i, j ∈ {0, 1}.
surface at each point of P : this can be done using the Voronoi diagram of P (see Exercise 7.5). Once the normal directions have been computed at each point of P , we orient the normals so that the normals of two points that are close make an angle less than 90 degrees. We can then associate to each point pi ∈ P with oriented normal ni the function defined over R3 : hi (x) =P(x − pi ) · ni . Plainly, h−1 i (0) is the tangent plane at pi . We then define an interpolating function h(x) = i λi (x)hi (x) where the set of λi is a partition of unity, i.e. a set of continuous functions from S to [0, 1] satisfying 1.
P
i λi (x)
=1
2. λi (pj ) = δij , where δij is the Kronecker delta2 . An example of such a partition of unity is given in Exercise 4.1. ˜ = h−1 (0) passes through the points We therefore have h(pi ) = 0 at each point pi ∈ P which implies that S of P . Moreover, if the λi are smooth, by Sard’s theorem, 0 is not a critical value of h with probability 1, ˜ using the surface meshing algorithm. An example is shown in and h−1 (0) is smooth. We can then mesh S Figure 7.11. The interpolation scheme above can be replaced by an approximation scheme : the implicit surface is no 2
δij = 1 if i = j, 0 otherwise.
90CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION
Figure 7.10: Meshing an isosurface in a 3D image of the brain.
longer required to pass through all the points. This is useful in presence of noisy data (Figure 7.11). More advanced techniques can be used to orient the normals. See the references in Section 7.7.
7.6
Exercises
Exercise 7.1 (Non uniform samples) A non uniform ε-sample P of S is defined as a set of points of S such that, for any x ∈ S, there exists p ∈ P such that kx − pk ≤ ε rch(x). Show that rch is a 1-Lipschitz function and extend the results of this chapter to sufficiently dense non uniform ε-samples. Exercise 7.2 (Computing rch(M)) Let S be a smooth surface. Show that rch(S) is either the inverse of the maximal absolute normal curvature at some point x ∈ S (in which case, one of the two spheres tangent to S at x of radius rch(S) is osculating S), or it is the radius of a sphere σ that is tangent to S at two points that are the endpoints of a diameter of σ. Show how to compute rch(S) when S is a surface defined as f (x, y, z) = 0 where f is defined over Rd and differentiable, and 0 is a regular value of f . Exercise 7.3 (Reconstruction of curves) Show that, if S denotes a smooth closed curve of Rd and P a
7.6. EXERCISES
91
Figure 7.11: Set P is shown in the upper left image. Two implicit functions are used. The one used on the first line interpolates the data points; hence, its zero-set passes through all the data points. On the second line, the implicit surface is not required to pass exactly through the data points. A smoother surface is reconstructed. Observe that in both cases the vertices of the reconstructed surface are not the initial data points.
92CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION generic ε-sample of S (for any ε < 1), Dels (P) is a polygonal curve homeomorphic to S and dF (DelS (P), S) ≤ 2ε. (Hint : use Lemma 7.2). Exercise 7.4 (Angle between tangent spaces) This exercise is an analog of Lemma 7.5 for general manifolds. The suggested proof is elementary but not tight. Let M be a submanifold of positive reach, and let x and z be two points of M with kx − zk = α rch(M), α < 1. Show that ∠(Tx , Tz ) ≤ 6α. Proof For a unit vector u in Tx , let y 0 be a point in Tx such that y 0 = x + α rch(M) · u. Let v denote the unit vector in Tz aligned with the projection of u onto Tz . We have sin ∠(u, v) ≤
dist(x, Tz ) + dist(y 0 , Tz ) . kx − y 0 k
(7.6)
We now bound the two quantities dist(x, Tz ) and dist(y 0 , Tz ). We deduce from Lemma 7.3 α2 rch(M) (7.7) 2 To bound dist(y 0 , Tz ), we introduce y, the point of M closest to y 0 whose orthogonal projection on Tx is y 0 2 (refer to Fig. 7.4). Write kx − yk = β 0 rch(M). Using Lemma 7.3, we get ky 0 − yk ≤ β2 rch(M). Applying Pythogoras theorem in triangle xyy 0 , we get dist(x, Tz ) ≤
β4 kx − yk2 = kx − y 0 k2 + ky 0 − yk2 ⇒ β 2 ≤ α2 + 4 √ 2 0 2 2 from which we get β ≤ 2 − 2 1 − α2 ≤ 2α and therefore ky − yk ≤ α rch(M). We deduce that kz − yk ≤ kz − xk + kx − y 0 k + ky 0 − yk ≤ α (2 + α) rch(M).
Then, from Lemma 7.3, we obtain dist(y, Tz ) ≤
α2 9α2 (2 + α)2 rch(M) ≤ rch(M). 2 2
We deduce dist(y 0 , Tz ) ≤ dist(y, Tz ) + ky − y 0 k ≤
11α2 rch(M) 2
(7.8)
Using (7.7) and (7.8), Inequality 7.6 becomes sin ∠(u, v) ≤
dist(x, Tz ) + dist(y 0 , Tz ) ≤ 6α kx − y 0 k
Since this result holds for any unit vector u of Tx , we have proved the lemma.
93
7.6. EXERCISES
Exercise 7.5 (Estimation of normals) Let P be an ε-sample of a smooth surface S for some small enough ε. We associate to each point p ∈ P its pole, i.e. the vertex vp of Vor(p) which is furthest from p. Show that the line (pvp ) approximates the direction of the normal to S at p. Bound sin ∠(p − vp , np ) as a function of ε. Exercise 7.6 A loose ε-sample of S is a 2ε-sample of S if ε ≤ εS . Proof Let P be a loose ε-sample of S. If ε < εS , Ψ is surjective (Lemma 7.14 still holds for loose ε-samples). Let x ∈ S, x0 = Ψ−1 (x), and let f be a facet of S that contains x0 . Since x is the point of S closest to x0 , we have kx − x0 k ≤ kcf − x0 k ≤ rf . Moreover, since P is a loose ε-sample, rf ≤ ε rch(S). Denoting by p the vertex of f closest to x0 , we thus have kx − pk ≤ kx − x0 k + kx0 − pk ≤ 2 rf ≤ 2 ε rch(S). Exercise 7.7 (Regularized DelS (P )) Let P be an ε-sample of a surface S for some sufficiently small ε. Prove that each connected component of S contains at least one point of P . Prove also that DelS (P ) is a pure complex identical to its regularized version, i.e. any vertex and any edge of DelS (P ) is incident to at least one facet of DelS (P ). Exercise 7.8 (Unicity of the S-centered ball) Show that, if P is an ε-sample of a surface S for a sufficiently small ε, any face f of DelS (P ) has a unique S-centered ball or, equivalently, that the dual Voronoi edge f ∗ of f intersects S exactly once. (Hint : assume for a contradiction that f ∗ intersects S in two points c and c0 . Observe that (cc0 ) is orthogonal to f and use Lemmas 7.3 and 7.18 to get a contradiction). Exercise 7.9 (Projection onto the tangent space) Let M be a smooth manifold. Let p ∈ M and ΠTp √ be the projection onto Tp , the tangent space at p. If r < rch(S)/(6 2), the restriction of ΠTp to S ∩ B(p, 2r) is injective. Proof Assume, for a contradiction, that ΠTp is not injective. Since M ∩ B(p, 2r) is a topological disk by Lemma 7.1, there must exist a point x ∈ B(p, 2r) such that the tangent space Tx contains both x and ΠTp (x). But, by Lemma 7.5, we have 2 6r 2 ∠(Tp , Tx ) cos ∠(Tp , Tx ) = 1 − 2 sin ≥1−2 2 rch(S) √ which is positive if r < rch(S)/(6 2). Under this condition, ∠(Tp , Tx ) < π2 , and we reach a contradiction.
94CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION Exercise 7.10 (Hausdorff distance) Let S be a surface S of positive reach and let P be an ε-sample of S for a sufficiently small ε. Show that the Hausdorff distance between DelS (P ) and S is O(ε2 ). (Hint : in a neighborhood of a point x ∈ S, S is sandwiched between two balls of radius rch(S) tangent to S at x (see Lemma 7.3)). Exercise 7.11 (Ambient isotopy) Let S be a surface, P an ε-sample for ε ≤ εS , where εS is the constant ˆ = DelS (P ). Then Ψ, the restriction to S ˆ of the orthogonal projection defined in Lemma 7.11, and write S onto S, induces an ambient isotopy Φ∗ : R3 × [0, 1] −→ R3 ˆ is the identity map on S ˆ and Φ∗ (S, ˆ 1) = S. The isotopy does not such that the map Ψ∗ (·, 0) restricted to S move the points by more than ε. Proof 1. Let ˆ × [0, 1] −→ R3 , Φ:S
(x, t) 7→ x + t (Π(x) − x)
ˆ and Φ(·, 1) = Ψ. The map Φ is an isotopy because the maps Note that Φ(·, 0) is an identity map on S ˆ −→ R3 , Φt : S
x 7→ Φ(x, t)
ˆ and Φt (S). ˆ are homeomorphisms between S Isotopy Φ can be extended to an ambient isotopy Φ∗ : R3 × [0, 1] −→ R3 such that Φ∗ (·, 0) |Sˆ = Φ(·, 0) and Φ∗ (·, 1) |Sˆ = Φ(·, 1) (see, e.g. [59]). ˆ is contained in a S-centered Delaunay ball of radius at most ε, the isotopy does not 2. Since any facet f ∈ S move the points by more than ε. Exercise 7.12 (Small angles) We modify the definition of a bad facet so as to eliminate facets with small angles. A facet f of DelS (P ) is now said to be bad if rf is too large (as above) or if one of its angles is smaller than π6 . Show that the algorithm still terminates. As a result, the triangulated surface output by the Delaunay refinement algorithm will have the additional property that all its facets have angles in the range [30o , 120o ]. Exercise 7.13 (Bipolar facets) We modify the Delaunay refinement algorithm as follows. Instead of considering all bad facets in DelS (P ), we only look for the so-called bipolar bad facets. A bipolar facet is a facet of Del(P ) (and also of DelS (P )) such that its dual Voronoi edge intersect S an odd number of times. Show that the algorithm still terminates and produces the same output as the standard algorithm. (The modified algorithm is much faster than the standard one when meshing implicit surfaces f (x, y, z) = 0).
95
7.7. BIBLIOGRAPHICAL NOTES
Exercise 7.14 (Volume of balls) Let Bp = B(p, rt ) be the ball centered at p ∈ S of radius rt = t rch(S) for some small enough t. Prove that there exists absolute constants C and C 0 such that C rt2 ≤ area(Bp ∩ S) ≤ C 0 rt2 . Exercise 7.15(Bound on the size of the sample) Show that the number of points inserted by the area(S)) algorithm is O . φ2 0
Proof Let Bx be the open ball B(x, ϕ0 /2). According to the proof of Lemma 7.16, if p and q are two distinct points of Pˆ \ P0 , Bp and Bq are disjoint. Hence, using Exercise 7.14, 2 Z X Z φ0 area(S) = dx ≥ dx ≥ C (|Pˆ | − |P0 |) 2 S Bp ∩S p∈Pˆ \P0
where C is an absolute constant. The upper bound is proved since |P0 | = O(1). A similar argument gives a lower bound.
7.7
Bibliographical notes
The concept of restricted Delaunay triangulation is related to the notion of nerve in algebraic topology [48]. The notion of reach has been introduced by Federer [50] who proved Lemmas 7.3 and Exercise 7.4. The notion of ε-samples and variants of several of the results of this chapter can be found in the seminal paper of Amenta and Bern on surface reconstruction [1]. Loose ε-samples have been introduced by Boissonnat and Oudot [11] in the context of surface mesh generation. Our proof of Lemma 7.5 is based on an idea of Lieutier and Thibert. The elementary proof of its extension to general manifolds given in Exercise 7.4 is from Boissonnat and Ghosh [7]. Cohen-Steiner and Morvan have further shown that one can estimate the tensor of curvatures from DelS (P ) [34]. For an extension of the results of this chapter to some gentle class of non smooth surfaces, see [12]. The paradigm of Delaunay refinement has been first proposed by Ruppert for meshing planar domains [73, 48]. Its extension to surfaces has been first proposed by Chew [30]. A full description and analysis has been later on provided by Boissonnat and Oudot [11]. The application to 3D images is further described in [8]. References to surface reconstruction can be found Dey’s book [37] and in the survey paper [17]. A critical issue in the approach proposed in Section 7.5.3 to mesh point set surfaces is the orientation of normals in the presence of sharp features or noisy data. See [60, 65] for robust solutions to this problem. Other certified methods for surface mesh generation using different approaches are surveyed in [9]. The surface mesh generator described in this chapter is implemented in the open source CGAL library (www.cgal.org).
96CHAPTER 7. RESTRICTED DELAUNAY TRIANGULATION AND SURFACE MESH GENERATION The complexity of the mesh generator described in this chapter depends on the complexity of the 3dimensional Delaunay triangulation of the set of points P . As shown in Chapter ??, this complexity is quadratic in the worst case (Theorem 4.1 and Exercise 4.7). However, it has been shown (and experienced in practice) that, when P is a good sample of a surface of R3 , the complexity of Del(P ) is close to linear [2, 3, 49]. (ε, η)-samples are known as nets or Delone sets (the spelling is different but Delone and Delaunay are the same russian mathematician).
Appendix
Chapter 8
Manifold reconstruction see INRIA Research Report 7142 [?] http://hal.archives-ouvertes.fr/inria-00440337/
97
98
CHAPTER 8. MANIFOLD RECONSTRUCTION
Part III
Geometric inference
99
Chapter 9
Distance functions In the sequel, all the considered shapes and their approximations are represented by compact subsets 1 of an Euclidean space Rd . We use the indifferently the words shape and compact set. In this section, we address the general problem consisting in recovering the topology of a shape from an approximation of it. A typical example of such a problem is illustrated on figure 9.1. General inference problem: given an approximation K 0 (typically a point cloud) of an unknown shape K, can we infer the topology of K from K 0 ? This question is far too general to be directly rigorously addressed. Different points need to be precised. First, it is necessary to formalize the notion of approximation. This is done by defining a notion of distance between shapes; in this section we use the so-called Hausdorff distance. Second, it is also necessary to explain what is meant by “infering the topology”. In the best case, one may be able to reconstruct a shape that is homeomorphic or even isotopic to the underlying shape K. Sometimes one can only reconstruct a topological space that is homotopy equivalent to K or one can only recover some topological invariants of K. It is also important to be aware that there is no hope to provide a general relevant answer to the inference problem without making any assumptions on the “regularity” of the underlying shape and on the quality of the approximation. Determining relevant assumptions leads to sampling conditions that are sufficient to recover the topology of K from K 0 . Note that the classical reconstruction problems for smooth curves and surfaces sampled by point cloud data sets that have been widely studied in the last decades are particular cases of the general inference problem. The goal of this section is to introduce a general mathematical framework allowing to provide positive answers to the above mentionned problem in a wide range of settings encountered in practical applications. 1
recall that a subset K of Rd is compact if and only if it is closed and bounded.
101
102
CHAPTER 9. DISTANCE FUNCTIONS
In particular, our framework allows to work with a wide class of non smooth shapes containing sharp edges and singularities. Our approach is based on the notion of distance function to a compact set.
Figure 9.1: A point cloud data set (left) sampled around the surface of a knotted torus (right). How can we recover the topologie of the underlying torus from the point cloud?
9.1
Distance function and Hausdorff distance
Given a compact subset K ⊂ Rd , the distance function dK to K is the non-negative function defined by dK (x) = inf d(x, y) for all x ∈ Rd y∈K
where d(x, y) = kx − yk is the euclidean distance between x and y in Rd . The distance function to K is continuous and indeed 1-Lipschitz: for all x, x0 ∈ Rd , |dK (x)−dK (x0 )| ≤ kx−x0 k. Moreover, K is completely characterized by dK since K = d−1 K (0). For any non-negative real number r, the r-offset K r of K is the r-sublevel set of dK defined by d K r = d−1 K ([0, r]) = {x ∈ R : dK (x) ≤ r}
To quantify the notion of approximation for shapes it is necessary to introduce a distance measuring the closeness between two different shapes. Intuitively, two shapes K and K 0 could be considered as close to each other if any point of K is close to K 0 and if any point of K 0 is close to K. This means that K is
9.1. DISTANCE FUNCTION AND HAUSDORFF DISTANCE
103
contained in a small offset of K 0 and K 0 is contained in a small offset of K or equivalently, the restriction of dK 0 to K is bounded by some small constant and the restriction of dK to K 0 is bounded by some small constant. This intuition is easily turned into a formal definition.
Definition 9.1 Let K, K 0 ⊂ Rd be two compact sets. The Hausdorff distance dH (K, K 0 ) between K and K 0 is defined by any of the following equivalent assertions:
• dH (K, K 0 ) is the smallest number r such that K ⊂ K 0r and K 0 ⊂ K r . • dH (K, K 0 ) = max (supx∈K dK 0 (x), supx∈K 0 dK (x)). • dH (K, K 0 ) = kdK − dK 0 k := supx∈Rd |dK (x) − dK 0 (x)|. The Hausdorff distance defines a metric on the space of compact subsets of Rd . In general, the topological and geometric features of a shape cannot be directly extracted from the features of an approximation. In particular this is always the case for a (continuous) shape K, e.g. a surface in R3 , approximated by a finite point cloud data set K 0 : for example, if dH (K, K 0 ) is small enough, the number of connected components of K is obviously different from the number of connected components (i.e. the cardinality) of K 0 . Worse, the occurence of some features may depend on a “scale” at which the data and the shape are considered: for example, viewed with human eyes, the surface of a real world object may look very regular but at a microscopic scale it appears as a much more complicated surface with many holes and tunnels. More generally, point clouds in themselves do not carry any non trivial topological or geometric structure. It is thus necessary to “build” some scale-dependant geometric structure on top of such point clouds to recover informations about the shapes they approximate. For that purpose, the approach we adopt in the sequel consists in considering the distance functions to compact sets and to compare the topology of their sublevel sets (i.e. the offsets) for close compact sets. The underlying intuition is that “at some scales” (i.e. for some range values of the offsets), two close compact sets should have the same offset topology as illustrated on figure 9.2. The goal of this section is to turn this intuition into a formal formal framework with formal statements. This requires to procceed in two steps. First, one needs to understand how the topology of the offsets K r of a given compact set K evolves with the parameter r. The answer to this question is given by the theory of critical points for distance functions that has been developped in Riemannian Geometry [29, 57]. Second, it is necessary to compare the topology of the offsets of two close (for the Hausdorff distance) compact sets. This leads to stability results and sampling conditions necessary to ensure correct geometric inference.
104
CHAPTER 9. DISTANCE FUNCTIONS
Figure 9.2: Various offsets of a point cloud data set sampled around a torus in R3 .
9.2
Critical points of distance functions
Given a compact set K ⊂ Rd , the distance function dK is usually not differentiable. For example, if K is a (empty) square in the plane, dK is not differentiable along the diagonals of K. Nevertheless, it is possible to define a generalized gradiend vector field ∇K : Rd → Rd for dK that coincides with the classical gradient at the points where dK is differentiable. For any point x ∈ Rd we denote by ΓK (x) the set of points in K closest to x: ΓK (x) = {y ∈ K : d(x, y) = dK (x)} This is a non empty compact subset of K. Let σK (x) be the smallest closed ball enclosing ΓK (x) and let θK (x) be its center and FK (x) its radius (see figure ??). For x ∈ Rd \ K, the generalized gradient ∇K (x) is defined by ∇K (x) = and for x ∈ K, ∇K (x) = 0.
x − θK (x) RK (x)
105
9.2. CRITICAL POINTS OF DISTANCE FUNCTIONS
Figure 9.3: A 2-dimensional example with 2 closest points. The norm of the gradient is given by k∇K (x)k2 = 1 −
FK (x)2 RK (x)2
(9.1)
Equivalently, the norm of ∇K (x) is the cosine of the half angle of the smallest (“circular”) cone with apex x that contains ΓK (x). Intuitively, the direction of ∇K (x) is the one along which the directional derivative of dK is the largest or, in other words, the one in which the “slope” of the graph {(y, dK (y)) : y ∈ Rd } ⊂ Rd+1 is the largest at the point (x, dK (x)) (see figure ??). Definition 9.2 The set of points x ∈ Rd such that ΓK (x) contains more than one point is called the medial axis of K. It is denoted by axis(K).
106
CHAPTER 9. DISTANCE FUNCTIONS
Figure 9.4: The graph of the distance to a square (in red) in the plane. Along the diagonal of the square, the direction of the gradient is given by the diagonals and its norm is the slope of the “edges” of the graph above the diagonals. Note that since FK (x) = 0 if and only if ΓK (x) contains only one point it follows from equation (9.1) that axis(K) = {x ∈ Rd : |∇K (x)| < 1}. The map x ∈ Rd → ∇K (x) ∈ Rd is in general not continuous. In other words, ∇K is a discontinuous vector field. Nevertheless it is possible to show (see [62], or [70] for a more general statement) that x → |∇K (x)| is a lower semi-continuous function 2 and ∇K is integrable, that is the differential equation dX = ∇K (X(t)) dt has some solutions. More precisely, the Euler scheme associated to this equation converges uniformely, as the integration step tends to 0, to a continuous flow C : R+ × Rd → Rd such that t → C(t, x) is the trajectory of ∇K starting from x at t = 0. Moreover this continuous trajectory can be parametrized by arc length s → C(t(s), s) and one has Z dK (C(t(l), x)) = dK (x) + 0
l
k∇K (C(t(s), x)kds
(9.2)
The above equation implies that dK is increasing along the trajectories of ∇K . It can also be shown [62] that FK is also non decreasing along the trajectories of ∇K . The gradient ∇K allows to define the notion of critical point for dK in the same way as for differentiable functions. 2
a function f : Rd → R is lower semi-continuous if for any a ∈ R, f −1 ((−∞, a]) is closed subset of Rd
9.3. TOPOLOGY OF THE OFFSETS OF DK
107
Definition 9.3 A point x is a critical point of dK if ∇K (x) = 0. A real c ≥ 0 is a critical value of dK if there exists a critical point x ∈ Rd such that dK (x) = c. A regular value of dK is a value which is not critical. When there is no risk of confusion, we make the small abuse of language consisting in calling a critical (resp. regular) point of dK a critical (resp. regular) point of K.
9.3
Topology of the offsets of dK
Using the notion of critical point defined in the previous section, it appears that distance functions to compact sets share some properties similar to differentiable functions. In particular, the sublevel sets of dK are topological submanifolds of Rd and their topology can change only at critical points. These properties are formalized in the following two theorems that are proven in [57]. Theorem 9.1 Let K ⊂ Rd be a compact set and let r be a regular value of dK . The level set d−1 K (r) is a (n − 1)-dimensional topological submanifold of Rd . Theorem 9.2 (Isotopy Lemma) Let K ⊂ Rd be a compact set and let r1 < r2 be two real numbers such that [r1 , r2 ] does not contain any critical value of dK . Then all the level sets d−1 K (r), r ∈ [r1 , r2 ] d are homeomorphic (and even isotopic) and the “annulus” A(r1 , r2 ) = {x ∈ R : r1 ≤ dK (x) ≤ r2 } is homeomorphic to d−1 K (r1 ) × [r1 , r2 ]. An immediate consequence of these two results is that the topology of the offsets of K can only change at critical values and for any regular value r of dK , the offset K r is a n-dimensional topological manifold with boundary. In particular, when one considers “small” offsets K r , r > 0, their topology cannot change while r is smaller than the smallest positive critical value of dK (if it exists). This leads to the notion of weak feature size first introduced in [24, 25, 26]. Definition 9.4 Let K ⊂ Rd be a compact set. The weak feature size wfs(K) of K is the infimum of the positive critical values of dK . If dK does not have critical values, wfs(K) = +∞. It follows from the Isotopy Lemma 9.2 that if 0 ≤ α ≤ β < wfs(K), then K α and K β are isotopic. In a more intuitive way, the knowledge of K up to a precision of α, or at scale α, gives the same information for any choice of 0 < α < wfs(K). Moreover, the following result allows to compare the topology of the offsets of two close compact sets with positive weak feature sizes.
108
CHAPTER 9. DISTANCE FUNCTIONS
Theorem 9.3 ([25, 26]) Let K, K 0 ⊂ Rd and ε > 0 be such that dH (K, K 0 ) < ε, wfs(K) > 2ε and wfs(K 0 ) > 2ε. Then (i) Rd \ K and Rd \ K 0 have the same homotopy type, (ii) for any 0 < α ≤ 2ε, K α and K 0α are homotopy equivalent. The proof of this result, ommitted in these notes, uses the gradient vector fields of dK and dK 0 to build a map H that fullfills the hypothesis of proposition 2.1. It complete proof can be found in [25] (prop. 3.3). The theorem 9.3 shows that the compact sets with positive weak feature size provides a class of compact sets with interesting topological stability properties. Moreover, it is possible to show that this class is large enough to include most of the shapes encountered in practical applications. In particular, smooth manifolds, polyhedra, polyhyedral sets, semi-algebraic sets and more generally the so-called subanalytic compact sets (i.e. “obtained from” analytic equations and inequations) all have positive weak feature size (see [52] p. 1045 and [25], proposition 3.6). Nevertheless, the previous theorem suffer from an important weakness that prevent it to be really useful in practice. Indeed, the assumtion made on the wfs involving both wfs(K) and wfs(K 0 ) is hardly satisfied in practical situations. For example if K is some “continuous” shape (e.g. a surface) approximated by a finite point cloud K 0 , wfs(K 0 ) is equal to half of the distance between the two closest points of K 0 which is usually smaller than 2dH (K, K 0 ) as illustrated on figure ??. As a consequence, even if the weak feature size of K is large, it may happen that whatever the quality of the approximation by K 0 the hypothesis of the theorem 9.3 are never satisfied. This phenomenum can also be interpreted as a lack of continuity of the map K → wfs(K) or as an instability property of the critical points of distance functions. 2 wfs(K 0 )
dH (K, K 0 )
K
Figure 9.5: A segment K approximated by a point cloud K 0 (in red). The weak feature size of K 0 is obviously smaller than two times the Hausdorff distance between K and K 0 .
9.4
(Un)stability of the critical points of dK
Since the topology of the offsets of a compact can only change at critical points of dK , it is natural to study the stability of these critical points when K is replaced by a close compact set K 0 . Unfortunately, it appears that the critical points are unstable, as illustrated on figure 9.6. To overcome this unstability problem we introduced a “parametrized” notion of critical point. Definition 9.5 Let K ⊂ Rd be a compact set and let 0 ≤ µ ≤ 1. A point x ∈ Rd is µ-critical for dK if
9.4. (UN)STABILITY OF THE CRITICAL POINTS OF DK
K
109
K’
Figure 9.6: When K is a rectangle, there is a segment of critical points of dK along one of the axes of symmetry of K (the bold segment). This segment collapses to one point as soon as one stretches the bottom side of K to obtain K 0 . Nevertheless, along the previously critical segment, the norm of the gradient of dK 0 remains small. |∇K (x)| ≤ µ. Note that a 0-critical points are exactly the above defined critical points of dK . Unlike the 0-critical points alone, the family of µ-critical points satisfies the following fundamental stability property. 0 Theorem 9.4 (critical point stability theorem [21]) Let of Rn and pK and K be two compact subsets 0 0 dH (K, K p ) ≤ ε. For any µ-critical point x of K, there is a (2 ε/dK (x) + µ)-critical point of K at distance at most 2 εdK (x) from x.
√ Roughly, this theorem states that in a neighborhood of size O( ε) of a given µ-critical point of K, there is √ a (µ + O( ε)-critical point for any ε-approximation K 0 of K. In particular, any ε-approximation K 0 of K √ √ has at least one O( ε)-critical point in a O( ε)-neighborhood of each critical point of K. The proof of this theorem follows from two technical lemmas. The first one shows that the function dK cannot grow too fast in a neighborhood of a µ-critical point. Lemma 9.1 Let K ⊂ Rd be a compact set and x one of its µ-critical points. For any y ∈ Rd , we have: dK (y)2 ≤ dK (x)2 + 2µdK (x)||x − y|| + ||x − y||2
110
CHAPTER 9. DISTANCE FUNCTIONS
Proof Let Γ = ΓK (x) be the set of points closest to x on K, and let S be the sphere with center x and radius dK (x). Let also c = θK (x) be the center of the minimal enclosing ball of Γ, and α = cos−1 (µ) (see figure 9.7).
Figure 9.7: Proof of lemma 9.1 For any x0 ∈ Rd we have dK (y)2 ≤ ky − x0 k2 = < (y − x) + (x − x0 ), (y − x) + (x − x0 ) >
= ky − xk2 + kx − x0 k2 + 2 < (y − x), (x − x0 ) >
= dK (x)2 + 2dK (x)kx − yk cos(y − x, x − x0 ) + kx − yk2
To prove the lemma it is thus sufficient to prove (*) there exists a point x0 ∈ Γ such that the angle between (y − x) and (x0 − x) is not greater than π − α. We distinguish between two cases.
9.4. (UN)STABILITY OF THE CRITICAL POINTS OF DK
111
Case 1: µ 6= 0 Assume that (*) is not satisfied. Then for any x0 ∈ Γ the angle between x0 − x and x − y is smaller than α. Since Γ is compact, there exists α0 < α such that Γ is contained in the “circular” cone with apex x and axis the half-line directed by x − y and apex angle α0 . This cone intersects S along a (d − 2)-sphere with center c0 and radius R0 = dK (x) sin α0 . Since Γ is also contained in S, Γ is contained in the ball of center c0 and radius R0 = dK (x) sin α0 < dK (x) sin α = FK (x): a contradiction. Case 2: µ = 0 α = π2 and Γ cannot be enclosed in any hemisphere of S. So there is at least one point x0 ∈ Γ such that the angle between (y − x) and (x0 − x) is not larger than π2 . The next lemma allows to study the behavior of the µ-critical points when K is replaced by a close approximation K 0 .
Lemma 9.2 Let K and K 0 be two compact subsets of Rd and dH (K, K 0 ) ≤ ε. For any µ-critical point x of K and any ρ > 0, there is a µ0 -critical point of K 0 at distance at most ρ from x, with: µ0 ≤
ρ ε +2 +µ 2dK (x) ρ
Proof Let us consider an integral line C of the vector field ∇K 0 parameterized by arc length and starting at x. If C reaches a critical point of K 0 before length ρ, the lemma holds. Assume this is not the case. Letting y = C(ρ), we have: Z ρ dK 0 (y) − dK 0 (x) = k∇K 0 (C(s))kds 0
Therefore, there must exist a point p on the curve C between s = 0 and s = ρ such that: k∇K 0 (p)k ≤
dK 0 (y) − dK 0 (x) ρ
(9.3)
The curve C being parametrized by arc length, note that ||p − x|| ≤ ρ. Now Lemma 9.1 applied to x, y, and K reads: p dK (y) ≤ dK (x)2 + 2µdK (x)||x − y|| + ||x − y||2 Also, since ε = dH (K, K 0 ), we have that for all z ∈ Rd , |dK (z) − dK 0 (z)| ≤ ε. Hence:
112
CHAPTER 9. DISTANCE FUNCTIONS
dK 0 (y) − dK 0 (x) ≤
p dK (x)2 + 2µdK (x)||x − y|| + ||x − y||2
−dK (x) + 2ε s
≤ dK (x)[ 1 +
2µ||x − y|| ||x − y||2 − 1] + dK (x) dK (x)2
+ 2ε ≤ µ||x − y|| +
||x − y||2 + 2ε 2dK (x)
√ the last inequality coming from the fact that 1 + u ≤ 1 + u2 for u ≥ 0. Noticing that ||x − y|| ≤ ρ, dividing by ρ, and applying equation (9.3) shows that p satisfies the desired requirements. p Proof [of Theorem 9.4] The p bound of the previous lemma can be optimized by choosing ρ = 2 εdK (x). It then becomes equal to 2 ε/dK (x) + µ. The theorem follows immediately. Remark 9.1 Note that since dK 0 is increasing along the trajectories of ∇K 0 (see equation (9.2)), the µ0 critical point p for dK 0 of lemma 9.2 can be chosen such that dK 0 (p) ≥ dK 0 (x).
9.5
The critical function of a compact set
Despite its simplicity the critical point stability theorem 9.4 plays a fundamental role to get topological stability results. It allows to introduce a general framework for inferring the topology and the geometry of a large class of (non-smooth) compact sets. For that purpose, we first introduce a one variable real-valued function that encodes the “criticality” of the level sets of dK . Definition 9.6 The critical function of a compact set K ⊂ Rd , χK : (0, +∞) → R+ is defined by χK (r) =
inf
x∈d−1 K (r)
k∇K (x)k
An example of critical function is given on figure 9.8. Note that from the Isotopy Lemma 9.2 the zeros of the critical functions correspond to the changes in the topology of the offsets of K. As we will see later, the main interest of the critical function χK is to provide informations about the topological stability of some offsets of the compact sets contained in a neighborhood of K. In particular, whether a compact set K is a Hausdorff approximation of a “simple” compact set or not can be directly read from its critical function. Using the critical points stability theorem 9.4, we easily get the following stability result for the critical function.
9.5. THE CRITICAL FUNCTION OF A COMPACT SET
113
Figure 9.8: The critical function of a square embedded in R3 with edge length equal to 50 (top) and the critical function of a point cloud sampling this square (bottom). Theorem 9.5 (critical function stability theorem [20]) Let K and K 0 be two compact subsets of Rd such that dH (K, K 0 ) ≤ ε. For all r ≥ 0 , we have: r ε inf{χK 0 (u) | u ∈ I(r, ε)} ≤ χK (r) + 2 r √ where I(r, ε) = [r − ε, r + 2χK (r) εr + 3ε] This result shows that if the critical function of K 0 is not smaller than somepvalue α on the interval I(d, pε) then the critical function of K at the point d cannot be smaller than α − 2 dε . In particular, if α > 2 dε then d cannot be a critical value of dK . Since the topology of the offsets of K can only change at critical values, it is thus possible to locate intervals on which the topology of the offsets of K does not change. The figures 9.8 and 9.9 illustrate this property. From an algorithmic point of view, it is not difficult to see that when K is a finite point cloud, the critical function of K can be easily computed from the Vorono¨ı diagram of K.
114
CHAPTER 9. DISTANCE FUNCTIONS
3 Proof Let r ≥ 0 and let x ∈ d−1 K (r) be such that k∇ p εK (x)k = χK (r) . The critical point stability theorem √ 9.4 implies that there exists a point p which is (2 r + χK (r))-critical for dK 0 at distance at most 2 εr from x. Applying the lemma 9.1 to x, p and K we get q √ dK (p) ≤ r2 + 4χK (r)d εr + 4εr q p ≤ r 1 + 4χK (r) ε/r + 4ε/r √ ≤ r + 2χK (r) εr + 2ε
Now, according to Remark 9.1, p can be chosen such that dK 0 (p) ≥ dK 0 (x). Using that |dK 0 (p) − dK (p)| ≤ ε, the theorem follows from the above inequality.
9.6
Sampling conditions and µ-reach
The theorem 9.3 allows to give a first topological stability result for the offsets of compact sets when their Hausdorff distance is a fraction of their weak feature sizes. To get stronger results, in this section we introduce the notion of µ-reach that can be seen as a parametrized version of the weak feature size. Definition 9.7 For 0 < µ ≤ 1, the µ-reach rµ (K) of a compact set K ⊂ Rd is defined by rµ (K) = inf{r > 0 : χK (r) < µ} By analogy with the wfs, the µ-reach is the infimum of the µ-critical values of dK . When µ = 1, rµ (K) is known as the reach and has been introduced by H. Federer [50] in Geometric Measure Theory. The function µ → rµ (K) is non increasing and we have lim rµ (K) ≤ wfs(K)
µ→O+
Note that the above inequality can be strict (exercise 9.10). It follows from the the critical point stability theorem 9.4 that the positiveness of the µ-reach of a compact set K 0 implies some constraints on the location of the critical points of any close enough approximation K of K 0 . More precisely we have the following result which proof is left to the reader (see also [21]). Theorem 9.6 (critical values separation theorem) Let K and K 0 be two compact subsets of Rd , ε be the Hausdorff distance between K and K 0 , and µ be a non-negative number. The distance function dK has 3 Note that the existence of such a point x comes from the fact that the infimum involved in the definition of χK is indeed a minimum. This follows from the lower semi-continuity of k∇K k and the compactness of d−1 K (r).
9.6. SAMPLING CONDITIONS AND µ-REACH
115
Figure 9.9: A 4000 points set (left) sampled around a torus shape in R3 (which is not a torus of revolution) and its critical function (the upper curve). The lowest curve represents the lower bound for the critical function of any shape K at distance less than some fixed threshold (here 0.001, the diameter of the torus being 10) from the point cloud. We distinguish three intervals with stable topology for K: the first one corresponds to offsets having the topology of a torus (bottom left), the second one corresponds to solid torus with a hole homeomorphic to a ball inside (bottom middle - not visible from outside) and the third one is unbounded and correspond to offsets that have the topology of a ball (bottom right). no critical values in the interval ]4ε/µ2 , rµ (K 0 ) − 3ε[. Besides, for any µ0 < µ, χK is larger than µ0 on the interval q 4ε 0 ] , r (K ) − 3 εrµ (K 0 )[ µ (µ − µ0 )2 Note that taking µ too small does not give any information on the critical values, since the lower bound then exceeds the upper bound. It is also possible to buid examples showing that the bounds of the interval in the above theorem are tight (see [21]). The notion of µ-reach allows to introduce the following sampling condition. Definition 9.8 Given two positive real numbers κ and µ, one says that a compact set K ⊂ Rd is a (κ, µ)-
116
CHAPTER 9. DISTANCE FUNCTIONS
approximation of a compact K 0 ⊂ Rd if dH (K, K 0 ) ≤ κrµ (K 0 ) The (κ, µ)-approximations generalize some sampling conditions introduced in the setting of surface reconstruction in R3 . For example, when K 0 is a smooth compact surface in R3 and K ⊂ R3 is a point cloud, the notion of (κ, 1)-approximation is closely related to the r-samples introduced in [63].
9.7
Reconstruction
With the notion of (κ, µ)-approximations and the stability properties of critical points of distance functions proved in the previous section, we are now able to get easily offsets reconstruction results from approximations. Theorem 9.7 (Isotopic Reconstruction Theorem) Let K 0 ⊂ Rd be a compact set such that rµ (K 0 ) > 0 for some µ > 0. Let K be a (κ, µ)-approximation of K 0 where ! √ 5 µ2 κ < min − 1, 2 16 + 2µ2 and let r, r0 be such that 0 < r0 < wfs(K 0 ) and
4κrµ ≤ r < rµ (K 0 ) − 3κrµ µ2 0
0r and d−1 (r 0 ) respectively. Then the offset K r and level set hypersurface d−1 K (r) are isotopic to K K0
Indeed the proof of the isotopy between the offsets is beyond the scope of these notes (but it can be found in [27]). We prove here the following weaker version. Theorem 9.8 Let K ⊂ Rd be a (κ, µ)-approximation of of a compact set K 0 ⊂ Rd . If κ
0, ky − xk ≤ α ⇒ ΓK (y) ⊂ {z : d(z, ΓK (x)) ≤ r} Exercise 9.5 Show that for any x ∈ Rd , θK (x) is the closest point to x on the convex hull of ΓK (x). Exercise 9.6 Prove that for any x ∈ Rd one has the following equivalence: (x is a critical point of dK ) ⇔ (x is in the convex hull of ΓK (x)) Exercise 9.7 Let K be a finite set of points in R2 (one may assume that the points are in general position). Prove that a point x ∈ R2 is a critical point of dK isf and only if it satisfies one of the following conditions: - x ∈ K, - x is an intersection point between a Vorono¨ı edge and its dual Delaunay edge, - x is a Vorono¨ı vertex contained in its dual Delaunay triangle. How does this result generelize for finite point clouds in higher dimensions. Exercise 9.8 Let K = {p1 , · · · pn } ⊂ Rd be a finite point set. Prove that wfs(K) =
1 2
mini6=j kpi − pj k.
Exercise 9.9 Show that for any compact set K ⊂ Rd and any α ≥ 0, χK α (r) = χK (r + α) for all r ≥ 0 (hint: first prove the same kind of relation between dK α and dK ). Exercise 9.10 Give an example of a compact set (e.g. a compact subset of R2 ) K such that limµ→O+ rµ (K) 6= wfs(K).
4 Recall that dH is a distance if and only if it has the three following properties: (i) dH (K, K 0 ) = 0 if and only if K = K 0 ; (ii) dH (K, K 0 ) = dH (K 0 , K); (iii) dH (K, K 00 ) ≤ dH (K, K 0 ) + dH (K 0 , K 00 ).
Chapter 10
Topological persistence 10.1
Filtrations of complexes and simplicial homology
Recall that a simplicial complex K is a finite union of simplices such that any face of any simplex of K is a simplex of K and the intersection of any two simplices of K is either empty or a common face of both.
Definition 10.1 A filtration of a (finite) simplicial complex K is a sequence of sub-complexes defined by (i)
∅ = K0 ⊂ K1 ⊂ · · · ⊂ Km = K
(ii) K i+1 = K i ∪ σ i+1 where σ i+1 is a simplex of K Equivalently, a filtration of K can be seen as an ordering of the simplices such that for any i ≥ 0, the union of the first i simplices is a simplicial complex. To ensure this later condition, it is sufficient to know that every simplex σ i appears in the filtration after all its faces.
Lemma 10.1 ∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K with K i+1 = K i ∪ σ i+1 for all i = 0, · · · m − 1 is a filtration of K if and only if for any i = 0, · · · m − 1, all the faces of σ i+1 are contained in K i . Topological persistence provides an efficient tool to study the evolution of the topology of the subcomplexes various different families of filtrations arising in practice. 119
120
CHAPTER 10. TOPOLOGICAL PERSISTENCE
10.1.1
Alpha-complexes
10.1.2
Rips complexes
10.1.3
Witness complexes
10.1.4
Filtration associated to a function defined on the vertices of a complex
Let K be a simplicial complex and let f a real valued function defined on the vertices of K. For any simplex σ = [v0 , · · · vk ] one defines f (σ) by f (σ) = max f (vi ) i=0···k
Ordering the simplices of K according to the values of each simplex defines a filtration of K. Note that different simplices can have the same value. In this case, they are ordered accoording to increasing dimension and simplices of the same dimension with same value can be ordered randomly. The filtration induced by f is the filtration by the sublevel sets f −1 (] − ∞; t]) of f .
10.2
Homology and Betti numbers
In this section we introduce the basic notion of simplicial homology that are necessary to define and study topological persistence. In particular we restrict to the homology with coefficients in Z/2Z. For a more complete introduction the reader may refer to [66, 58]. In the sequel of this section, K denotes a finite d-dimensional simplicial complex.
10.2.1
The space of k-chains
For any non negative integer k, the space of k-chains is the vector space of all the formal sums (with coefficient in Z/2Z) of k-dimensional simplices of K. More precisely, if {σ1 , · · · , σp } is the set of k-simplices of K any k-chain c can be uniquely written c=
p X i=1
εi σi with εi ∈ Z/2Z = {0, 1}
The sum of two k-chains and the product of a chain by a scalar are defined by c + c0 =
p p X X (εi + ε0i )σi and λ.c = (λε0i )σi i=1
i=1
121
10.2. HOMOLOGY AND BETTI NUMBERS where the sums εi + ε0i and the products λεi are modulo 2.
Definition 10.2 The space of k-chains is set Ck (K) of the simplicial k-chains of K with the above defined operations. This is a Z/2Z-vector space. Notice that the set of k-simplices of K is a basis of Ck (K). For example, for the simplicial complex K of figure 10.1, C1 (K) is the Z/2Z-vector space generated by the edges e1 = ab, e2 = bc, e3 = ca, e4 = cd, i.e. C1 (K) = {0, e1 , e2 , e3 , e4 , e1 + e2 , e1 + e3 , e1 + e4 , e2 + e3 , e2 + e4 , e3 + e4 , e1 + e2 + e3 , · · · }
Summing e1 + e2 with e2 + e3 + e4 gives e1 + e3 + e4 (note that 0 denotes the empty simplex).
a d
c
b
Figure 10.1: A very simple simplicial complex made of 4 vertices, 4 edges and 1 triangle. chains with coefficient in Z/2Z have an obvious geometric interpretation: since any k-chain can be uniquely written as c = σi1 + σi2 + · · · σim where the σij are k-simplices, c can be considered as the union of the simplices σij . It is then easy to see that the sum of two k-chains is equal to their symetric difference 1 (exercise).
10.2.2
The boundary operator and homology groups
Definition 10.3 The boundary ∂(σ) of a k-simplex σ is the sum of its (k − 1)-faces. This is a (k − 1)-chain. If σ = [v0 , · · · , vk ] is the k-simplex generated by the (k + 1)-vertices v0 , · · · , vk , then ∂(σ) =
k X i=0
[v0 · · · vˆi · · · vk ]
where [v0 · · · vˆi · · · vk ] is the (k − 1)-simplex generated by the sets of all the vertices of σ except vi . The boundary operator, defined on the simplices of k, extends linearly to Ck (K). 1
The symetric difference of two sets A and B is defined by A∆B = (A ∪ B) \ (A ∩ B).
122
CHAPTER 10. TOPOLOGICAL PERSISTENCE
Definition 10.4 The boundary operator is the linear map defined by ∂ : Ck (K) → Ck−1 (K) P c → ∂c = σ∈c ∂(σ) Notice that one should denote ∂k the above defined operator but to avoid heavy notations one usually omit the index notations. Proposition 10.1 ∂∂ := ∂ ◦ ∂ = 0 Proof Since the boundary operator is linear, it is sufficient to check the property for a simplex. Let σ = [v0 · · · vk ] be a k-simplex. ! k X ∂∂σ = ∂ [v0 · · · vˆi · · · vk ] i=0
=
k X i=0
=
∂[v0 · · · vˆi · · · vk ]
X X [v0 · · · vˆj · · · vˆi · · · vk ] + [v0 · · · vˆi · · · vˆj · · · vk ] ji
= 0 The boundary operators define a sequence of linear maps between spaces of chains. Definition 10.5 The chain complex associated to a complex K of dimension d is the following sequence of linear operators ∂
∂
∂
∂
∂
∂
∅ → Cd (K) → Cd−1 (K) → · · · Ck+1 (K) → Ck (K) → · · · C1 (K) → C0 (K) → ∅ For k ∈ {0, · · · , d}, the set Zk (K) of k-cycles of K is the kernel of ∂ : Ck → Ck−1 : Zk (K) := ker(∂ : Ck → Ck−1 ) = {c ∈ Ck : ∂c = ∅} The image Bk (K) of ∂ : Ck+1 → Ck is the set of k-cycles bounding a (k + 1)-chain: Bk (K) := im(∂ : Ck+1 → Ck ) = {c ∈ Ck : ∃c0 ∈ Ck+1 , c = ∂c0 }
10.3. SINGULAR HOMOLOGY AND TOPOLOGICAL INVARIANCE OF BETTI NUMBERS
123
Bk and Zk are subspaces of Ck and according to Proposition 10.1, one has Bk (K) ⊂ Zk (K) ⊂ Ck (K) Definition 10.6 The k th homology group of K is the quotient vector space Hk (K) = Zk /Bk Hk (K) is a vector space and its elements are the homology classes of K. The dimension βk (K) of Hk (K) is the k th Betti number of K. The homology class of cycle c ∈ Zk (K) is the set c + Bk (K) = {c + b : b ∈ Bk (K)}. Two cycles c, c0 that are in the same homology class are said to be homologous; in this case there exists a bounding cycle b ∈ Bk (K) such that c0 = c + b, i.e. c0 − c = c0 + c = b.
10.3
Singular homology and topological invariance of Betti numbers
The homology groups and Betti numbers are topological invariants: if K and K 0 are two simplicial complexes with homeomorphic supports then their homology groups are isomorphic and their Betti numbers are equal. This result is still true is the supports |K| and |K 0 | are just homotopy equivalent. The proof of this invariance property is a classical, but not obvious, result in algebraic topology. It is beyond the scope of this book and requires the notion of singular homology (see [66, 58] for details). Let just mention that if X is a topological space homeomorphic to the support of a simplicial complex K, then the singular homology groups of X are isomorphic to the simplicial homology groups of K. For example, if X is a surface and if K and K 0 are two triangulations of X then the homology groups Hk (K) and Hk (K 0 ) are isomorphic and they have the same Betti numbers that are the ones of X.
10.4
An algorithm to compute Betti numbers
Let K be a finite simplicial complex of diemnsion d and F = {∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K} a filtration of K such that for any i = 0, · · · m − 1, K i+1 = K i ∪ σ i+1 where σ i+1 is a simplex.
124
CHAPTER 10. TOPOLOGICAL PERSISTENCE
By considering the evolution of the Betti numbers of the filtration as we add the simplices σ i we get the following algorithm. Algorithm to compute Betti numbers Input: A filtration F of a d-dimensional simplicial complex K containing m simplices. Output: The Betti numbers β0 , β1 , · · · , βd of K. β0 = β1 = · · · = βd = 0; for i = 1 to m k = dim σ i − 1; if σ i is contained in a (k + 1)-cycle in K i then βk+1 = βk+1 + 1; else βk = βk − 1; end if; end for; output (β0 , β1 , · · · , βd ); To prove the correctness of the algorithm, one has to understand how the topologie of the filtration evolves each time we add a simplex. Let assume that the Betti numbers of K i−1 have been computed and let add the simplex σ i of dimension k + 1 to get K i . Remark that according to Lemma 10.1, σ i cannot be in the boundary of any (k + 2)-simplex of K i . As a consequence if σ i is contained in a (k + 1)-cycle in K i , this cycle is not the boundary of a (k + 2)-chain in K i . Let consider the two alternatives of the algorithm: Case 1: assume that σ i is contained in a (k + 1)-cycle c in K i . Then c cannot be homologous to any (k + 1)-cycle in K i−1 . Indeed, otherwise there would exist a cycle c0 in K i−1 such that c + c0 is the boundary of a (k +2)-chain d. But since σ i cannot be contained in c0 , it has to be contained in c+c0 = ∂d contradicting the above remark. So, c creates a new homology class which is linearly independent of the classes created by the cycles in K i−1 . As a consequence, βk+1 (K i ) ≥ βk+1 (K i−1 ) + 1. To conclude this first case, it is sufficient to remark that adding the (k + 1)-simplex σ i to K i−1 cannot increase the dimension of the k th homology group by more than one: if c and c0 are two (k + 1)-cycles containing σ i , then c + c0 is a (k + 1)-cycle in K i−1 implying that c0 is contained in the linear sub-space spanned by Zk+1 (K i−1 ) and c. It follows that dim Zk+1 (K i ) ≤ dim Zk+1 (K i−1 ) + 1 and since Bk (K i−1 ) ⊂ Bk (K i ), βk+1 (K i ) ≤ βk+1 (K i−1 ) + 1.
10.5. TOPOLOGICAL PERSISTENCE
125
Case 2: assume that σ i is not contained in any (k+1)-cycle in K i . Then the k-cycle ∂σ i is not a boundary in K i−1 . Indeed, otherwise there would exist a chain c in K i−1 such that ∂c = ∂σ i or equivalently ∂(c+σ i ) = 0. Thus c + σ i is a (k + 1)-cycle in K i containing σ i : a contradiction. As a consequence, since the k-cycle ∂σ i which is not a boundary in K i−1 becomes a boundary in K i , one has βk (K i ) ≤ βk (K i−1 ) − 1. One proves as in Case 1 that this inequality is indeed an equality. The above discussion suggests a distinction between the simplices of the filtration of K that is going to play an important role in the definition of topological persistence. Definition 10.7 Let K be a d-dimensional simplicial complex and let F = {∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K}
be a filtration of K. A simplex σ i is called positive if it is contained in a (k + 1)-cycle in K i (which is necessarily not a boundary in K i according to the remark at the beginning of the proof of the correctness of the algorithm) and negative otherwise. With the above definition the k th Betti number of K is equal to the difference between the number of positive k-simplices (which are creating k-cycles) and the number of negative (k + 1)-simplices (which are “killing” k-cycles). As an example, if one considers the simplicial complex K of figure 10.1 with the filtration defined by the simplices ordering ∅, a, b, c, ab, bc, d, ac, cd, abc, then the positive simplices are a, b, c, d and ac. The Betti numbers of K are β0 = 1, β1 = 0 and β2 = 0. It is important to notice that the above algorithm require to be able to decide whether a simplex is positive or negative. This is not, a priori, an obvious question but an answer will be given in the next section. It is also important to notice that the algorithm not only compute the Betti numbers of K but also the Betti numbers of all the subcomplexes K i of the filtration. The goal of topological persistence is to keep track of all this information by pairing the the time when a cycle is created with the time when it is destroyed.
10.5
Topological persistence
Topological persistence has been independently introduced by different authors [45, 51, 71].
10.5.1
A simple example
Before formally indroducing topological persistence, let consider a very simple example. Consider the function f : [0, 1] → R which graph is represented on Figure 10.2. We are interested in studying the evolution
126
CHAPTER 10. TOPOLOGICAL PERSISTENCE
of the topology of the sublevel sets {f ≤ t} as t increases. The topology of the sublevel sets changes when t crosses the critical values a, b, c, d and e. Crossing the critical value a creates a connected component and for a ≤ t < b, {f ≤ t} is a connected set (an interval). When t passes through the critical value b a second connected component appears and for b ≤ t < c, {f ≤ t} has two connected components. When t reaches the value c, the two connected components are merged: the “most recently” created component (when t passed through b) is merged into the older one. One then pairs the two values b and c corresponding to the “birth” and “death” of the component. In the topological persistence framework, this pairing is either represented by the interval on the left of the graph of f on Figure 10.2 or by the point with coordinates (b, c) in the plane on the right of Figure 10.2. The length c − b of the interval (b, c) represents the lifespan of the component created at b. Intuitively, the larger is the interval, the more relevant is the corresponding component. Now, continuying to increase t, a new connected component is created when one reaches d which is merged at t = e giving rise to a new persitence interval (d, e). Notice that a is not paired to any (finite) value since the first created component is never merged into another one. As a consequence it is paired with +∞ and rpresented by the interval (a, +∞). At the end of the sweep of the t values, the pairs are either represented as a set of intervals (called a barcode) or as a diagram in the plane (called the persistence diagram - see Figure 10.2 on the right). For technical reasons that will be explained in the following of the section the diagonal {y = x} is added to the diagram.
e
e
d
c
c b a
a
b
d
Figure 10.2: The persitence diagram of a real valued function. When one considers functions f defined over higher dimensional spaces, passing through critical values may not only change the connectedness of the sublevel sets but also other topological features: creation/destruction of cycles, voids, etc... All these “events” corresponds to a change in the corresponding homology groups (H1 for cycles, H2 for voids,...). In the sequel of this section we show that, as for the above example with connectedness changes, we can define pairs and persistence diagrams for each dimension.
127
10.5. TOPOLOGICAL PERSISTENCE
Now, replacing the function f by the function g on the figure 10.3 which is “close” to f , we see that the number of pairs of g is much larger than the one of f . However most of these pairs correspond to short length intervals (points close to the diagonal) while the pairs corresponding to long interval are close to the ones of f (see figure 10.3). In other words, the topological features having a large persistence with respect to the size of the perturbation are preserved while the topological features created by the perturbation have a small persistence. We will see that this is a general phenomenon: two close functions have close persitence diagrams. The stability of persistence diagrams initially proven in [33] and generalized and extended in [19] is the most fundamental property of topological persistence.
e
c
b
d
Figure 10.3: An approximation g of f and its persistence diagram
10.5.2
Topological persistence for a filtration
We first define the notion of persistence for a filtration of a simplicial complex. Its goal is to study the evolution of the homology of the subcomplexes of the filtration. Let K be a d-dimensional simplicial complex and let F = {∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K} be a filtration of K such that for any i = 0, · · · , m − 1, K i+1 = K i ∪ σ i+1 where σ i+1 is a simplex. For any 0 ≤ n ≤ m, we denote by Ckn the set of k-chains (with coefficients in Z/2Z) of K n . Notice that n−1 n−1 ∂ : Ckn → Ck−1 , the restriction of the boundary operator to Ckn has its image contained in Ck−1 . We denote n n n by Zk and Bk the sets of k-cycles and k-boundaries of K respectively. The k-th homology group of K n is thus Hkn = Zkn /Bkn
128
CHAPTER 10. TOPOLOGICAL PERSISTENCE
With these notations, we have the following inclusions Zk0 ⊂ Zk1 ⊂ · · · ⊂ Zkn · · · ⊂ Zkm = Zk (K)
Bk0 ⊂ Bk1 ⊂ · · · ⊂ Bkn · · · ⊂ Bkm = Bk (K) Definition 10.8 For p ∈ {0, · · · , m} et l ∈ {0, · · · , m − p}, the k-th persistent Betti number of K l is the dimension of the vector space Hkl,p = Zkl /(Bkl+p ∩ Zkl ). The k-th persistent Betti number of K l represents the number of independant homology classes of k-cycles in K l that are not boundaries in K l+p . Intuitively, a k-cycle in K l generating a non zero element in Hkl,p is a cycle that has appeared in the filtration before the step l +1 and that is still not a boundary at step l +p. We have seen in section 10.4 that a homology class is created when a positive simplex is added in the filtration and that a homology class is “destroyed” when a negative simplex is added. Topological persistence provides a natural way to pair positive and negative simplices such that whenever a positive simplex is added to the filtration it creates a homology class and a corresponding cycle that becomes a boundary when its paired negative simplex is added. Cycle associated to a positive simplex Lemma 10.2 Let σ = σ i be a positive k-simplex in the filtration F of K. There exists a k-cycle c which is not a boundary in K i , which contains σ and which does not contain any other positive k-simplex. Proof The lemma is proven by induction on the order of the positive k-simplices in the filtration. Assume that for any positive k-simplex added to the filtration before σ there exists a non bounding k-cycle that contains this simplex and no other positive k-simplex. Since σ is positive, there exists a non bounding k-cycle d in K i containing σ. Let σij , j = 1, · · · , p be the positive k-simplices different from σ contained in d and let cj be the non bounding cycles containing them and not containing any other positive simplices. Then c = d + c1 + · · · + cp
is a k-cycle whose σ is the only positive simplex. Since σ = σ i is the last simplex added in K i there does not exist any (k + 1)-simplex in K i containing σ in its boundary. As a consequence c cannot be a bounding cycle.
Persistent homology basis and persistent pairs The k-cycles associated to the positive k-simplices in Lemma 10.2 allow to maintain a basis of the kdimensional homology groups of the subcomplexes of the filtration. At the beginning, the basis of Hk (K 0 )
129
10.5. TOPOLOGICAL PERSISTENCE
is empty. Bases of the Hk (K i ) are built inductively in the following way. Assume that “the” basis of Hki−1 has been built and that the i-th simplex σ i is positive (and of dimension k). We add to the basis of Hki−1 the homology class of the cycle ci associated to σ i to obtain a basis of Hki . Indeed since ci is the sum of σ i and negative simplices it is not homologous to any linear combination of cycles defining the basis of Hki−1 . Since dim Hki = dim Hki−1 + 1 we thus obtain a basis of Hki . Now assume that the basis of Hkj−1 is built and the j-th simplex σ j is negative (and of dimension k + 1). Let ci1 , · · · , cip be the cycles assocated to the positive simplices σ i1 , · · · σ ip whose homology classes form a basis of Hkj−1 . The boundary d = ∂σ j de σ j is a k-cycle in K j−1 which is non bounding in K j−1 but is a boundary in K j (see the proof of the algorithm to compute Betti numbers in the previous section). So it can be written in a unique way as p X j d = ∂σ = εk cik + b k=1
where εk ∈ {0, 1} and b is a boundary. We then denote l(j) = max{ik : εk = 1} and we remove the homology class of cl(j) from the basis of Hkj−1 to obtain a basis of Hkj . Claim: We obtain a basis of Hkj . Since dim Hkj−1 = dim Hkj + 1 we just need to prove that cl (j) is, up to a boundary, a linear combination of the cycles ci , i 6= l(j) in Zkj which is equivalent to the above decomposition of d. Definition 10.9 The simplices σ l(j) and σ j are paired in a persistent pair (σ l(j) , σ j ). Intuitively, the homology class created by σ l(j) in K l(j) is destroyed by σ j in K j . The persistence of this pair is j − l(j) − 1. From the above discussion we deduce a first algorithm to compute the persistent pairs of a filtration F of a simplicial complex K of dimension d with m simplices. Algorithm to compute persistent pairs L0 = L1 = · · · = Ld−1 = ∅ for j = 0 to m k = dim σ j − 1; if σ j is negative l(j) = the largest index of the positive k-simplices associated to ∂σ j ; Lk = Lk ∪ {(σ l(j) , σ j )};
130
CHAPTER 10. TOPOLOGICAL PERSISTENCE end if; fin pour; renvoyer L0 , L1 , · · · , Ld−1 ;
Notice that, as for the algorithm to compute the Betti numbers, the main issue with this algorithm is to determine l(j). We overcome it by considering a “matrix” version of the above algorithm. Persistence algorithm: the matrix version We now present a simple to implement version of the persistence algorithm. It relies on a simple reduction of the matrix of the boundary operator. Let K be a simplicial complex sof dimension d and F = {∅ = K 0 ⊂ K 1 ⊂ · · · ⊂ K m = K} be a filtration of K such that for any i = 0, · · · m − 1, K i+1 = K i ∪ σ i+1 where σ i+1 is a simplex. Let M = (mi,j )i,j=1,···m be the matrix with coefficient in Z/2Z of the boundary operator defined by: mi,j = 1 if σ i ≤ σ j
and
mi,j = 0 otherwise
So if σj is a (k + 1)-simplexe the j-th column of M represents the set of the k-dimensional faces of the boundary of σ j . Since F is a filtration the matrix M is upper triangular. For any column Cj of M , we denote by l(j) the index of the lowest line of M containing a non zero term in the column Cj : (i = l(j)) ⇔ (mi,j = 1 and mi0 ,j = 0 ∀i0 > i) Notice that l(j) is not defined when the column Cj does not contain any non zero term. We then have the following very simple algorithm to compute the persitent pairs. Peristence algorithm (matrix version) For j = 0 to m While there exists j 0 < j such that l(j 0 ) == l(j)
131
10.5. TOPOLOGICAL PERSISTENCE Cj = Cj + Cj 0 mod(2); End while; End for; Return the pairs (l(j), j);
Proposition 10.2 The previous algorithm computes the persitent pairs of the filtration F defined in the paragraph 10.5.2 Proof The result follows from a sequence of elementary remarks. Rem 1 : At each step of the algorithm, the column Cj represents a chain of the following form X ∂ σ j + εi σ i with εi ∈ {0, 1} i n we immediately deduce n 12 that the cost of this transport plan is upper bounded by ( N ) (R + diam(C)). As a consequence, replacing a small amount of points (n m}. δµ,m : x ∈ Rd 7→ inf{r > 0 ; µ(B(x, Notice that for m = 0, the definition would coincide with the (usual) distance function to the support of the measure µ. Moreover for any m ∈ [0, 1), δµ,m is 1-Lipschitz (see Exercise 11.2). But unfortunately δµ,m is not robust with respect to perturbations of the measure µ, i.e. the map µ → δµ,m is not continuous as illustrated in the following example. Let µε = ( 21 − ε)δ0 + ( 12 + ε)δ1 be the weighted sum of two Dirac measures at 0 and 1 in R and let m = 1/2. Then, for ε > 0 one has δµε ,1/2 (t) = |1 − t| for t < 0 while if ε = 0, one obtains δµ0 ,1/2 (t) = |t| which means that ε 7→ δµε ,1/2 is discontinuous at ε = 0.
11.3. DISTANCE FUNCTION TO A PROBABILITY MEASURE
143
In order to gain both Wasserstein-stability and regularity, we define the distance function to µ as a L2 average of the the pseudo-distances δµ,m for a range [0, m0 ] of parameters m: Definition 11.4 Let µ be a (positive) measure on the Euclidean space, and m0 be a positive mass parameter m0 > 0 smaller than the total mass of µ. We call distance function to µ with parameter m0 the function defined by : Z m0 1 2 n + δµ,m (x)2 dm dµ,m0 : R → R , x 7→ m0 0 As an example, let C be a point cloud with N points in Rd , and µC be the uniform measure on it. The pseudo-distance function δµC ,m evaluated at a point x ∈ Rd is by definition equal to the distance between x and its kth nearest neighbor in C, where k is the smallest integer larger than m |C|. Hence, the function m 7→ δµC ,m is constant on all ranges ( Nk , k+1 N ]. Using this one obtains the following formula for the squared 2 distance dµ,m0 , where m0 = k0 / |C|:
d2µ,m0 (x) =
1 m0
1 = k0
m0
Z
k0 1 X 1 δ (x)2 m0 N µ,k/N
δµ,m (x)2 =
0
k=1
2
X k p∈NNC0 (x)
kp − xk
where NNkC0 (x) denote the k0 nearest neighbors of x in C. In this case, the pointwise evaluation of d2µC ,k/n (x) reduces to a k-nearest neighbor query in C.
11.3.2
Equivalent formulation
In this paragraph, we prove that the distance function to a measure dµ,m0 is in fact a real distance to a compact set, but in an infinite-dimensional space (see figure 11.3). From this fact, we will deduce all of the properties needed for geometric and topological inference. A measure ν will be called a submeasure of another measure µ if for every Borel subset B of Rd , ν(B) ≤ µ(B). This is the same as requiring that µ−ν is a measure. The set of all submeasures of a given measure is denoted by Sub(µ), while the set of submeasures of µ with a prescribed total mass m0 is denoted by Subm0 (µ). Proposition 11.1 For any measure µ on Rd , the distance function to µ at x is the solution of the following optimal transportation problem: −1/2
dµ,m0 (x) = min {m0
W2 (m0 δx , ν) ; ν ∈ Subm0 (µ)}
(11.1)
144
CHAPTER 11. DISTANCE TO MEASURES
space of proba measures
Rd δx µ ˜x,m0
x Dirac measures
{
1 µ ˜:µ ˜(Rd ) = m0 and µ ˜ ≤ µ} m0
Figure 11.3: The distance function to a measure as a usual distance function in an infinite dimensional space. Then, for any measure µx,m0 that realizes the above minimum one has: dµ,m0 (x) =
1 1/2
m0
Z Rd
!1/2 2
kx − hk dµx,m0 (h)
Said otherwise, the distance dµ,m0 evaluated at a point x ∈ Rd is the minimal Wasserstein distance between the Dirac mass m0 δx and the set of submeasures of µ with total mass m0 : 1 dµ,m0 (x) = √ distW2 (m0 δx , Subm0 (µ)) m0
(11.2)
The set of minimizers in the above expression corresponds to the “orthogonal” projections, or nearest neighbors, of the Dirac mass m0 δx on the set of submeasures Subm0 (µ). As we will see in the proof of the
145
11.3. DISTANCE FUNCTION TO A PROBABILITY MEASURE
proposition, these are submeasures µx,m0 of total mass m0 whose support is contained in the closed ball ¯ δµ,m (x)), and whose restriction to the open ball B(x, δµ,m (x)) coincides with µ. Denote these measures B(x, by Rµ,m0 (x). In order to prove Proposition 11.1, we need a few definitions from probability theory. The cumulative function Fν : R+ → R of a measure ν on R+ is the non-decreasing function defined by Fν (t) = ν([0, t)). Its generalized inverse, denoted by Fν−1 and defined by Fν−1 : m 7→ inf{t ∈ R ; Fν (t) > m} is left-continuous. Notice that if µ, ν are two measures on R+ , then ν is a submeasure of µ if and only if Fν (t) ≤ Fµ (t) for all t > 0. Proof Let first remark that if ν is any measure of total mass m0 , there is only one transport plan between ν and the Dirac mass m0 δx , which maps any point of Rd to x. Hence, the Wasserstein distance between ν and δx is given by Z W22 (m0 δx , ν) =
Rd
kh − xk2 dν(h)
Let dx : Rd → R denote the distance function to the point x, and let νx be the pushforward of ν by the distance function to x, i.e. for any subset I of R, νx (I) = ν(d−1 x (I)). Using the change-of-variable formula, and the definition of the cumulative function gives us: Z Z Z m0 2 2 kh − xk dν(h) = t dνx (t) = Fν−1 (m)2 dm x Rd
R+
0
If ν is a submeasure of µ, then by the remark above, Fνx (t) ≤ Fµx (t) for all t > 0. From this, one deduces that Fν−1 (m) ≥ Fµ−1 (m). This gives x x W22 (m0 δx , ν) =
Z Rd
kh − xk2 dν(h) ≥
Z
m0
Z0 m0
=
Fµ−1 (m)2 dm x (11.3) 2
δµ,m (x) dm = 0
m0 d2µ,m0 (x)
The second inequality is because Fµx (t) = µ(B(x, t)), and thus Fµ−1 (m) = δµ,m (x). This proves that dµ,m0 (x) x is smaller than the right-hand side of (11.1). To conclude the proof, we study the cases of equality in (11.3). Such a case happens when for almost every m ≤ m0 , Fν−1 (m) = Fµ−1 (m). Since these functions are increasing and left-continuous, equality must in fact x x ¯ δµ,m (x))) = m0 , i.e. hold for every such m. By the definition of the pushforward, this implies that ν(B(x, 0 ¯ δµ,m (x)) and µ all the mass of ν is contained in the closed ball B(x, ˜(B(x, δµ,m0 (x))) = µ(B(x, δµ,m0 (x))). 0 Because ν is a submeasure of µ, this can be true if and only iff ν belongs in the set Rµ,m0 (x) described before the proof. To finish the proof, we should remark that the set of minimizer Rµ,m0 (x) always contain a measure µx,m0 . The only difficulty is when the boundary of the ball carries too much mass. In this case, we uniformly rescale
146
CHAPTER 11. DISTANCE TO MEASURES
the mass contained in the bounding sphere so that the measure µx,m0 has total mass m0 . More precisely, we let: µ|∂B(x,δµ,m (x)) 0 µx,m0 = µ|B(x,δµ,m (x)) + (m0 − µ(B(x, δµ,m0 (x))) 0 µ(∂B(x, δµ,m0 (x)))
11.3.3
Stability of the distance function to a measure
The goal of this section is to prove that the notion of distance function to a measure that we defined earlier is stable under change of the measure. This follows rather easily from the characterization of dµ,m0 given by Proposition 11.1. Proposition 11.2 Let µ and µ0 be two probability measures on Rd . Then, dH (Subm0 (µ), Subm0 (µ0 )) ≤ W2 (µ, µ0 )
0 Proof Let ε be the Wasserstein distance of order 2 between µ and R µ , and π be2 a corresponding2 optimal 0 transport plan, i.e. a transport plan between µ and µ such that Rd ×Rd kx − yk π(x, y)dxdy = ε . Then, given a submeasure ν of µ, one can find a submeasure π 0 of π that transports ν to a submeasure ν 0 of µ0 . Then, Z
W2 (ν, ν 0 )2 ≤
Rd ×Rd
kx − yk2 π 0 (x, y)dxdy ≤ ε2
This shows that dist(ν, Subm0 (µ0 )) ≤ ε for every submeasure ν ∈ Subm0 (µ). The same hold by exchanging the roles of µ and µ0 , thus proving the bound on the Hausdorff distance. Theorem 11.1 stability)) If µ and µ0 are two probability measures on Rd and
((Distance function 1
m0 > 0, then dµ,m0 − dµ0 ,m0 ∞ ≤ √m0 W2 (µ, µ0 ). Proof The following sequence of equalities and inequalities, that follows from Propositions 11.1 and 11.2, proves the theorem:. 1 dµ,m0 (x) = √ distW2 (m0 δx , Subm0 (µ)) m0 1 ≤ √ (dH (Subm0 (µ), Subm0 (µ0 )) + distW2 (m0 δx , Subm0 (µ0 ))) m0 1 ≤√ W2 (µ, µ0 ) + dµ0 ,m0 (x) m0
147
11.3. DISTANCE FUNCTION TO A PROBABILITY MEASURE
11.3.4
The distance to a measure is distance-like.
The subdifferential of a function f : Ω ⊆ Rd → R at a point x, is the set of vectors v of Rd , denoted by ∂x f , such that for all small enough vector h, f (x + h) ≥ f (x) + hh|vi. This gives a characterization of convexity: a function f : Rd → R is convex if and only if its subdifferential ∂x f is non-empty for every point x. If this is the case, then f admits a derivative at a point x if and only if the subdifferential ∂x f is a singleton, in which case the gradient ∇x f coincides with its unique element. Proposition 11.3 The function vµ,m0 : x ∈ Rd 7→ kxk2 − d2µ,m0 is convex, and its subdifferential at a point x ∈ Rd is given by ∂x vµ,m0 =
2 2x − m0
Z h∈Rd
(x − h) dµx,m0 (h) ; µ ˜x,m0
∈ Rµ,m0 (x)
Proof For any two points x and y of Rd , let µx,m0 and µy,m0 be in Rµ,m0 (x) and Rµ,m0 (y) respectively. Thanks to Proposition 11.1 we have the following sequence of equalities and inequalities: d2µ,m0 (y)
Z 1 ky − hk2 dµy,m0 (h) = m0 h∈Rd Z 1 ≤ ky − hk2 dµx,m0 (h) m0 h∈Rd Z 1 kx − hk2 + 2hx − h|y − xi + ky − xk2 dµx,m0 (h) ≤ m0 h∈Rd ≤ d2µ,m0 (x) + ky − xk2 + hv|y − xi
where v is the vector defined by v=
2 m0
Z h∈Rd
[x − h] dµx,m0 (h).
The inequality can be rewritten as: (kyk2 − d2µ,m0 (y)) − (kxk2 − d2µ,m0 (x)) ≥ h2x − v|y − xi which shows that the vector (2x − v) belongs to the subdifferential of v at x. By the characterization of convex functions by that we recalled above, one deduces that vµ,m0 is convex.
148
CHAPTER 11. DISTANCE TO MEASURES
We now turn to the proof of the converse inclusion. This proof is slightly more technical, but not really needed for the remaining of the article. First, let Z 2 (x − h) dµx,m0 (h) ; µx,m0 ∈ Rµ,m0 (x) . Dµ,m0 (x) := 2x − m0 h∈Rd The sets Dµ,m0 and ∂x vµ,m0 are both convex, and we have shown that Dµ,m0 is contained in ∂x vµ,m0 . By Theorem 2.5.1 in [?], the subdifferential ∂x vµ,m0 can be obtained as the convex hull of the set of limits of gradients ∇xn vµ,m0 , where (xn ) is any sequence of points converging to x at which vµ,m0 is differentiable. To sum up, we only need to prove that every such limit also belongs to the set Dµ,m0 (x). Let (xn ) be a sequence of points at which vµ,m0 is differentiable, and let µn be the unique element in Rµ,m0 (xn ). Necessarily, ∇xn vµ,m0 = 2xn − 2/m0
Z h
(xn − h)dµn (h)
where µn is in Rµ,m0 (xn ). Since every µn is a submeasure of µ, by compactness one can extract a subsequence of n such that µn weakly converges to a measure µ∞ . This measure belongs to Rµ,m0 (x), and hence the vector Z D = 2x − 2/m0
h
(x − h)dµ∞ (h)
is in the set Dµ,m0 (x). Moreover, the weak convergence of µn to µ∞ implies that the sequence ∇xn vµ,m0 converges to D. This concludes the proof of this inclusion. Corollary 11.1 The function d2µ,m0 is 1-semiconcave. Moreover, (i) d2µ,m0 is differentiable at a point x ∈ Rd if and only if the support of the restriction of µ to the sphere ∂B(x, δµ,m0 (x)) contains at most one point; (ii) d2µ,m0 is differentiable almost everywhere in Rd , with gradient defined by ∇x d2µ,m0 =
2 m0
Z h∈Rd
[x − h] dµx,m0 (h)
where µx,m0 is the only measure in Rµ,m0 (x). (iii) the function x ∈ Rd 7→ dµ,m0 (x) is 1-Lipschitz. Proof For (i), it is enough to remark that Rµ,m0 (x) is a singleton iff the support of µ|∂B(x,δµ,m (x)) is at 0 most a single point. (ii) This follows from the fact that a convex function is differentiable at almost every
11.4. APPLICATIONS TO GEOMETRIC INFERENCE
149
point, at which its gradient is the only element of the subdifferential at that point. (iii) The gradient of the distance function dµ,m0 can be written as: ∇x dµ,m0
R ∇x d2µ,m0 1 d [x − h] dµx,m0 (h) = =√ R h∈R 2dµ,m0 m0 ( h∈Rd kx − hk2 dµx,m0 (h))1/2
Using the Cauchy-Schwartz inequality we find the bound k∇x dµ,m0 k ≤ 1 which proves the statement.
11.4
Applications to geometric inference
Reconstruction from point clouds with outliers was the main motivation for introducing the distance function to a measure. In this section, we adapt the reconstruction theorem introduced by [20] to our setting. The original version of the theorem states that a regular enough compact set K can be faithfully reconstructed from another close enough compact set C. More precisely, for a suitable choice of r, the offsets C r and K η have the same homotopy type for any positive η. The regularity assumption on K is expressed as a lower bound on its so-called µ-reach, which is a generalization of the classical notion of reach [?]. In particular, smooth submanifolds, convex sets and polyhedra always have positive µ-reach for suitable µ, hence the reconstruction theorem may be applied to such sets. In these section, we show that the reconstruction results of [20] can be easily generalized to compare the sub-level sets of two uniformly-close distance-like functions. It is also possible to adapt most of the topological and geometric inference results of [22, 27, 23] in a similar way.
Figure 11.4: On the left, a point cloud sampled on a mechanical part to which 10% of outliers (uniformly sampled in a box enclosing the model) have been added. On the right, the reconstruction of an isosurface of the distance function dµC ,m0 to the uniform probability measure on this point cloud.
150
11.4.1
CHAPTER 11. DISTANCE TO MEASURES
Extending the sampling theory for compact sets
In this paragraph we extend the sampling theory of [20] for compact sets to distance-like functions. We don’t include all of the results of the paper, but only those that are needed to the reconstruction theorem (Th. 11.2). We refer the interested reader to the original paper for more details. Let φ : Rd → R be a distance-like function. The 1-semiconcavity of φ2 allows to define a notion of gradient vector field ∇x φ for φ, defined everywhere and satisfying k∇x φk ≤ 1. Although not continuous, the vector field ∇φ is sufficiently regular to be integrated in a continuous locally Lipschitz flow [?] Φt : Rd → Rd . The flow Φt integrates the gradient ∇φ in the sense that for every x ∈ Rd , the curve γ : t 7→ Φt (x) is d right-differentiable, and for every t > 0, dγ dε t− = ∇γ(t) φ . Moreover, for any integral curve γ : [a, b] → R parametrized by arc-length, one has: Z φ(γ(b)) = φ(γ(a)) + a
b
∇γ(t) φ dt.
Definition 11.5 Let φ be a distance like function. Following the notation for offset of compact sets, we will denote by φr = φ−1 ([0, r]) the r sublevel set of φ. 1. A point x ∈ Rd will be called α-critical (with α ∈ [0, 1]) if the inequality φ2 (x + h) ≤ φ2 (x) + 2α khk φ(x) + khk2 is true for all h ∈ Rd . A 0-critical point is simply called a critical point. It follows from the 1-semiconcavity of φ2 that k∇x φk is the infimum of the α ≥ 0 such that x is α-critical. 2. The weak feature size of φ at r is the minimum r0 > 0 such that φ doesn’t have any critical value between r and r + r0 . We denote it by wfsφ (r). For any 0 < α < 1, the α-reach of φ is the maximum r such that φ−1 ((0, r]) does not contain any α-critical point. Obviously, the α-reach is always a lower bound for the weak-feature size, with r = 0. The proof of the Reconstruction Theorem in [20] relies on two important observations. The first one is a consequence of a distance-like version of Grove’s isotopy lemma [57, Prop. 1.8], which asserts that the topology of the sublevel sets of φ can only change when one passes critical values. As in [26, Theorem 3], one deduces that the offsets of two uniformly close distance-like functions with large weak feature size have the same homotopy type: Proposition 11.4 (Isotopy lemma) Let φ be a distance-like function and r1 < r2 be two positive numbers such that φ has no critical points in the subset φ−1 ([r1 , r2 ]). Then all the sublevel sets φ−1 ([0, r]) are isotopic for r ∈ [r1 , r2 ].
11.4. APPLICATIONS TO GEOMETRIC INFERENCE
151
Proposition 11.5 Let φ and ψ be two distance-like functions, such that kφ − ψk∞ ≤ ε. Suppose moreover that wfsφ (r) > 2ε and wfsψ (r) > 2ε. Then, for every 0 < η ≤ 2ε, φr+η and ψ r+η have the same homotopy type. Proof See Appendix. The second key observation made in [20] is that the critical points of a distance function are stable in certain sense under small Hausdorff perturbations. This result remains true for uniform approximation by distance-like functions: Proposition 11.6 Let φ and ψ be two distance-like functions with any α-critical point p kφ − ψk∞ 0≤ ε. Forp 0 0 0 x of φ, there exists a α -critical point x of ψ with kx − x k ≤ 2 εφ(x) and α ≤ α + 2 ε/φ(x). Proof The proof is almost verbatim from [20], and postponed to the Appendix. Corollary 11.2 Let φ and ψ be two ε-close distance-like functions, and suppose that reachα (φ) ≥ R for some α > 0. Then, ψ has no critical value in the interval 4ε/α2 , R − 3ε . Proof See Appendix. Theorem 11.2 (Reconstruction) Let φ, ψ be two ε-close distance-like functions, with reachα (φ) ≥ R for some positive α. Then, for any r ∈ [4ε/α2 , R − 3ε], and for 0 < η < R, the sublevel sets ψ r and φη are homotopy equivalent, as soon as R ε≤ 5 + 4/α2 Proof By the isotopy lemma, all the sublevel sets ψ r have the same homotopy type, for r in the given range. Let us choose r = 4ε/α2 . We have: wfsφ (r) ≥ R − 4ε/α2 and wfsψ (r) ≥ R − 3ε − 4ε/α2 By Proposition 11.5, the sublevel sets φr and ψ r have the same homotopy type as soon as the uniform distance ε between φ and ψ is smaller than 21 wfsφ (r) and 12 wfsψ (r). This is true, provided that 2ε ≤ R − ε(3 + 4/α2 ). The theorem follows. Remark that in the above definition 11.5 the notion of α-reach could be made dependent on a parameter r, i.e. the (r, α)-reach of φ could be defined as the maximum r0 such that the set φ−1 ((r, r + r0 ]) does not contain any α-critical value. A reconstruction theorem similar to Theorem 11.2 would still hold under the weaker condition that the (r, α)-reach of φ is positive.
152
11.4.2
CHAPTER 11. DISTANCE TO MEASURES
Distance to a measure vs. distance to its support
In this paragraph, we compare the distance functions dµ,m0 to a measure µ and the distance function to its support S, and study the convergence properties as the mass parameter m0 converges to zero. A first obvious remark is that the pseudo-distance δµ,m0 (and hence the distance dµ,m0 ) is always larger than the regular distance function dS . As a consequence, to obtain a convergence result of dµ,m0 to dS as m0 goes to zero, it is necessary to upper bound dµ,m0 by dS + o(m0 ). It turns out that the convergence speed of dµ,m0 to dS depends on the way the mass of µ contained within any ball B(p, r) centered at a point p of the support decreases with r. Let us define: (i) We say that a non-decreasing positive function f : R+ → R+ is a uniform lower bound on the growth of µ if for every point p in the support of µ and every ε > 0, µ(B(p, ε)) ≥ f (ε) ; (ii) The measure µ has dimension at most k if there is a constant C(µ) such that f (ε) = C(µ)εk is a uniform lower bound on the growth of µ, for ε small enough. Lemma 11.1 Let µ be a probability measure and f be a uniform lower bound on the growth of µ. Then kdµ,m0 − dS k∞ < ε as soon as m0 < f (ε). Proof Let ε and m0 be such that m0 < f (ε) and let x be a point in Rd , p a projection of x on S, i.e. a point p such that kx − pk = d(p, S). By assumption, µ(B(x, dS (x) + ε)) ≥ µ(B(p, ε)) R m0≥ 2m0 . Hence, 2 δµ,m0 (x) ≤ dS (x)+ε. The function m 7→ δµ,m (x) being non-decreasing, we get: m0 dS (x) ≤ 0 δµ,m (x)dm ≤ m0 (dS (x) + ε)2 . Taking the square root of this expression proves the lemma. Corollary 11.3 to 0;
(i) If the support S of µ is compact, then dS is the uniform limit of dµ,m0 as m0 converges
(ii) If the measure µ has dimension at most k > 0, then 1/k
kdµ,m0 − dS k ≤ C(µ)−1/k m0
Proof (i) If S is compact, there exists a sequence x1 , x2 , · · · of points in S such that for any ε > 0, S ⊆ ∪ni=1 B(xi , ε/2) for some n = n(ε). By definition of the support of a measure, η(ε) = mini=1···n µ(B(xi , ε/2)) is positive. Now, for any point x ∈ S, there is a xi such that kx − xi k ≤ ε/2. Hence, B(xi , ε/2) ⊆ B(x, ε), which means that µ(B(x, ε)) ≥ η(ε). (ii) Follows straightforwardly from the Lemma. For example, the uniform probability measure on a k-dimensional compact submanifold S has dimension at most k. The following proposition gives a more precise convergence speed estimate based on curvature.
153
11.4. APPLICATIONS TO GEOMETRIC INFERENCE
Proposition 11.7 Let S be a smooth k-dimensional submanifold of Rd whose curvature radii are lower bounded by R, and µ the uniform probability measure on S, then 1/k
kdS − dµ,m0 k ≤ C(S)−1/k m0
for m0 small enough and C(S) = (2/π)k βk /Hk (S) where βk is the volume of the unit ball in Rk . Notice in particular that the convergence speed of dµ,m0 to dS depends only on the intrinsic dimension k of the submanifold S, and not on the ambient dimension d. In order to prove this result, we make use of the G¨ unther-Bishop theorem (cf [54, 3.101]). Theorem 11.3 (G¨ unther-Bishop) If the sectional curvatures of a Riemannian manifold M do not exceed δ, then for every x ∈ M , Hk (BM (x, r)) ≥ βk,δ (r) where βk,δ (r) is the volume of a ball of radius r in the simply connected k-dimensional manifold with constant √ sectional curvature δ, provided that r is smaller than the minimum of the injectivity radius of M and π/ δ. Proof [Proof of Proposition 11.7] Since the intrinsic ball BS (x, ε) is always included in the Euclidean ball B(x, ε) ∩ S, the mass µ(B(x, ε)) is always larger than Hk (BS (x, ε))/Hk (S). Remarking that the sectional curvature of M is upper-bounded by 1/R2 , G¨ unter-Bishop theorem implies that for any ε smaller than the injectivity radius of S and πR, βk,1/R2 (ε) µ(B(x, ε)) ≥ Hk (S) Hence µ has dimension at most k. Moreover, by comparing the volume of an intrinsic ball of the unit sphere and the volume of its orthogonal projection on the tangent space to its center, one has: βk,1/R2 (ε) = Rk βk,1 (ε/R) ≥ Rk [sin(ε/R)]k βk where βk is the volume of the k-dimensional unit ball. Using sin(α) ≥ C(S).
11.4.3
2 πα
gives the announced value for
Shape reconstruction from noisy data
The previous results lead to shape reconstruction theorems from noisy data with outliers. To fit in our framework we consider shapes that are defined as supports of probability measures. Let µ be a probability measure of dimension at most k > 0 with compact support K ⊂ Rd and let dK : Rd → R+ be the (Euclidean) distance function to K. If µ0 is another probability measure (e.g. the empirical measure given by a point
154
CHAPTER 11. DISTANCE TO MEASURES
cloud sampled according to µ), one has
dK − dµ0 ,m ≤ kdK − dµ,m k∞ + kdµ,m − dµ0 ,m k∞ 0 0 0 0 ∞ 1 1/k ≤ C(µ)−1/k m0 + √ W2 (µ, µ0 ) m0
(11.4) (11.5)
This inequality insuring the closeness of dµ0 ,m0 to the distance function dK for the sup-norm follows immediately from the stability theorem 11.1 and the corollary 11.3. As expected, the choice of m0 is a trade-off: small m0 lead to better approximation of the distance function to the support, while large m0 make the distance functions to measures more stable. Eq. 11.4 leads to the following corollary of Theorem 11.2: Corollary 11.4 Let reachα (dK ) ≥ R for distance between dK offsets K η , for 0 < η
µ be a measure and K its support. Suppose that µ has dimension at most k and that some R > 0. Let µ0 be another measure, and ε be an upper bound on the uniform and dµ0 ,m0 . Then, for any r ∈ [4ε/α2 , R − 3ε], the r-sublevel sets of dµ,m0 and the < R are homotopy equivalent, as soon as: √ R m0 1/k+1/2 W2 (µ, µ0 ) ≤ − C(µ)−1/k m0 5 + 4/α2
Figure 11.4 illustrates the reconstruction Theorem 11.2 on a sampled mechanical part with 10% of outliers. In this case µ0 is the normalized sum of the Dirac measures centered on the data points and the (unknown) measure µ is the uniform measure on the mechanical part.
11.5
Exercises
Exercise 11.1 Let µ and ν be two probability measures with finite supports: µ=
m X
cj δxj and
ν=
j=1
n X
di δyi
i=1
P Pn where x1 , · · · , xm and y1 , · · · , yn are points in Rd and m j=1 cj = i=1 di = 1. Show that any transport plan between µ and ν can be represented as a n × m matrix Π = (πi,j ) with non negative entries such that n X i=1
πi,j = cj and
m X
πi,j = di .
j=1
Exercise 11.2 Let µ be a probability measure on Rd anf let m ∈ [0, 1). Show that δµ,m is 1-Lipschitz: ∀x, y ∈ Rd , |δµ,m (x) − δµ,m (y)| ≤ kx − yk.
Bibliography [1] Nina Amenta and Marshall Bern. Surface reconstruction by Voronoi filtering. Discrete Comput. Geom., 22(4):481–504, 1999. [2] Dominique Attali and Jean-Daniel Boissonnat. A linear bound on the complexity of the Delaunay triangulation of points on polyhedral surfaces. Discrete and Computational Geometry, 31:369–384, 2004. [3] Dominique Attali, Jean-Daniel Boissonnat, and Andr´e Lieutier. Complexity of the Delaunay triangulation of points on surfaces: The smooth case. In Proc. 19th Annual Symposium on Computational Geometry, pages 237–246, 2003. [4] F. Aurenhammer. Power diagrams: properties, algorithms and applications. SIAM J. Comput., 16:78– 96, 1987. [5] Franz Aurenhammer and Rolf Klein. Voronoi diagrams. In J¨org-R¨ udiger Sack and Jorge Urrutia, editors, Handbook of Computational Geometry, pages 201–290. Elsevier Science Publishers B.V. NorthHolland, Amsterdam, 2000. [6] M. Berger. G´eom´etrie (vols. 1-5). Fernand Nathan, Paris, 1977. [7] J-D. Boissonnat and A. Ghosh. Manifold reconstruction using tangential delaunay complexes. In Proc. 26th Annual Symposium on Computational Geometry, 2010. [8] J.-D. Boissonnat, J.-P. Pons, and M. Yvinec. From segmented images to good quality meshes using delaunay refinement. In F. Nielsen, editor, Emerging Trends in Visual Computing, volume 5416 of Lecture Notes in Control and Information Science, pages 13–37. Springer, 2009. [9] Jean-Daniel Boissonnat, David Cohen-Steiner, Bernard Mourrain, G¨ unter Rote, and Gert Vegter. Meshing of surfaces. In Jean-Daniel Boissonnat and Monique Teillaud, editors, Effective Computational Geometry for Curves and Surfaces, pages 181–229. Springer-Verlag, Mathematics and Visualization, 2006. 155
156
BIBLIOGRAPHY
[10] Jean-Daniel Boissonnat, Frank Nielsen, and Richard Nock. Bregman Voronoi diagrams. Discrete and Computational Geometry, 44(2), 2010. [11] Jean-Daniel Boissonnat and Steve Oudot. Provably good sampling and meshing of surfaces. Graphical Models, 67:405–451, 2005. [12] Jean-Daniel Boissonnat and Steve Oudot. Provably good sampling and meshing of lipschitz surfaces. In Proc. 22th Annual Symposium on Computational Geometry, 2006. [13] Jean-Daniel Boissonnat, Camille Wormser, and Mariette Yvinec. Curved Voronoi diagrams. In JeanDaniel Boissonnat and Monique Teillaud, editors, Effective Computational Geometry for Curves and Surfaces, pages 67–116. Springer-Verlag, Mathematics and Visualization, 2006. [14] Jean-Daniel Boissonnat and Mariette Yvinec. G´eom´etrie Algorithmique. Ediscience international, Paris, 1995. [15] Jean-Daniel Boissonnat and Mariette Yvinec. Algorithmic Geometry. Cambridge University Press, UK, 1998. Translated by Herv´e Br¨ onnimann. [16] F. Bolley, A. Guillin, and C. Villani. Quantitative Concentration Inequalities for Empirical Measures on Non-compact Spaces. Probab. Theory Rel., 137(3):541–593, 2007. [17] Fr´ed´eric Cazals and Joachim Giesen. Delaunay triangulation based surface reconstruction. In JeanDaniel Boissonnat and Monique Teillaud, editors, Effective Computational Geometry for Curves and Surfaces, pages 231–276. Springer-Verlag, Mathematics and Visualization, 2006. [18] R. Chaine. A geometric convection approach of 3d-reconstruction. In 1st Symposium on Geometry Processing, pages 218–229, 2003. [19] F. Chazal, D. Cohen-Steiner, L. J. Guibas, M. Glisse, and S. Y. Oudot. Proximity of persistence modules and their diagrams. In Proc. 25th ACM Sympos. Comput. Geom., 2009. [20] F. Chazal, D. Cohen-Steiner, and A. Lieutier. A sampling theory for compact sets in Euclidean space. In Proc. 22nd Annu. ACM Sympos. Comput. Geom., pages 319–326, 2006. [21] F. Chazal, D. Cohen-Steiner, and A. Lieutier. A sampling theory for compact sets in euclidean space. Discrete and Computational Geometry, 41(3):461–479, 2009. [22] F. Chazal, D. Cohen-Steiner, A. Lieutier, and B. Thibert. Stability of Curvature Measures. Computer Graphics Forum (proc. SGP 2009), pages 1485–1496, 2009. [23] F. Chazal, D. Cohen-Steiner, and Q. M´erigot. Boundary measures for geometric inference. J. Found. Comput. Math, 10:221–240, 2010. [24] F. Chazal and A. Lieutier. The λ-medial axis. Graphical Models, 67(4):304–331, July 2005.
BIBLIOGRAPHY
157
[25] F. Chazal and A. Lieutier. Weak feature size and persistent homology: Computing homology of solids in Rn from noisy data samples. In Proc. 21st Annual ACM Symposium on Computational Geometry, pages 255–262, 2005. [26] F. Chazal and A. Lieutier. Stability and computation of topological invariants of solids in Rn . Discrete Comput. Geom., 37(4):601–617, 2007. [27] Fr´ed´eric Chazal, David Cohen-Steiner, and Andr´e Lieutier. Normal cone approximation and offset shape isotopy. Comput. Geom. Theory Appl., 42(6-7):566–581, 2009. [28] Bernard Chazelle. An optimal convex hull algorithm in any fixed dimension. Discrete Comput. Geom., 10:377–409, 1993. [29] J. Cheeger. Critical points of distance functions and applications to geometry. In Geometric Topology: recent developments, Montecani Terme, volume 1504 of Lecture Notes in Math., pages 1–38, 1990. [30] L. P. Chew. Guaranteed-quality mesh generation for curved surfaces. In Proc. 9th Annu. Sympos. Comput. Geom., pages 274–280, 1993. [31] F. H. Clarke. Optimization and Nonsmooth Analysis. Wiley-Interscience, New-York, 1983. [32] K. L. Clarkson and P. W. Shor. Applications of random sampling in computational geometry, II. Discrete Comput. Geom., 4:387–421, 1989. [33] D. Cohen-Steiner, H. Edelsbrunner, and J. Harer. Stability of persistence diagrams. In Proc. 21st ACM Sympos. Comput. Geom., pages 263–271, 2005. [34] David Cohen-Steiner and Jean-Marie Morvan. Restricted Delaunay triangulations and normal cycle. In Proc. 19th Annual Symposium on Computational Geometry, pages 237–246, 2003. [35] T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, Cambridge, MA, 1990. [36] Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf. Computational Geometry: Algorithms and Applications. Springer-Verlag, Berlin, Germany, 2nd edition, 2000. [37] T. K. Dey. Curve and Surface Reconstruction : Algorithms with Mathematical Analysis. Cambridge University Press, 2007. [38] R. A. Dwyer. Higher-dimensional Voronoi diagrams in linear expected time. Discrete Comput. Geom., 6:343–367, 1991. [39] H. Edelsbrunner. Weighted alpha shapes. Technical Report UIUCDCS-R-92-1760, Dept. Comput. Sci., Univ. Illinois, Urbana, IL, 1992.
158
BIBLIOGRAPHY
[40] H. Edelsbrunner. The union of balls and its dual shape. Discrete & Computational Geometry, 13(1):415– 440, 1995. [41] H. Edelsbrunner. Surface reconstruction by wrapping finite point sets in space. In B. Aronov, S. Basu, J. Pach, M. Sharir (Eds.), Ricky Pollack and Eli Goodman Festschrift, pages 379–404. Springer-Verlag, Berlin, 2003. [42] H. Edelsbrunner. Topological persistence (title to be checked). to be checked, 2010 (to be checked). [43] H. Edelsbrunner, M. Facello, P. Fu, and J. Liang. Measuring proteins and voids in proteins. In Proc. 28th Ann. Hawaii Internat. Conf. System Sciences, volume V of Biotechnology Computing, pages 256–264, 1995. [44] H. Edelsbrunner, M. Facello, and J. Liang. On the definition and the construction of pockets in macromolecules. Discrete Applied Mathematics, 88(1-3):83–102, 1998. [45] H. Edelsbrunner, D. Letscher, and A. Zomorodian. Topological persistence and simplification. Discrete Comput. Geom., 28:511–533, 2002. [46] H. Edelsbrunner and E.P. M¨ ucke. Three-dimensional alpha shapes. In Proceedings of the 1992 workshop on Volume visualization, pages 75–82. ACM, 1992. [47] Herbert Edelsbrunner. Shape reconstruction with the Delaunay complex. In LATIN’98: Theoretical Informatics, volume 1380 of Lecture Notes Comput. Sci., pages 119–132, 1998. [48] Herbert Edelsbrunner. Geometry and Topology for Mesh Generation. Cambridge University Press, 2001. [49] Jeff Erickson. Dense point sets have sparse Delaunay triangulations or “. . . but not too nasty”. Discrete & Computational Geometry, 33:83–115, 2005. [50] Herbert Federer. Curvature measures. Transactions of the American Mathematical Society, 93(3):418– 491, 1959. [51] P. Frosini and C. Landi. Size theory as a topological tool for computer vision. Pattern Recognition and Image Analysis, 9:596–603, 1999. [52] J. H. G. Fu. Tubular neighborhoods in Euclidean spaces. Duke Mathematical Journal, 52(4):1025–1046, 1985. [53] W. Fulton. Algebraic Topology: a First Course. Springer-Verlag, 1995. [54] S. Gallot, D. Hulin, and J. Lafontaine. Riemannian Geometry. Springer-Verlag, 1990. [55] J. Giesen and M. John. The flow complex: a data structure for geometric modeling. In Proc. 14th ACM-SIAM Sympos. Discrete Algorithms (SODA), pages 285–294, 2003.
BIBLIOGRAPHY
159
[56] J. E. Goodman and J. O’Rourke, editors. Handbook of Discrete and Computational Geometry. CRC Press LLC, Boca Raton, FL, 1997. [57] K. Grove. Critical point theory for distance functions. In Proc. of Symposia in Pure Mathematics, volume 54, 1993. Part 3. [58] Allen Hatcher. Alegbraic Topology. Cambridge University Press, 2002. [59] M. W. Hirsch. Differential Topology. Springer-Verlag, New York, NY, 1976. [60] Ravikrishna Kolluri, Jonathan Richard Shewchuk, and James F. O’Brien. Spectral surface reconstruction from noisy point clouds. In Symposium on Geometry Processing, pages 11–21. Eurographics Association, 2004. [61] J. Liang, H. Edelsbrunner, and C. Woodward. Anatomy of protein pockets and cavities: measurement of binding site geometry and implications for ligand design. Protein Science, 7:1884–1897, 1998. [62] A. Lieutier. Any open bounded subset of Rn has the same homotopy type as it medial axis. ComputerAided Design, 36(11):1029–1046, September 2004. [63] B. Mederos, N. Amenta, L. Velho, and L. H. de Figueiredo. Surface reconstruction for noisy point clouds. In Proc. 3rd Sympos. on Geometry Processing, pages 53–62, 2005. [64] R. Motwani and P. Raghavan. Randomized Algorithms. Cambridge University Press, New York, NY, 1995. [65] Patrick Mullen, Fernando de Goes, Mathieu Desbrun, David Cohen-Steiner, and Pierre Alliez. Signing the Unsigned: Robust Surface Reconstruction from Raw Pointsets. Computer Graphics Forum, 29:1733– 1741, 2010. special issue for EUROGRAPHICS Symposium on Geometry Processing. [66] J. R. Munkres. Elements of algebraic topology. Addison-Wesley, Redwood City, California, 1984. [67] Atsuyuki Okabe, Barry Boots, and Kokichi Sugihara. Spatial Tessellations: Concepts and Applications of Voronoi Diagrams. John Wiley & Sons, Chichester, UK, 1992. [68] D. Pedoe. Geometry, a comprehensive course. Dover Publications, New York, 1970. [69] S. Peleg, M. Werman, and H. Rom. A unified approach to the change of resolution: space and gray-level. IEEE Trans. Pattern Anal. Mach. Intell., 11(7):739–742, 1989. [70] A. Petrunin. Semiconcave functions in alexandrov’s geometry. In Surveys in Differential Geometry: Metric and Comparison Geometry, volume XI. Internationational Press of Boston, 2007. [71] V. Robins. Toxard computing homology from finite approximations. Topology Proceedings, 24:503–532, 1999.
160
BIBLIOGRAPHY
[72] Y. Rubner, C. Tomasi, and L.J. Guibas. The Earth Mover’s Distance as a Metric for Image Retrieval. Int. J. Comput. Vision, 40(2):99–121, 2000. [73] J. Ruppert. A Delaunay refinement algorithm for quality 2-dimensional mesh generation. J. Algorithms, 18:548–585, 1995. [74] R. Seidel. The upper bound theorem for polytopes: an easy proof of its asymptotic version. Comput. Geom. Theory Appl., 5:115–116, 1995. [75] R. Sibson. A vector identity for the Dirichlet tesselation. Math. Proc. Camb. Phil. Soc., 87:151–155, 1980. [76] R. Sibson. A brief description of natural neighbour interpolation. In Vic Barnet, editor, Interpreting Multivariate Data, pages 21–36. John Wiley & Sons, Chichester, 1981. [77] C. Villani. Topics in Optimal Transportation. American Mathematical Society, 2003. [78] G. M. Ziegler. Lectures on Polytopes, volume 152 of Graduate Texts in Mathematics. Springer-Verlag, Heidelberg, 1994.