Filtrations and Homology

Code from previous class sessions

The following module draws a 2D geometric realization of a simplicial complex.

drawGeometricRealization[complex_,points_]:=Module[
{verts={}, edges={}, faces={}},

(* make lists of simplices of each dimension *) 
Do[
If[Length[simplex]==1,AppendTo[verts,points[[simplex[[1]]]]]];
If[Length[simplex]==2,AppendTo[edges,points[[simplex]]]];
If[Length[simplex]==3,AppendTo[faces,points[[simplex]]]]
,{simplex,complex}];

(* return the drawing *) 
Show[
ListPlot[points->Range[Length[points]],AspectRatio->1,PlotStyle->{PointSize[Medium],Black},Axes->False],
Graphics[{Blue,Opacity[0.4],Triangle[faces],Black,Opacity[1],Line[edges]}] 
]
]

The following module returns the boundary matrix for a given dimension of an abstract simplicial complex.

computeBoundaryMx[complex_,dim_]:=Module[
{rowSimplices,colSimplices,faces,c,r,matrix},

(* get the lists of simplices in adjacent dimensions *) 
rowSimplices=Select[complex,Length[#]==dim&];
colSimplices=Select[complex,Length[#]==dim+1&];

(* handle empty matrix *)
If[Length[rowSimplices]==0||Length[colSimplices]==0,Return[{{}}]];

(* initialize a matrix *) 
matrix=Table[0,Length[rowSimplices],Length[colSimplices]];

(* loop over all columns *)
Do[
(* loop over all codim 1 faces of this simplex *)
faces=Subsets[colSimplices[[c]],{dim}];
Do[
(* set the correct entry to 1 *) 
r=Position[rowSimplices,f,1][[1,1]];
matrix[[r,c]]=1;
,{f,faces}];
,{c,1,Length[colSimplices]}];

(* return the boundary matrix*) 
matrix
]

Computing Vietoris-Rips complex for fixed threshold ϵ

For a given set of points S for a given threshold value ϵ, the following module computes all points, edges, and triangular faces of the Vietoris-Rips complex (Subscript[VR, ϵ])(S). This module is faster than our previous method of computing the Vietoris-Rips complex, since it does not compute simplices of dimension greater than 2.

computeVRcomplex[points_,ϵ_]:=Module[
{n=Length[points],
complex,(* we will store the simplicial complex here *)
edges(* data structure for fast edge lookup by lower vertex index *)
},

(* initialze complex with vertices *)
complex=Table[{i},{i,1,n}];

(* compute all edge lengths *) 
edges=Table[{},n];
Do[
If[EuclideanDistance[points[[i]],points[[j]]]<ϵ,AppendTo[edges[[i]],j]]
,{i,1,n},{j,i+1,n}];
Do[
AppendTo[complex,{i,j}]
,{i,1,n},{j,edges[[i]]}];

(* fill in complete triangles *)
Do[
If[MemberQ[edges[[i]],k]&&MemberQ[edges[[j]],k],AppendTo[complex,{i,j,k}]]
,{i,1,n},{j,edges[[i]]},{k,j+1,n}];

(* return the simplicial complex *) 
complex
]

Example: Betti numbers of a Vietoris-Rips complex on 100 points

Generate a set S of 100 random points:

numPoints=100;
points=RandomReal[1,{numPoints,2}];
pointPlot=ListPlot[points->Range[numPoints],PlotRange->{{0,1},{0,1}},AspectRatio->1]

Compute the Betti numbers of (Subscript[VR, ϵ])(S) for various choices of ϵ. What do you observe?

complex=computeVRcomplex[points,0.1];
drawGeometricRealization[complex,points]

d1=computeBoundaryMx[complex,1];
Dimensions[d1]
MatrixRank[d1,Modulus->2]

d2=computeBoundaryMx[complex,2];
Dimensions[d2]
MatrixRank[d2,Modulus->2]

β0=Dimensions[d1][[1]]-MatrixRank[d1,Modulus->2]

β1=(Dimensions[d1][[2]]-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2]

Sample point clouds

For each set of points S, compute the Betti numbers of (Subscript[VR, ϵ])(S) for various choices of ϵ. For what values of ϵ do the Betti numbers “accurately” describe the shape of the point clouds? Is there a “best” value of ϵ?

Point cloud 1

points1={{0.49,1.41},{0.60,1.54},{-2.00,-1.09},{-1.65,0.94},{-1.97,-0.62},{1.48,-0.22},{1.30,0.21},{0.60,-2.09},{-1.72,0.50},{2.49,0.26},{1.37,1.54},{1.60,1.76},{-0.98,-0.93},{-0.76,-2.30},{1.64,-0.45},{0.92,1.71},{-0.79,-1.72},{0.61,-2.08},{0.81,2.04},{-1.11,-2.13},{-1.59,-1.55},{-2.43,0.10},{0.42,2.29},{1.47,1.13},{-1.60,1.42},{-1.37,-0.13},{2.24,-0.08},{-0.09,-1.71},{1.09,-1.83},{0.84,-2.17},{-0.65,1.62},{1.69,0.04},{-0.20,2.32},{1.76,-1.11},{-1.95,1.26},{1.49,1.72},{0.15,-2.27},{0.27,-1.74},{1.04,1.27},{-1.57,-1.18},{-1.92,0.70},{1.54,-0.62},{1.50,-0.63},{-1.67,0.00},{0.41,2.36},{-1.77,0.50},{0.63,2.18},{0.89,-1.36},{0.44,-2.04},{1.89,-1.08},{-1.54,1.15},{1.96,-0.67},{-1.47,1.26},{1.50,-0.84},{-0.45,1.98},{0.50,-2.29},{0.15,1.99},{2.06,-0.35},{-1.51,-1.00},{-2.24,0.76},{0.63,1.90},{-1.69,0.34},{-0.72,1.91},{-1.09,1.62},{0.20,-2.11},{0.80,1.48},{1.93,0.38},{-1.50,-1.29},{-1.20,0.52},{0.52,1.68},{2.09,-0.19},{2.36,0.51},{1.31,0.83},{-1.76,-1.02},{0.97,-1.40},{0.77,1.17},{1.03,1.86},{-0.23,1.77},{-1.74,-0.23},{-1.66,0.82},{1.85,-0.34},{-2.32,0.50},{-0.31,-2.15},{0.47,1.86},{0.71,2.00},{1.47,1.70},{1.52,0.31},{1.61,-0.05},{-1.78,0.55},{-1.50,-0.64},{0.11,-1.86},{-0.53,-1.77},{0.80,-2.52},{-0.50,-2.08},{-0.08,-1.84},{-1.89,1.07},{-0.85,-1.93},{-0.14,2.06},{0.98,1.43},{-1.43,1.68},{2.12,0.44},{-0.57,-1.61},{-1.05,-1.54},{2.05,0.58},{-1.61,1.04},{-1.73,0.81},{0.50,1.90},{2.72,0.06},{2.01,1.34},{1.57,-1.63},{-2.00,-0.98},{1.13,1.27},{-0.80,-2.32},{-0.47,1.94},{2.29,1.29},{0.68,-2.09},{0.88,1.63},{1.58,0.81},{-1.93,-0.52},{-1.19,1.56},{-1.72,0.11},{-1.66,-0.68},{-1.84,-1.18},{-0.08,-2.46},{-0.91,-1.82},{1.70,0.22},{1.12,2.11},{-0.56,1.71},{-1.96,-0.60},{1.96,-0.02},{0.92,1.72},{-0.99,2.05},{1.43,-1.20},{-0.13,2.04},{-2.22,0.71},{1.93,-0.37},{1.52,0.45},{2.02,0.36},{1.44,-0.62},{-2.32,0.02},{1.66,-1.86},{-0.16,-1.70},{-1.70,1.15},{2.05,-0.61},{-1.62,-1.52},{1.42,1.86},{-0.72,-1.56},{1.31,-1.52},{1.81,-1.16},{1.83,0.35},{1.21,-1.15},{-2.43,0.53}};

ϵ=1;
complex=computeVRcomplex[points1,ϵ];
drawGeometricRealization[complex,points1]
d1=computeBoundaryMx[complex,1];
d2=computeBoundaryMx[complex,2];
β0=Dimensions[d1][[1]]-MatrixRank[d1,Modulus->2];
β1=(Dimensions[d1][[2]]-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2];
Print["Using ϵ = ",ϵ,", (Subscript[β, 0]) = ",β0, " and (Subscript[β, 1]) = ",β1]

Point cloud 2

points2={{3.27,-1.73},{-0.52,3.89},{3.13,3.72},{3.96,-0.80},{-3.69,-3.41},{-0.06,4.09},{4.30,-4.21},{-3.54,4.17},{3.19,-2.16},{1.86,-3.36},{5.33,1.28},{4.53,3.04},{-4.93,-3.19},{-3.69,3.08},{-1.42,-4.40},{3.58,3.68},{-2.22,-4.40},{-3.75,1.76},{1.52,3.96},{2.11,4.10},{-0.26,-3.84},{1.24,-5.40},{1.78,-4.05},{-3.11,3.59},{3.79,0.78},{-4.09,2.89},{4.54,3.73},{5.13,2.54},{3.50,1.55},{4.48,-3.74},{-2.99,2.25},{-3.71,-0.39},{-4.13,-1.53},{-5.82,-1.46},{-6.06,1.34},{4.23,0.92},{6.37,-0.95},{3.45,4.30},{-4.68,1.95},{3.37,-3.78},{3.56,-1.72},{-1.83,-4.20},{-5.62,1.18},{-2.81,2.63},{-3.97,3.25},{2.18,-3.03},{3.27,-2.29},{6.15,-1.21},{-4.08,0.67},{3.42,-0.87},{-2.19,4.68},{5.05,-1.77},{2.70,-5.17},{-2.98,3.58},{3.10,4.83},{4.49,-1.07},{4.25,-3.56},{3.73,2.59},{5.75,1.06},{0.76,3.95},{-4.45,1.47},{3.79,0.65},{0.96,4.15},{-4.67,0.91},{3.51,2.30},{-3.86,-2.01},{-1.16,5.63},{-3.14,3.47},{-4.17,-1.90},{5.61,-1.99},{-2.92,2.94},{-1.49,4.36},{-4.29,2.92},{-4.37,3.21},{3.38,3.57},{2.16,3.71},{-4.20,-0.63},{1.88,4.95},{1.66,-5.49},{-1.05,4.63},{-1.08,4.97},{2.41,-4.61},{5.26,-1.12},{-1.69,-3.99},{3.90,1.11},{2.25,-4.49},{-1.01,-4.92},{2.97,-3.67},{-5.33,2.07},{3.97,-2.83},{-4.28,-2.94},{1.41,3.86},{1.71,4.12},{-4.12,-3.86},{-4.98,2.91},{-4.60,-2.02},{-1.48,3.08},{-3.54,3.82},{-2.02,3.44},{4.47,-1.54},{4.42,2.24},{-1.72,-3.90},{-5.67,2.71},{-3.21,2.47},{-4.30,1.11},{-3.35,-3.20},{-0.95,5.05},{-5.25,0.95},{-3.20,-3.33},{-2.26,5.71},{-2.07,-4.73},{1.02,-5.77},{0.83,-3.87},{-0.72,-3.93},{3.06,-2.28},{1.98,5.82},{-3.72,-3.63},{-1.50,3.25},{3.87,-3.94},{-2.92,-3.21},{-2.90,-4.23},{4.17,3.39},{5.68,-1.19},{-2.07,3.74},{0.51,4.17},{3.95,2.30},{3.38,5.38},{3.02,-3.74},{-4.02,-0.93},{4.66,-2.71},{6.64,0.07},{6.11,-1.76},{2.09,4.88},{3.15,3.07},{-1.58,3.50},{-6.00,1.09},{-2.56,3.77},{-5.56,-2.26},{-3.71,1.92},{1.71,-3.57},{3.39,-2.10},{2.12,-3.85},{1.83,-4.22},{5.04,1.22},{-4.26,1.72},{-4.32,3.42},{4.78,-2.08},{3.19,-3.66},{1.68,-5.59},{-4.99,2.13},{3.09,5.60},{4.23,1.24},{3.77,3.07},{2.43,4.47},{-1.52,-5.10},{-5.78,0.78},{5.84,1.63},{4.10,1.16},{5.96,0.99},{4.01,-1.09},{6.21,0.16},{5.21,-1.32},{6.50,-0.69},{3.96,-1.01},{4.89,1.42},{6.38,-0.37},{6.53,0.27},{5.72,-0.77},{5.86,0.92},{4.46,-1.23},{6.32,0.63},{3.65,0.27},{6.15,0.17},{4.59,-1.20},{4.46,-1.30},{6.12,0.87},{4.83,1.53},{6.16,-0.77},{6.03,0.86},{5.84,1.24},{6.17,-0.88},{4.38,-1.41},{3.88,-0.64},{3.74,-0.04},{5.05,-1.34},{4.45,-1.28},{5.72,-0.84},{3.76,-0.05},{6.62,0.32},{6.39,-0.75},{6.00,0.82},{3.89,0.76},{6.43,0.03},{4.56,1.19},{3.81,-0.88},{6.15,1.04},{6.41,-0.39},{4.95,1.32},{4.42,1.26},{3.80,-0.74},{6.29,0.51},{4.00,-1.32},{5.03,1.46},{4.19,-1.18},{6.35,0.80},{5.53,1.46},{4.53,1.16},{-4.22,1.10},{-3.70,0.57},{-6.55,-0.14},{-6.31,0.59},{-5.86,0.90},{-3.92,0.97},{-4.67,1.45},{-6.05,-1.39},{-5.01,1.29},{-5.86,-1.30},{-6.06,0.83},{-4.98,-1.32},{-3.93,-0.78},{-3.80,1.10},{-3.58,0.00},{-3.68,0.35},{-4.23,1.02},{-3.71,-0.65},{-6.14,-0.38},{-4.29,1.44},{-6.34,-0.09},{-4.93,-1.37},{-6.02,-0.92},{-4.86,-1.52},{-5.69,1.54},{-6.16,-0.84},{-6.31,-0.07},{-4.23,-1.18},{-5.95,1.13},{-3.56,0.50},{-4.88,-1.25},{-5.60,1.56},{-5.60,-1.44},{-3.53,-0.24},{-6.08,-0.77},{-4.02,0.97},{-6.21,-0.46},{-5.31,-1.33},{-3.87,0.89},{-4.53,1.41},{-4.47,-1.41},{-5.67,1.16},{-3.78,-0.33},{-5.47,1.62},{-6.31,-0.29},{-5.94,-1.15},{-6.56,-0.55},{-5.80,-1.24},{-4.73,-1.20},{-6.22,-0.25},{0.59,3.80},{-1.43,4.80},{1.27,5.37},{-1.27,4.83},{-0.37,6.53},{1.02,4.17},{-1.29,5.20},{0.09,6.51},{0.94,3.86},{-1.32,4.47},{0.38,6.36},{-1.66,4.84},{-1.23,5.81},{-1.38,5.29},{0.56,6.31},{1.26,5.62},{-1.11,5.59},{1.27,5.60},{-0.69,6.07},{0.44,6.05},{0.78,6.55},{1.57,4.75},{0.89,3.86},{0.37,6.23},{0.35,3.54},{1.47,4.97},{-0.85,5.58},{0.53,3.47},{-0.23,3.64},{0.27,3.65},{-0.33,6.25},{-0.99,4.29},{0.13,3.52},{1.18,5.88},{-1.21,4.85},{1.47,4.72},{-0.49,3.88},{0.73,3.99},{-0.31,3.35},{-1.14,5.29},{-0.11,6.46},{-0.10,6.52},{1.14,6.01},{1.60,4.69},{1.63,5.37},{-0.93,5.86},{-1.11,3.73},{1.06,6.17},{1.35,5.03},{-0.29,3.65},{-0.66,-3.85},{-1.13,-5.88},{-1.64,-5.38},{1.45,-4.45},{0.90,-6.08},{0.43,-3.72},{-1.38,-5.69},{-0.32,-3.71},{-0.19,-6.18},{0.78,-6.00},{-1.37,-5.83},{-1.13,-5.81},{0.77,-6.55},{-1.36,-5.02},{-1.01,-5.76},{0.50,-3.52},{0.58,-6.20},{-1.11,-6.08},{-1.37,-5.25},{1.29,-5.63},{-1.08,-5.78},{-1.36,-4.69},{1.13,-4.25},{-0.05,-6.09},{-0.63,-6.13},{0.87,-6.14},{0.67,-4.05},{0.15,-6.19},{-0.82,-5.79},{-1.24,-4.74},{1.02,-4.04},{-1.41,-5.85},{-0.30,-6.75},{-0.43,-3.65},{1.45,-4.12},{-0.92,-3.79},{1.41,-4.99},{1.02,-6.10},{-1.08,-6.20},{-1.08,-4.30},{-1.11,-5.58},{-0.13,-6.37},{0.18,-3.71},{-0.29,-6.32},{1.09,-4.38},{0.64,-3.27},{0.09,-3.67},{-0.90,-4.14},{0.63,-3.77},{-0.86,-5.94}};

ϵ=2;
complex=computeVRcomplex[points2,ϵ];
drawGeometricRealization[complex,points2]
d1=computeBoundaryMx[complex,1];
d2=computeBoundaryMx[complex,2];
β0=Dimensions[d1][[1]]-MatrixRank[d1,Modulus->2];
β1=(Dimensions[d1][[2]]-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2];
Print["Using ϵ = ",ϵ,", (Subscript[β, 0]) = ",β0, " and (Subscript[β, 1]) = ",β1]

Point cloud 3

points3={{8.51,-0.17},{-4.09,3.97},{-2.77,10.26},{-4.7,4.56},{-9.43,0.61},{3.37,8.58},{-1.55,-1.55},{-3.33,10.12},{1.47,8.96},{-3.32,2.72},{-3.05,1.69},{-10.11,0.01},{2.87,10.45},{7.58,1.53},{-6.45,-8.51},{3.44,6.44},{-0.48,-1.02},{-8.23,1.11},{-0.36,-2.48},{1.42,10.49},{2.09,0.73},{0.23,-3.56},{-0.58,-1.94},{8.92,-4.04},{-5.02,5.49},{-1.73,1.6},{5.42,1.77},{3.13,-0.16},{-6.91,1.02},{9.24,0.11},{-0.33,-1.},{-7.24,0.62},{-5.31,-8.06},{-2.95,2.18},{4.24,7.15},{9.56,-0.27},{9.16,-1.13},{-1.12,-0.07},{-3.16,1.53},{2.85,-7.38},{-1.17,1.17},{-2.,0.37},{0.22,-5.42},{-5.,-7.24},{8.39,-5.39},{-9.12,-5.17},{10.87,-1.46},{-7.07,2.27},{-7.52,1.56},{1.41,-4.4},{-2.06,-8.45},{9.64,-2.79},{-6.35,-7.33},{3.54,-7.96},{0.96,10.98},{1.99,9.69},{-4.87,2.58},{10.47,-5.52},{0.29,-1.88},{0.68,11.4},{-1.58,0.02},{-0.31,0.46},{7.8,-7.13},{-3.72,6.23},{-1.14,2.43},{7.13,-7.46},{-1.47,10.21},{8.24,1.35},{-9.27,-4.92},{-2.53,8.29},{-1.69,10.48},{-0.66,-3.25},{1.19,-0.86},{-2.65,-6.06},{-2.5,8.87},{-0.21,-1.34},{2.69,1.88},{-2.23,11.57},{2.92,9.94},{8.85,0.42},{1.33,10.69},{2.19,10.58},{3.02,1.41},{0.68,-5.65},{6.11,2.85},{10.87,-4.04},{9.68,0.38},{-0.95,-2.78},{-5.75,3.96},{-3.15,10.21},{-2.23,1.39},{4.63,5.47},{-0.57,-3.81},{1.92,10.42},{-7.8,0.55},{1.05,-2.31},{2.35,-0.59},{-9.33,-3.98},{8.94,0.2},{-4.57,6.78},{-7.36,2.11},{3.81,7.96},{-0.32,1.06},{9.05,-0.48},{-0.05,-1.08},{-0.33,-1.16},{2.28,-7.96},{-3.96,6.04},{-11.07,-3.07},{0.1,11.},{-4.66,6.01},{-6.2,-7.8},{-11.19,-2.98},{6.25,2.08},{-2.03,-5.97},{11.41,-1.41},{2.21,2.42},{1.6,-1.91},{-0.84,-5.27},{0.35,10.28},{-0.82,-2.95},{0.35,-1.39},{5.97,-6.07},{-1.94,-5.35},{8.23,0.69},{-5.86,1.71},{6.47,1.83},{-3.96,7.47},{-10.25,-4.15},{-0.24,0.78},{5.83,7.37},{1.61,-5.5},{-2.95,1.86},{1.67,2.11},{0.78,12.3},{1.47,-0.8},{10.83,-5.87},{-9.36,-5.41},{9.56,-4.67},{5.46,-8.35},{-2.95,10.69},{10.16,-2.47},{-9.91,-0.14},{-5.85,8.83},{-9.55,-4.28},{5.79,0.39},{-9.81,-3.91},{2.7,-6.58},{-8.62,-4.86},{-10.42,-0.92},{-8.59,-2.54},{-7.13,-6.98},{-5.02,6.87},{-9.99,-1.9},{6.25,2.74},{7.28,-8.01},{-0.4,-0.23},{0.35,-2.11},{-0.99,-3.98},{-0.25,-0.33},{5.43,6.41},{0.48,10.37},{1.12,11.41},{-9.13,-4.04},{4.74,4.58},{-1.57,0.32},{-2.17,11.54},{-3.59,9.94},{-4.95,2.87},{-4.85,7.87},{-0.82,-3.02},{-8.52,-6.84},{1.07,1.01},{-2.14,1.71},{-2.58,2.56},{1.14,-7.19},{-10.33,-2.99},{1.5,-0.03},{0.52,0.36},{3.12,7.16},{-1.03,10.84},{1.45,-6.27},{0.42,-1.76},{-9.63,-4.09},{3.67,2.47},{-1.79,-5.23},{-1.68,-7.48},{2.04,-8.58},{2.73,9.98},{-4.86,4.54},{-0.29,-5.93},{-2.91,-6.6},{0.93,-0.41},{-4.97,7.09},{2.51,11.09},{-10.75,-5.92},{4.87,8.11},{1.28,-0.34},{2.94,2.96},{-9.27,-5.71}};

ϵ=2.8;
complex=computeVRcomplex[points3,ϵ];
drawGeometricRealization[complex,points3]
d1=computeBoundaryMx[complex,1];
d2=computeBoundaryMx[complex,2];
β0=Dimensions[d1][[1]]-MatrixRank[d1,Modulus->2];
β1=(Dimensions[d1][[2]]-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2];
Print["Using ϵ = ",ϵ,", (Subscript[β, 0]) = ",β0, " and (Subscript[β, 1]) = ",β1]

Point cloud 4

points4={{-3.16,0.51},{-1.13,1.81},{-1.84,0.3},{-2.75,1.05},{-2.8,1.9},{-2.69,0.08},{-2.71,1.04},{-2.34,2.01},{-2.6,0.32},{-2.58,1.84},{-1.25,1.18},{-1.95,2.13},{-2.45,1.91},{-3.12,0.73},{-2.41,0.71},{-1.6,2.08},{-3.27,0.92},{-1.69,1.84},{-2.93,1.34},{-3.13,0.65},{-2.72,1.8},{-3.13,0.46},{-2.27,1.89},{-1.16,0.77},{-3.03,1.88},{-3.,0.24},{-1.97,1.88},{-2.25,1.92},{-2.88,1.14},{-0.96,1.51},{-2.53,-0.19},{-1.29,0.89},{-1.94,-0.02},{-1.32,1.71},{-2.6,0.37},{-1.14,0.46},{-2.76,0.37},{-2.11,1.95},{-1.37,1.07},{-1.58,-0.19},{-1.21,0.22},{-0.99,1.46},{-2.35,1.84},{-2.45,1.62},{-2.05,1.94},{-1.46,1.56},{-2.4,1.79},{-2.81,2.28},{-3.23,0.72},{-2.78,0.39},{-1.32,1.75},{-1.36,0.46},{-1.89,0.26},{-2.43,1.82},{-1.38,0.1},{-0.96,0.6},{-2.2,1.94},{-2.67,1.04},{-3.,1.86},{-2.39,2.04},{-2.6,1.61},{-1.32,0.65},{-1.97,2.11},{-2.5,-0.01},{-2.6,1.87},{-2.27,0.27},{-1.89,1.74},{-2.85,1.19},{-2.12,1.66},{-2.29,1.58},{-1.36,1.79},{-1.11,0.93},{-2.02,0.16},{-2.3,0.43},{-1.54,1.4},{-1.11,1.03},{-1.2,0.8},{-1.97,0.03},{-2.88,0.63},{-2.26,-0.06},{2.61,1.86},{4.43,2.32},{4.34,-1.23},{3.46,2.18},{2.92,-0.67},{4.03,-1.27},{4.67,-0.49},{2.69,2.76},{5.08,0.02},{2.68,-0.27},{4.86,0.16},{3.86,-0.36},{2.71,-0.48},{4.46,-0.56},{2.71,2.15},{4.62,-0.14},{3.9,-0.45},{2.03,0.78},{2.68,1.82},{4.93,2.06},{5.11,0.22},{4.21,-0.68},{2.5,0.43},{3.86,-0.46},{2.46,0.32},{4.39,2.35},{5.27,0.69},{2.77,-0.14},{5.94,1.13},{3.76,-0.37},{5.22,0.02},{3.89,2.48},{4.87,0.35},{3.17,0.47},{3.74,2.61},{5.94,0.12},{5.02,-0.38},{4.01,-0.15},{5.71,0.28},{2.94,1.09},{2.85,1.88},{2.93,-0.43},{5.17,1.71},{3.77,-0.47},{3.77,2.95},{3.75,-0.18},{5.71,0.98},{4.35,2.25},{2.78,1.69},{4.54,-0.05},{4.81,-0.1},{5.35,1.34},{4.08,-0.76},{3.69,-0.46},{4.33,2.51},{2.64,0.22},{4.53,-0.82},{4.75,2.18},{5.08,-0.01},{3.17,-0.03},{3.02,-0.14},{4.89,1.73},{4.61,2.49},{5.3,1.54},{4.41,0.26},{4.49,1.98},{2.96,-0.26},{4.99,-0.14},{3.01,-0.39},{3.26,2.24},{3.57,-0.41},{2.94,2.94},{2.55,0.66},{3.98,2.24},{3.89,2.91},{4.48,2.58},{4.12,2.15},{4.87,-0.08},{3.6,2.58},{2.76,2.1},{0.65,-1.95},{-0.03,-2.93},{-0.01,-0.95},{0.69,-1.45},{0.48,-2.67},{0.84,-1.92},{0.77,-2.14},{0.41,-1.15},{-0.28,-1.61},{-0.79,-2.19},{-0.33,-1.27},{0.13,-1.07},{-0.43,-1.28},{0.38,-2.62},{0.78,-1.95},{-0.47,-1.98},{-0.13,-2.7},{-0.87,-2.18},{0.76,-1.56},{0.08,-2.87},{0.39,-1.72},{-0.85,-1.69},{-0.38,-2.49},{-0.25,-2.62},{-0.4,-2.01},{0.4,-2.63},{-0.21,-0.95},{0.09,-2.73},{0.41,-2.31},{-0.27,-1.28},{0.12,-1.53},{0.45,-1.92},{0.7,-1.6},{0.01,-1.17},{-0.57,-1.42},{0.35,-2.7},{0.48,-1.41},{0.47,-2.43},{0.38,-1.29},{0.87,-2.51},{-0.96,-1.72},{0.98,-1.79},{-0.82,-1.9},{-0.79,-1.79},{0.04,-2.97},{-0.8,-1.96},{-0.35,-1.31},{-0.06,-2.45},{-0.74,-1.08},{0.47,-1.58},{-0.86,-2.46},{-0.13,-1.12},{0.78,-2.26},{-0.54,-1.82},{0.66,-2.7},{-0.69,-1.64},{-0.5,-1.64},{-0.35,-1.9},{0.6,-2.23},{0.78,-1.95},{0.55,-1.38},{-0.43,-1.97},{-0.78,-2.16},{0.02,-2.95},{0.64,-2.71},{0.67,-2.33},{-1.17,-2.64},{0.77,-1.48},{0.54,-2.72},{0.48,-1.39},{-0.65,-2.41},{0.14,-2.53},{0.62,-2.86},{0.73,-1.73},{-0.38,-1.56},{0.56,-1.72},{-0.55,-2.59},{-0.05,-2.67},{-0.46,-1.42},{0.77,-1.64}};

ϵ=1.3;
complex=computeVRcomplex[points4,ϵ];
drawGeometricRealization[complex,points4]
d1=computeBoundaryMx[complex,1];
d2=computeBoundaryMx[complex,2];
β0=Dimensions[d1][[1]]-MatrixRank[d1,Modulus->2];
β1=(Dimensions[d1][[2]]-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2];
Print["Using ϵ = ",ϵ,", (Subscript[β, 0]) = ",β0, " and (Subscript[β, 1]) = ",β1]