#The example uses GraphViz software.
file:=HapFile("data135.txt");
Read(file);
dx:=EuclideanApproximatedMetric;;
dz:=EuclideanApproximatedMetric;;
P:=30*[0..100];; P:=List(P, i->[i]);; r:=29;;
epsilon:=32;;
cluster:=function(S)
         local Y, P, C;
         if Length(S)=0 then return S; fi;
         Y:=VectorsToOneSkeleton(S,epsilon,dx);
         P:=PiZero(Y);
         C:=Classify([1..Length(S)],P[2]);
         return List(C,x->S{x});
end;;
L:=List(S,v->Maximum(List(S,y->dx(v,y))));;
n:=Position(L,Minimum(L));;
f:=function(x) return [dx(S[n],x)]; end;;
M:=Mapper(S,dx,f,dz,P,r,cluster);
Display(GraphOfSimplicialComplex(M));

