Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AllThreeWaistsOfComplex #283

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gap/Paths/paths.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,16 @@ DeclareAttribute( "AllTwoWaistsOfComplex", IsTwistedPolygonalComplex);
#! gap> AllThreeWaistsOfComplex(Tetrahedron());
#! [ ]
#! @EndExampleSession
#! As another example we consider the following simplicial surface:
#! @BeginExampleSession
#! gap> umbdesc:=[ (1,4,6,7,5,3), (1,7,5,8,2,3), (1,7,6,8,2,4),(2,4,6,8,5,3) ];;
#! gap> s:=SimplicialSurfaceByUmbrellaDescriptor(umbdesc);;
#! gap> AllThreeWaistsOfComplex(s);
#! [ ( v1, E1, v2, E6, v3, E11, v1 ), ( v2, E1, v1, E8, v4, E10, v2 ),
#! ( v1, E2, v3, E6, v2, E9, v1 ), ( v3, E2, v1, E7, v4, E12, v3 ),
#! ( v3, E3, v2, E4, v4, E12, v3 ), ( v2, E3, v3, E5, v4, E10, v2 ),
#! ( v2, E4, v4, E8, v1, E9, v2 ), ( v3, E5, v4, E7, v1, E11, v3 ) ]
#! @EndExampleSession
#!
#! @Returns a set of closed vertex-edge-paths
#! @Arguments complex
Expand Down
26 changes: 20 additions & 6 deletions gap/Paths/paths.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1011,12 +1011,26 @@ end
InstallMethod( AllThreeWaistsOfComplex, "for a twisted polygonal complex",
[IsTwistedPolygonalComplex],
function( surface )
local w,eof,waists;
waists:=Combinations(Edges(surface),3);
waists:=Filtered(waists,w->Length(Union(VerticesOfEdges(surface){w}))=3);
waists:=Filtered(waists,w->Filtered(EdgesOfFaces(surface),
eof->Length(Intersection(w,eof))>=2)=[]);
return List(waists,w->VertexEdgePathByEdges(surface,w));
local w,voe1,voe2,voe3,v1,v2,v3,eof,waists,verticesOfEdges,facesOfEdges,temp;
verticesOfEdges:=VerticesOfEdges(surface);
facesOfEdges:=FacesOfEdges(surface);
waists:=Combinations(InnerEdges(surface),3);
waists:=Filtered(waists,w->Length(Union(verticesOfEdges{w}))=3);
waists:=Filtered(waists,w->Length(Union(facesOfEdges{w}))=6);
temp:=waists;
waists:=[];
for w in temp do
voe1:=verticesOfEdges[w[1]];
voe2:=verticesOfEdges[w[2]];
voe3:=verticesOfEdges[w[3]];
v1:=Intersection(voe1,voe2)[1];
v2:=Intersection(voe2,voe3)[1];
v3:=Intersection(voe1,voe3)[1];
if Length(Set([v1,v2,v3]))=3 then
Add(waists,[v3,w[1],v1,w[2],v2,w[3],v3]);
fi;
od;
return List(waists,w->VertexEdgePathNC(surface,w));
end
);

Expand Down