HAL Id: hal-00804691
https://hal.inria.fr/hal-00804691
Submitted on 22 May 2013
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Computing a Canonical Polygonal Schema of an Orientable Triangulated Surface
Francis Lazarus, Michel Pocchiola, Gert Vegter, Anne Verroust
To cite this version:
Francis Lazarus, Michel Pocchiola, Gert Vegter, Anne Verroust. Computing a Canonical Polygonal Schema of an Orientable Triangulated Surface. SoCG ’01 - Seventeenth annual symposium on Com- putational geometry, Jun 2001, Medford, United States. pp.80-89, �10.1145/378583.378630�. �hal- 00804691�
Computing a Canonical Polygonal Schema of an Orientable Triangulated Surface
Francis Lazarus
Michel Pocchiola
y
Gert Vegter
z
Anne Verroust
S
ABSTRACT
Alosed orientable surfaeof genusg anbeobtained
by appropriateidentiation ofpairs of edgesof a4g-
gon(thepolygonalshema). Theidentiededgesform
2gloopsonthesurfae,thataredisjointexeptfortheir
ommonend-point. Theseloopsaregeneratorsofboth
thefundamentalgroupandthehomologygroupofthe
surfae.Theinverseproblemisonernedwithndinga
setof2gloopsonatriangulatedsurfae,suhthatut-
ting the surfaealong these loops yields a(anonial)
polygonal shema. Wepresenttwooptimalalgorithms
forthisinverseproblem. Bothalgorithmshavebeenim-
plementedusingtheCGALpolyhedrondatastruture.
1. INTRODUCTION
LetMg bea regular4g{gon, whosesuessive edges
arelabeleda1;b1;a1;b1;;ag;bg;ag;bg. Edgexisdi-
reted ounterlokwise, edge x lokwise. The spae
obtainedbyidentifyingedges xandx,asindiatedby
theirdiretion,is alosedoriented surfae;Seee.g.[8,
Chapter1.4℄. Thissurfae,alled orientablesurfaeof
genus g, is homeomorphito a 2{sphere with g han-
dles. E.g.,M1 is thetorus;SeeFigure1. Thelabeled
polygonM
g
isalledtheanonialpolygonalshemaof
M
g .
Itiseasytoseethatallvertiesareidentiedtoasingle
pointp0 ofthesurfae. Afteridentiationinpairs,the
CNRSandUniversityofPoitiers,Frane.
E-mail: lazarussi.sp2mi.univ-poit iers. fr
y
Deptd'Informatique,EoleNormaleSuperieure,Paris,
Frane. E-mail: Mihel.Pohiolaens.fr
z
Dept.ofMath. andCS,UniversityofGroningen,The
Netherlands. E-mail: gerts.rug.nl
S
INRIARoquenourt,Frane.
E-mail: Anne.Verroustinria.fr
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.
SCG’01, June 3-5, 2001, Medford, Massachusetts, USA.
Copyright 2001 ACM 1-58113-357-X/01/0006 ...$5.00.
a
1 a1
b
1
b
1
Figure 1: Frompolygonal shema to orientable
surfae: the torus.
edgesof thepolygonal shema form2gurvesonMg,
whih are disjoint, exept for their ommon endpoint
p
0
. These 2g loops are generators of the fundamental
groupofMg (andofthersthomologygroup). Inthe
sequelwe dropthe dependeneonthegenus fromour
notation,i.e., Mdenotes alosed orientablesurfaeof
genusg.
Inthispaperweonsidertheinverseproblem: Given
aombinatorial(triangulated)surfae,ndaanonial
set of PL-urves(generators) suh that, after utting
thesurfaealongthesegenerators,weobtainaanoni-
alpolygonalshemaforthesurfae. APL-urveisan
alternatingsequeneofedgesandverties,whereedges
onnettwosuessivevertiesthatlieinthesamefae,
eitherinitsinteriororontheinteriorofoneofitsbound-
aryedges.
In [10℄ an algorithm is skethed that onstruts a
anonialset ofgenerators inoptimal timeand spae.
Inthis paper, wepresent indetailasimpleoptimalal-
gorithm; we allthis theinrementalmethod,sinewe
onstrutthegeneratorswhiletraversingalltrianglesof
thesurfae. Ourmainresultis
anorientable losed surfae ofgenus g,with atotal of
n verties, edges and faes, an be omputed in O(gn)
time andspae,whihisworst-ase optimal. EahPL-
generatoronsists ofO(n)edges andverties.
. . . . . . ..
.
.. .
Figure 2: A surfae with two groups of dg=2e
and bg=2 handles, separated by a thin tunnel
of size (n). Regardless of the position of the
base-point p
0
, at least half of this tunnel must
be rossed by atleastbg=2 generators.
Optimalityiseasytoestablish;SeeFigure2.
Furthermore,weshowhowtoturnBrahana'smethod[2℄
into a seond algorithm omputinga anonial set of
generators inoptimaltimeand spae. Wehaveimple-
mentedbothmethodsusingtheC++libraryCGAL.For
ommentsontheseimplementations, andtheir perfor-
mane,werefertoSetion6.
There are several reasons for presenting these algo-
rithmshere: (i)ouralgorithmsgreatlysimplifythemethod
of[10℄, (ii) full detailsare presented for thersttime,
(iii)thealgorithmshavebeenimplemented,and(iv)the
algorithmsanbeusedtosolveseveralotherproblems
inomputationaltopology.Amongtheappliationsare
the onstrutionof PL-homeomorphismsbetween sur-
faes, andtheonstrutionof(apart of)theuniversal
overingspaeofthesurfae. Asimilar, non-anonial
polygonalshemahasbeenusedin[6℄todeidewhether
twoPL-urvesonasurfaeare homotopi. Adierent
algorithmforthelatterproblem,basedonmethodsfrom
ombinatorial grouptheory, and abandoninguniversal
overingspaes,is presentedin[4℄. Otherappliations
are oneivable inonnetion with morphing,where a
suitableparametrization of 2-manifolds is providedby
thediskobtainedbyuttingalongtheanonialgener-
ators.
For general bakground material on omputational
topology, also in onnetion with appliations, we re-
fertothesurveys[5℄and[9℄.
2. SURFACES WITH COLLARS
TriangulatedsurfaeswillberepresentedbyDoubly-
ConnetedEdgeList,adatastruturefor representing
subdivisionsofsurfaes. Werefer to[3, Chapter2℄for
details on this data struture. Note that everyundi-
retededgeofthe triangulationorrespondstoexatly
twohalf-edges. The inrementalalgorithm startswith
the open surfae S = Mnft0g, where t0 is an arbi-
trary (losed)triangle, eventuallyontaining the om-
monbasepointoftheonstrutedgenerators. Initially,
thetopologialboundaryBofS is theboundaryoft .
B along at least one edge, and utting these (losed)
triangles fromS. Notethatthenon-visitedpartofM
is anopen subsetof M. The topologial boundary B
is adjustedaordingly. It is represented as a irular
sequeneofhalf-edges,oriented insuhawaythat the
triangletotheleftofahalf-edgebelongstoS. Wesay
thatavertexours inBifitistheoriginofahalf-edge
inB.
Aswewillexplaininmoredetail,theboundaryBmay
beome non-regular during this proess, in the sense
thatavertex oursmultiplyinB,oritontainsboth
a half-edge and its opposite partner (alled its Twin
in [3℄). See Figure 3 (Bottom). Yet, the irregularity
ofB,andhene ofthesurfae S,is restrited. Thisis
mademorepreisebyintroduingthenotionofaollar
ofanopensurfae.
Definition 2. Asurfae withollar inMisa pair
(S;), where S is anopen submanifold of M, and :
S 1
[0;1℄!Misaontinuousmap,suh that
1.(S 1
(0;1℄)S,andtherestritionj
S 1
(0;1℄
:S 1
(0;1℄!S isanembedding;
2.(S 1
f0g)MnS;
3.ThetopologialboundaryofS (vizSnS)istheimage
ofthelosedurve:S 1
f0g!M.
Observethat theurve:S 1
f0g!Misingeneral
not anembedding. Theurve:S 1
f1g!M,whih
isanembedding,maybeonsideredasa`regularization'
ofthe{perhapsnon-regular{boundaryofS.Werefer
to thehalf-openstrip (S 1
(0;1℄) as the ollar of S.
Thisollarhas attahment urve (S 1
f0g),and free
boundary(S 1
f1g).Notethateveryontinuousurve
onnetingapointinSwithapointinMnSintersets
theollarofS.
B
p1
p
2
p3
p
4
Figure 3: Collars. Top: aPL-ollar is obtained
by inserting verties near the tail of half-edges
inident to B,or in a orner ofa triangle. Bot-
tom: aollaron asingular urve B.
AollarS hasastraightforwardrepresentationinthe
PL-setting. Tothisend,weinsertavertexnearthetail
of eah half-edge in S emanating from a vertex of B.
Notethat inthis way anedge withbothendpointson
B obtainstwoverties. Furthermore,if two suessive
half-edgesofB,sharingaommonvertexv,areinident
to the sametriangle tof S, thereis nohalf-edge of S
emanating from v. In this ase, we insert avertex in
the interiorof t(e.g., onthebisetor ofthe angle oft
at v). Conneting thesequeneof insertedvertiesby
edges we obtain a PL-ollar of S; See Figure3. This
typeofollarwillbeusedinSetion4.
As usual, the Euler harateristi (S) of S is the
alternating sumof the numbers of verties, edges and
faes of S. Cutting the surfae along B we obtain a
boundary of S onsisting of a yli sequene of half-
edges (wheresome pairs ofhalf-edges mayorrespond
tothesameundiretededgeofM). Gluingadiskalong
this yli sequene of half-edges yields a losed ori-
entable surfae. By denition,the genusg ofS is the
genusofthelattersurfae.Itisstraightforwardtohek
that(S)=1 2g.
3. OUTLINE OF THE ALGORITHM
Wenowdesribethealgorithmthatvisitsalltriangles
ofM,startingfromasingletriangle. Thisalgorithmis
thebakbonefortheonstrutionofaanonialsystem
of generators, to be desribed in Setion 4. Globally
speakingthealgorithm proeedsasfollows. Thealgo-
rithmConnetedSum,whihisalled ontheomple-
mentS oftheinitialtriangle,visitsatriangletinident
uponthetopologial boundaryB ofS,updatesS and
B, and alls itself reursively on the updated version
of S. (As we shall explain at the endof this setion,
the algorithm infat deomposes the surfae M as a
onnetedsum oftori, whene itsname.) During this
reursiveproess,Smaybeomedisonneted,inwhih
aseConnetedSumisalledreursivelyoneahon-
neted omponent. It may also happenthat S is not
disonneted,butis notasurfaewithollareither(it
willturn outthatinthe latterasetheollaris split).
BeforewepresentthealgorithminfulldetailinFigure5,
werstspeifytheinputofthealgorithm.
Preondition of ConnetedSum. Algorithm Con-
netedSum takesas inputa pair(S;g), where S is a
surfaewithollar,whihhaspositive genusg.
In partiular, the ondition g > 0 guarantees that
ConnetedSumwillnotbealledondisks,whihwill
be ruialintheanalysis of thetime omplexity. The
proessofvisitingtrianglet,inidentuponthetopolog-
ialboundaryB,isalled anextension. Wedistinguish
twotypesofextensions.
RegularExtension: Triangletshareseithertwover-
tiesandonehalf-edgeh
1
(Figure4,top),orthreever-
tiesandtwohalf-edgesh1,h2(Figure4,bottom),with
B.
WeupdateBintheformerasebyreplaingthehalf-
edge h1 with the two-hain h2;h3, in the latter ase
byreplaingthetwo-hainh1;h2withthehalf-edgeh3.
Notethat thetopologial typesofB and theollardo
not hange upon a regular extension. In partiular,
=)
=)
h
1
h1
h
2 h
2
h
3 3
Figure 4: A regularextension.
S 0
= S nt is a surfaewith ollar (to guarantee that
S 0
isanopensubsetofM,weonsiderthetriangletto
belosed). Therefore,ConnetedSumisalled reur-
sivelyonS 0
. ItisobviousthattheEulerharateristi,
andhenethegenus,doesnothangeunderregularex-
tension.
Splitting Extension: Triangletsharesthreeverties
andonehalf-edgewithB(Figure6,upperpart).
Thevertexoft,notadjaenttotheommonhalf-edge
ofBand t,is alledthesplit vertex,and isdenotedby
v
s
. Let the verties of t be v
1 , v
2 and v
3
, suh that
v1v2 is ahalf-edge ofB, and henev3 =vs. Let L be
thepartofB betweenv
3 andv
1
,andletRbethepart
betweenv
2 andv
3
. ThenBissplitintoB
l
=v
1 v
3 Land
Br=v3v2R . Wedistinguishtwosub-ases:
Sntisnotonneted. InthisaseSntonsistsoftwo
onnetedomponents,S
l andS
r
say,withtopologial
boundaryB
l
and Br,respetively. BothS
l
and Sr are
surfaeswithollars,withattahmenturvesBlandBr,
respetively.
Sntisonneted. Inthisasethetopologialboundary
ofSntisBl[Br,so Sntis notasurfaewithollar.
Inpartiular,ConnetedSumdoesnotaeptSntas
input. Toremedythissituation,letbeasimpleedge-
pathinS nt onneting Bl and Br, alled a join-path
(ofB
l andB
r
). SeeFigure6,wherev
l 2B
l andv
r 2B
r
aretheextremalvertiesof.
Thefollowingresult,whose(straightforward)proofis
omittedfromthisversionofthepaper,guaranteesthat
inaseofasplittingextensiontheConnetedSuman
bealledreursively:
Lemma 3. Supposeproessingtausesasplittingex-
tension.
1.IfSntisonneted,andisajoin-path,thenSn(t[)
isasurfae withollar,havinggenus g 1.
2. If S nt is not onneted, its onneted omponents
S
l and S
r
are surfaes with ollar. Moreover, if their
genusesare g
l
andgr, respetively, theng=g
l +gr.
Thealgorithmthatonstrutsaanonialsetofgen-
eratorsispresentedinFigure5. Chekingwhether the
urrentextensionisregular(line2)anbedoneinO(1)
time,bysettingamarkbitfor eahvisitedvertex. To
determine whether S 0
= Sntis onneted,we try to
onstrut a join-path by performing a breadth-rst
searh on the 1-skeleton of S 0
(we have to say more
ConnetedSum(S)
1 LettbeatriangleofS inidenttoollar (S)
2 if tausesregularextension
3 thenConnetedSum(Snt)
4 else ollar (Snt)isdisonneted
5 if Sntisonneted
6 thenonstrutPL-pathjoining
omponentsofollar(Snt)
7 onstrutpairofgeneratorsalong
andpartofollar(Snt)
8 if genus(S)>1
9 thenConnetedSum(Sn(t[))
10 elseletS
l andS
r
betheomponentsofSnt
11 if genus(S
l
)>0thenConnetedSum(S
l )
12 if genus(Sr)>0thenConnetedSum(Sr)
Figure 5: Algorithm ConnetedSum
about this presently). Depending onwhether we su-
eed in onneting the two omponents Bl and Br of
thetopologialboundaryofS 0
,wedeidewhetherS 0
is
onnetedornot. IfS 0
isonneted,apairofgenerators
isonstruted(details arepresentedinSetion4),and
ConnetedSumis reursively alledon Sn(t[), if
g 0
=g 1>0. IfS 0
isnotonneted,ConnetedSum
isreursivelyalledontheonnetedomponentsSl,if
gl>0,andSr,ifgr>0.
Lemma 4. 1. IfSntis onneted, establishing on-
netednessandomputingajoin-pathanbeperformed
intimeproportionaltothesizeof S.
2. If S nt has two onneted omponents, establish-
ingnon-onnetednessandomputingthegenusesofthe
onnetedomponentsanbeperformedintimepropor-
tionaltothesizeof thesmalleronnetedomponent.
We only give a skethof the proof. Whena split o-
urs,wetrytoonstrutthejoin-pathbymeansofa
tandemsearhtraversingtheedgesofthesurfaeinpar-
allel,startingfromthesouresBl andBr. Theneither
thetandemsearhsueedsinonnetingB
l andB
r by
the join-path , or it detets that S nt has two on-
netedomponentsSlandSrbyexhaustingthesmaller
ofthesetwoomponents. Inthelatteraseweompute
thegenusofthesmalleromponentbydeterminingthe
numberofverties,edges andfaes. Lemma4,part2,
givesthegenusoftheother onnetedomponent.
Lemma's3and4allowustoanalyzethetimeomplex-
ityofthetraversaloftheinitialsurfaeM. Tothisend,
lett
0
beanarbitrarytriangleofM.
Corollary 5. The all of ConnetedSum on the
surfae with ollar S
0
= Mnt
0
is exeuted in time
O(gn), plus the time needed to onstrut the g pairs
of (line 7) generators upon a non-disonneting split.
Hereg isthegenus ofMandn isthetotalnumber of
verties,edgesandtrianglesinM.
Againthe proof isstraightforward,exept fora minor
subtlety. If all reursive alls eitherresult inthe on-
v
l
v
l
vl
vr
v
r
vr v1
v1
v
1
v2
v2
v
2 3
v3 =vs
v
3
=v
s
Figure6: A splittingextension.
strution of a pair of generators (line 5{9), or in re-
ursiveallsofConnetedSumonollaredsurfaesof
lower genus (i.e., g
l
> 0 and g
r
> 0), the total time
omplexity obviouslyis O(gn)(sinethe totalnumber
ofallsisginthislukyase).
However,ConnetedSummaybealled reursively
on a ollared surfae of the same genus as S in ase
the genus of Sl or Sr is zero. Note that in this ase
theomponentwithgenuszero isdisarded. Sinethe
algorithmspendstimeproportionaltothesmallerofthe
sizesofSlorSr,wehargetheostofthereursiveall
to thedisarded omponent. Therefore, thetotal ost
ofallsofthistypeisO(n).
4. CONSTRUCTING GENERATORS
It remainsto llinthedetailsoftheonstrutionof
apairofgenerators,f Figure5,line7. Thesegenera-
torswill berouted alonganapproah path AP,whih
onnetsthebasepointwiththe boundaryofthenon-
visitedpartofthesurfae. Asthealgorithmproeeds,