7. Computing the Reeb graph of a filtered simplicial complex

This notebook gives a tutorial to computing the Reeb graph from a filtered simplicial complex. We assume that this complex is given as the LowerStarSC class (see lowerstarSC documentation for details).

[35]:
from cereeberus import LowerStarSC, ReebGraph, reeb_of_lower_star

First, we build a small simplicial complex with a lower star filtration.

[43]:
K = LowerStarSC()
K.insert([0, 1, 2])
K.insert([1, 3])
K.insert([2,3])
K.insert([0,4])
K.assign_filtration([0], 0.0)
K.assign_filtration([1], 3.0)
K.assign_filtration([2], 5.0)
K.assign_filtration([3], 7)
K.assign_filtration([4], 9.0)

Then computing the Reeb graph of this complex is as easy as the following.

[49]:
R = reeb_of_lower_star(K)
R.draw()
../_images/notebooks_compute_Reeb_from_simplex_tree_5_0.png

For a slightly more complex example, we have the following Torus example generator.

[51]:
from cereeberus.data import Torus
[67]:
T = Torus()
T.generate_grid(grid_size = 4)
T.assign_random_values(0,100, seed=42)
T.plot()
../_images/notebooks_compute_Reeb_from_simplex_tree_8_0.png
[ ]:
R = reeb_of_lower_star(T)
R.remove_all_regular_vertices() # Simplify for visualization
[72]:
R.draw()
../_images/notebooks_compute_Reeb_from_simplex_tree_10_0.png