Function Repository Resource:

BettiNumbers

Compute the Betti numbers for a simplicial complex

Contributed by: Richard Hennigan (Wolfram Research)
 ResourceFunction["BettiNumbers"][complex] gives the Betti numbers of the specified simplicial complex.

Details and Options

In ResourceFunction["BettiNumbers"][complex], the value for complex can be any of the following:
 simplex a simplex as defined in the table below {simplex1,simplex2,…} a list of simplices {{v11,v12,…},…} a list of lists, where the vi,j correspond to simplex vertices Graph[…] a graph object MeshRegion[…] a mesh region
The value for simplex can be any of the following:
 Point[v] a point Line[{v1,v2}] a line segment Triangle[{v1,v2,v3}] a filled triangle Polygon[{v1,v2,v3}] a filled triangle Tetrahedron[{v1,v2,v3,v4}] a filled tetrahedron Simplex[{v1,…,vn}] an n-1 dimensional simplex

Examples

Basic Examples (3)

Get the Betti numbers of a simplex:

 In[1]:=
 Out[1]=

Get the Betti numbers of a simplicial complex:

 In[2]:=
 Out[2]=

Get the Betti numbers of a MeshRegion:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

Scope (4)

Many graphics primitives that represent simplices can be used:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=
 In[7]:=
 Out[7]=

Give a simplicial complex as lists of indices:

 In[8]:=
 Out[8]=

Use the resource function HypergraphPlot to view the corresponding hypergraph to see that these correspond to three connected components, one "hole" and no "voids":

 In[9]:=
 Out[9]=

BettiNumbers can operate on graphs:

 In[10]:=
 Out[10]=

The vertices of the simplices need not be geometric coordinates:

 In[11]:=
 Out[11]=

Equivalently, as a Graph:

 In[12]:=
 Out[12]=

Applications (3)

Determine if a cow is (topologically) spherical:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=
 In[15]:=
 Out[15]=

This is not a spherical cow:

 In[16]:=
 Out[16]=

Determine if meshes are solid or hollow:

 In[17]:=
 In[18]:=
 In[19]:=
 Out[19]=

Verify with SimplexBoundary:

 In[20]:=
 Out[20]=

Form simplicial complexes from graphs by mapping cycles of a given length to simplices:

 In[21]:=
 Out[21]=
 In[22]:=
 Out[22]=
 In[23]:=
 Out[23]=
 In[24]:=
 Out[24]=

Check that the Betti numbers accurately characterize the underlying surfaces:

 In[25]:=
 Out[25]=
 In[26]:=
 Out[26]=

Visualize a connected embedding for each surface:

 In[27]:=
 Out[27]=
 In[28]:=
 Out[28]=

Properties and Relations (3)

Only dim+1 Betti numbers are returned, where dim is the dimension of the given simplicial complex:

 In[29]:=
 Out[29]=
 In[30]:=
 Out[30]=

The dimension of the simplicial complex is determined by the maximum dimension of simplices in the complex:

 In[31]:=
 Out[31]=
 In[32]:=
 Out[32]=

All Betti numbers after the returned values are zero, so a simplex has the same Betti numbers regardless of its dimension:

 In[33]:=
 Out[33]=

These are all equivalent:

 In[34]:=
 Out[34]=

Homology groups (3)

The homology groups of the torus T are:

These can be obtained from Betti numbers:

 In[35]:=
 In[36]:=
 Out[36]=

Hypergraphs (2)

The first Betti number of a connected hypergraph is 1:

 In[37]:=
 In[38]:=
 Out[38]=
 In[39]:=
 Out[39]=

The second Betti number suggests that there's a "hole" in the covering; visualize it with the resource function HypergraphPlot:

 In[40]:=
 Out[40]=

Boundaries (2)

Two triangles that share an edge are topologically equivalent to one triangle:

 In[41]:=
 Out[41]=
 In[42]:=
 Out[42]=
 In[43]:=
 Out[43]=
 In[44]:=
 Out[44]=

Their boundaries should be equivalent as well:

 In[45]:=
 Out[45]=
 In[46]:=
 Out[46]=
 In[47]:=
 Out[47]=
 In[48]:=
 Out[48]=
 In[49]:=
 Out[49]=

Possible Issues (5)

BettiNumbers only considers unique vertices in each simplex:

 In[50]:=
 In[51]:=
 Out[51]=
 In[52]:=
 Out[52]=

As graphs, these are considered distinct:

 In[53]:=
 Out[53]=
 In[54]:=
 Out[54]=
 In[55]:=
 Out[55]=

The same is true for hypergraphs:

 In[56]:=
 Out[56]=

All graphs are treated as undirected:

 In[57]:=
 Out[57]=
 In[58]:=
 Out[58]=

This means that the first Betti number corresponds to the number of WeaklyConnectedGraphComponents instead of ConnectedGraphComponents:

 In[59]:=
 Out[59]=
 In[60]:=
 Out[60]=

Betti numbers do not identify links, knots or braids:

 In[61]:=
 Out[61]=
 In[62]:=
 Out[62]=

Betti numbers cannot determine orientability:

 In[63]:=
 Out[63]=
 In[64]:=
 Out[64]=

BettiNumbers only allows Polygon objects with three vertices:

 In[65]:=
 Out[65]=
 In[66]:=
 Out[66]=

Neat Examples (3)

Find some topologically interesting cities:

 In[67]:=
 In[68]:=
 In[69]:=
 Out[69]=
 In[70]:=
 Out[70]=

Dynamically compute homology of an alpha complex for a random set of points:

 In[71]:=
 Out[68]=

Create a simplicial complex corresponding to dialog exchanged between two actors:

 In[72]:=
 Out[72]=
 In[73]:=

This is topologically equivalent to Birdnardo talking to himself:

 In[74]:=
 Out[74]=

Find the boundary to skip to the important stuff:

 In[75]:=
 Out[75]=

Version History

• 2.0.0 – 29 April 2020
• 1.0.0 – 17 April 2020