Classes | |
class | Gudhi::alpha_complex::Alpha_complex< Kernel > |
Alpha complex data structure. More... | |
class | Gudhi::alpha_complex::Alpha_complex_3d< Complexity, Weighted, Periodic > |
Alpha complex data structure for 3d specific case. More... | |
Enumerations | |
enum | Gudhi::alpha_complex::complexity : char { Gudhi::alpha_complex::complexity::FAST = 'f', Gudhi::alpha_complex::complexity::SAFE = 's', Gudhi::alpha_complex::complexity::EXACT = 'e' } |
Alpha complex complexity template parameter possible values. More... | |
Alpha_complex is a simplicial complex constructed from the finite cells of a Delaunay Triangulation.
The filtration value of each simplex is computed as the square of the circumradius of the simplex if the circumsphere is empty (the simplex is then said to be Gabriel), and as the minimum of the filtration values of the codimension 1 cofaces that make it not Gabriel otherwise.
All simplices that have a filtration value \( > \alpha^2 \) are removed from the Delaunay complex when creating the simplicial complex if it is specified.
Alpha_complex is constructing a Delaunay Triangulation [24] from CGAL (the Computational Geometry Algorithms Library [41]) and is able to create a SimplicialComplexForAlpha
.
The complex is a template class requiring an Epick_d dD Geometry Kernel [39] from CGAL as template parameter.
default_filtration_value=true
to Alpha_complex::create_complex
.CGAL::Epeck_d
makes the construction safe. If you pass exact=true
to Alpha_complex::create_complex
, the filtration values are the exact ones converted to the filtration value type of the simplicial complex. This can be very slow. If you pass exact=false
(the default), the filtration values are only guaranteed to have a small multiplicative error compared to the exact value, see CGAL::Lazy_exact_nt<NT>::set_relative_precision_of_to_double
for details. A drawback, when computing persistence, is that an empty exact interval [10^12,10^12] may become a non-empty approximate interval [10^12,10^12+10^6]. Using CGAL::Epick_d
makes the computations slightly faster, and the combinatorics are still exact, but the computation of filtration values can exceptionally be arbitrarily bad. In all cases, we still guarantee that the output is a valid filtration (faces have a filtration value no larger than their cofaces).Alpha_complex
with CGAL ≥ 5.0.0.This example builds the Delaunay triangulation from the given points in a 2D static kernel, and creates a Simplex_tree
with it.
Then, it is asked to display information about the simplicial complex.
When launching:
the program output is:
In order to create the simplicial complex, first, it is built from the cells of the Delaunay Triangulation. The filtration values are set to NaN, which stands for unknown value.
In example, :
\( \textbf{for } \text{i : dimension } \rightarrow 0 \textbf{ do}\\ \quad \textbf{for all } \sigma \text{ of dimension i}\\ \quad\quad \textbf{if } \text{filtration(} \sigma ) \text{ is NaN} \textbf{ then}\\ \quad\quad\quad \text{filtration(} \sigma ) = \alpha^2( \sigma )\\ \quad\quad \textbf{end if}\\ \quad\quad \textbf{for all } \tau \text{ face of } \sigma \textbf{ do}\quad\quad \textit{// propagate alpha filtration value}\\ \quad\quad\quad \textbf{if } \text{filtration(} \tau ) \text{ is not NaN} \textbf{ then}\\ \quad\quad\quad\quad \text{filtration(} \tau \text{) = min( filtration(} \tau \text{), filtration(} \sigma \text{) )}\\ \quad\quad\quad \textbf{else}\\ \quad\quad\quad\quad \textbf{if } \tau \text{ is not Gabriel for } \sigma \textbf{ then}\\ \quad\quad\quad\quad\quad \text{filtration(} \tau \text{) = filtration(} \sigma \text{)}\\ \quad\quad\quad\quad \textbf{end if}\\ \quad\quad\quad \textbf{end if}\\ \quad\quad \textbf{end for}\\ \quad \textbf{end for}\\ \textbf{end for}\\ \text{make_filtration_non_decreasing()}\\ \text{prune_above_filtration()}\\ \)
From the example above, it means the algorithm looks into each triangle ([0,1,2], [0,2,4], [1,2,3], ...), computes the filtration value of the triangle, and then propagates the filtration value as described here :
Then, the algorithm looks into each edge ([0,1], [0,2], [1,2], ...), computes the filtration value of the edge (in this case, propagation will have no effect).
Finally, the algorithm looks into each vertex ([0], [1], [2], [3], [4], [5] and [6]) and sets the filtration value (0 in case of a vertex - propagation will have no effect).
As the squared radii computed by CGAL are an approximation, it might happen that these \( \alpha^2 \) values do not quite define a proper filtration (i.e. non-decreasing with respect to inclusion). We fix that up by calling SimplicialComplexForAlpha::make_filtration_non_decreasing()
.
The simplex tree is pruned from the given maximum \( \alpha^2 \) value (cf. SimplicialComplexForAlpha::prune_above_filtration()
). In the following example, the value is given by the user as argument of the program.
This example builds the Delaunay triangulation in a dynamic kernel, and initializes the alpha complex with it.
Then, it is asked to display information about the alpha complex.
When launching:
the program output is:
A specific module for Alpha complex is available in 3d (cf. Alpha_complex_3d) and allows to construct standard, weighted, periodic or weighted and periodic versions of alpha complexes. Alpha values computation can be Gudhi::alpha_complex::complexity::FAST, Gudhi::alpha_complex::complexity::SAFE (default value) or Gudhi::alpha_complex::complexity::EXACT.
This example builds the CGAL 3d weighted alpha shapes from a small molecule, and initializes the alpha complex with it. This example is taken from CGAL 3d weighted alpha shapes.
Then, it is asked to display information about the alpha complex.
When launching:
the program output is:
|
strong |
GUDHI Version 3.3.0 - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding. - Copyright : MIT | Generated on Tue Aug 11 2020 11:09:13 for GUDHI by Doxygen 1.8.13 |