Contents lists available atScienceDirect

## Journal of Combinatorial Theory, Series B

www.elsevier.com/locate/jctb

## A faster algorithm to recognize even-hole-free graphs

^{✩}

Hsien-Chih Chang^{a,1}, Hsueh-I Lu^{b,2}

a*Department**of**Computer**Science,**University**of**Illinois**at**Urbana-Champaign,*
*USA*

b*Department**of**Computer**Science**and**Information**Engineering,*
*National Taiwan University,**Taiwan*

a r t i c l e i n f o a b s t r a c t

*Article**history:*

Received10August2013 Availableonline11February2015

*Keywords:*

Evenhole

Decomposition-baseddetection algorithm

Extendedcliquetree 2-join

Star-cutset Diamond Beetle Tracker

We study the problem of determining whether an *n-node*
graph*G contains* an*even**hole,*i.e.,aninducedsimplecycle
consistingofanevennumberofnodes.Conforti,Cornuéjols,
Kapoor, and Vušković gave the ﬁrst polynomial-time algo-
rithm for the problem, which runs in *O(n*^{40}) time. Later,
Chudnovsky,Kawarabayashi,andSeymourreducedtherun-
ningtime to *O(n*^{31}).The best previouslyknown algorithm
fortheproblem,duetoda SilvaandVušković,runsin*O(n*^{19})
time.Inthispaper,wesolvetheproblemin*O(n*^{11}) timeviaa
decomposition-basedalgorithmthatreliesonthedecomposi-
tiontheoremofda SilvaandVušković.Moreover,if*G contains*

✩ Thecurrentversionslightlyimprovesuponthepreliminaryversion[4]appearedinSODA 2012:(a) The
time complexity for recognizing even-hole-free *n-node* *m-edge* graphs *G is* reduced from *O(m*^{2}*n*^{7}) to
*O(m*^{3}*n*^{5}), which is an improvementif *m* *= o(n*^{2}); and(b) if *G contains*even holes, then the current
versionshowshowtooutputanevenhole*of G also*in*O(m*^{3}*n*^{5}) time.

*E-mail**addresses:*hchang17@illinois.edu(H.-C. Chang),hil@csie.ntu.edu.tw(H.-I. Lu).

*URL:*http://www.csie.ntu.edu.tw/~hil(H.-I. Lu).

1 ThisresearchwasperformedwhilethisauthorwasaﬃliatedwithDepartmentofComputerScienceand InformationEngineering,NationalTaiwanUniversity.

2 ThisauthoralsoholdsjointappointmentsintheGraduateInstituteofNetworkingandMultimediaand theGraduateInstituteofBiomedicalElectronicsandBioinformatics,NationalTaiwanUniversity.Address:

1 RooseveltRoad,Section 4,Taipei106,Taiwan,ROC. Researchofthisauthoris supportedinpartby NSCgrant 101-2221-E-002-062-MY3.

http://dx.doi.org/10.1016/j.jctb.2015.02.001 0095-8956/© 2015ElsevierInc.All rights reserved.

evenholes,thenouralgorithmalsooutputsanevenhole*of G*
in*O(n*^{11}) time.

© 2015ElsevierInc.All rights reserved.

1. Introduction

Forany graphs*G andF ,*wesaythat*G contains F ifF is*isomorphicto aninduced
subgraph *of G.*If *G does*not contain*F ,*then *G is* *F -free.* Forany family F ofgraphs,
*G is* *F-free if* *G is* *F -free* for each graph *F in* F. *A hole is* an induced simple cycle
consisting of at least four nodes. A hole is *even (respectively,* *odd)* if it consists of an
even (respectively, odd) numberof nodes. Even-hole-free graphshave been extensively
studiedintheliterature (see,e.g.,[1,13–15,20,21,30,38]).SeeVušković[43] forarecent
survey. This paper studies the problem of determining whethera graph containseven
holes. Let*n be*thenumber ofnodes ofthe inputgraph.Conforti,Cornuéjols,Kapoor,
and Vušković [12,16] gave the ﬁrst polynomial-time algorithm for the problem, which
runs in*O(n*^{40}) time[7]. Later, Chudnovsky,Kawarabayashi, and Seymour [7]reduced
therunningtimeto*O(n*^{31}).Chudnovskyet al.[7]alsoobservedthattherunningtimecan
be furtherreducedto *O(n*^{15}) aslongas prismscanbe detectedeﬃciently, butMaﬀray
andTrotignon[31]showedthatdetectingprismsisNP-hard.Thebestpreviouslyknown
algorithm for theproblem,due toda Silva and Vušković[21],runsin*O(n*^{19}) time.We
solvetheproblemin*O(n*^{11}) time, asstatedinthefollowing theorem.

Theorem 1.1.*IttakesO(m*^{3}*n*^{5}*) time* *todeterminewhether* *ann-node* *m-edgeconnected*
*graph* *contains* *evenholes.*

Technical overview. The *O(n*^{40})-time algorithmof Confortiet al.[16] isbasedontheir
decompositiontheorem[15]statingthataconnectedeven-hole-freegrapheither(i) isan
extendedcliquetree, or(ii) containsnon-path2-joinsor*k-star-cutsets*with*k∈ {1,2,*3*}.*

Themain bodyoftheiralgorithm recursivelydecomposestheinput graph*G into* alist
L ofapolynomialnumberofsmallerorsimplergraphsusingnon-path2-joinsor*k-star-*
cutsets with *k∈ {1,2,*3*} until*eachgraph inL does notcontainany of the mentioned
cutsets. Since even holes inextended clique treescan be detected in polynomialtime,
it suﬃces for their algorithm to ensure the even-hole-preserving condition of L: *G is*
even-hole-free ifand onlyif allgraphsin L areeven-hole-free.To ensurethe condition
of L, their algorithm requires acleaning process to eitherdetect an even hole*in G or*
removebadstructuresfrom*G before*obtaining*L from G.*The*O(n*^{31})-timealgorithmof
Chudnovskyet al. [7], whichisnotbaseduponany decompositiontheorembutstillre-
quiresthecleaningprocess,looksforevenholesdirectly.(ThealgorithmsofChudnovsky
et al.[6]forrecognizingperfectgraphsarealsoofthistypeofnon-decomposition-based
algorithms.) The *O(n*^{19})-time algorithm of da Silva and Vušković [21], adopting the

decomposition-basedapproach,relies onastrongerdecompositiontheoremstatingthat
ifaconnected even-hole-freegraphhas nostar-cutsets and non-path 2-joins, thenit is
an extended clique tree. Since *k-star-cutsets* with *k* *∈ {2,*3*} need* not be taken into
account,the decomposition process is signiﬁcantly simpliﬁed,leading to a much lower
time complexity. Our *O(n*^{11})-time algorithm is also based on the brilliant decomposi-
tion theorem of da Silva and Vušković[21]. Our improvement is obtained viathe new
ideaoftrackers,which allowforfewer graphstobe generated intheprocess ofdecom-
position using star-cutsets. The cleaning process is also sped up by an algorithm for
recognizingbeetle-freegraphs,baseduponthethree-in-a-tree algorithmofChudnovsky
andSeymour[10].

Speciﬁcally,ourrecognitionalgorithmforeven-hole-freegraphsconsistsoftwophases.

Throughout thepaper, *a k-hole (respectively,k-cycle andk-path)*isa*k-node*hole(re-
spectively, cycle and path). The ﬁrst phase (see Lemma 2.3) either (1) ensures that
the input graph *G contains* even holes via the existence of a “beetle” (see Section 2
and Fig. 2(a)) or a 4-hole *in G, or* (2) produces a set T of “trackers” *(H,u*1*u*2*u*3)
*of G,* where *H is* a beetle-free and 4-hole-free induced subgraph *of G and* *u*_{1}*u*_{2}*u*_{3}
is a 3-path *of H.* T satisﬁes the following even-hole-preserving condition (see Condi-
tion L1):*If G contains*evenholes,thenatleastoneelement*(H,u*_{1}*u*_{2}*u*_{3}) ofT is“lucky”

such that a shortest even hole *C of G is* a subgraph *of H and* the following holds:

(a) *u*1*u*2*u*3 is a path of *C and* (b) the neighborhood of *C in* *H is* “super clean” (i.e.,
*M**H**(C)= N*_{H}^{2,2}*(C)= N*_{H}^{1,2}*(C)= N*_{H}^{4}*(C)*=∅ using notationdeﬁnedin Section2).The
secondphaseapplies analgorithm(seeLemma 2.4)oneachtracker*(H,u*_{1}*u*_{2}*u*_{3})*∈ T to*
eitherensurethat*H contains* even holesor ensurethat*(H,u*_{1}*u*_{2}*u*_{3}) is notlucky.If all
trackersinT arenotlucky,thentheeven-hole-preservingconditionofT impliesthat*G is*
even-hole-free.Otherwise,aninduced*subgraph H of G contains*anevenhole,implying
that*G contains*evenholes.

Therecognitionalgorithm forbeetle-freegraphs(seetheproof ofLemma 2.3)inthe
ﬁrst phase is based on Chudnovsky and Seymour’s three-in-a-tree algorithm [10] (see
Theorem 3.1).If*G contains*beetlesor4-holes,then*G contains*evenholes.Otherwise,if
*G contains*evenholes,thentheneighborhoodofeachshortestevenhole*C of G is*“clean”

(i.e., *N*_{G}^{1,2}*(C)= N*_{G}^{4}*(C)*=∅, see theproof of Lemma 2.2). To furtherensure thatthe
neighborhood of *C is*superclean,we generate aset S of “supercleaners” *(S,u*1*u*2*u*3),
where *S is*anode subset *of G andu*_{1}*u*_{2}*u*_{3} is apath*of G,* suchthatat leastonesuper
cleaner*(S,u*_{1}*u*_{2}*u*_{3})*∈ S satisﬁesu*_{1}*u*_{2}*u*_{3}*⊆ C ⊆ H = G\S andM*_{H}*(C)= N*_{H}^{2,2}*(C)*=∅ for
someshortestevenhole*C of G (see*theproofofLemma 2.3).ThesetT consistingofthe
trackers*(G\ S,u*1*u*2*u*3) with*(S,u*1*u*2*u*2)*∈ S satisﬁes*therequiredeven-hole-preserving
condition.Theunderlyingtechniqueofguessing“badnodes”*of G (using*Lemmas 3.4, 3.5,
and 3.6)toberemovedbysupercleanersiscalled “cleaning”intheliterature(see,e.g.,
Vušković[43, §4]).

Thealgorithmappliedoneachtracker*T = (H,u*_{1}*u*_{2}*u*_{3})*∈ T in*thesecondphaserelies
on the decomposition theorem of da Silva and Vušković [21] (see Theorem 4.9). Since
evenholescanbeeﬃcientlydetectedinanextendedcliquetree (seeLemma 4.6, which

is aslightlyfaster implementation of thealgorithm of da Silvaand Vušković [21]), our
algorithm performs two stages of even-hole-preserving decompositions on *H,* ﬁrst via
star-cutsetsandthenvianon-path2-joins,untileachoftheresultinggraphseitherisan
extendedcliquetree orhas*O(1) nodes.* Ifalloftheresultinggraphsare even-hole-free,
then *T is* not lucky; otherwise, *H contains* even holes. As noted by Chvátal [11] (see
Lemma 4.3), if *H has* no dominated nodes, then a star-cutset *of H has* to be a full
star-cutset *of H,*which canbe eﬃciently detected. Thus, at the beginningof each de-
compositionintheﬁrststage,wepreprocess*(H,u*1*u*2*u*3) bydeletingalldominatednodes
*of H and*carefullyupdatingnodes*u*1,*u*2,and*u*3suchthattheluckinessof*(H,u*1*u*2*u*3)
is preserved (see Lemma 4.4). The correctness of this preprocessing step relies on the
fact that *H is* beetle-free and the requirement for *(H,u*1*u*2*u*3) to be lucky that the
neighborhood ofsomeshortestevenhole*C in* *H withu*1*u*2*u*3*⊆ C is* superclean.Path
*u*1*u*2*u*3iscrucialinthestage ofdecompositionsviastar-cutsetsforthegraph*H having*
no dominated nodes. Speciﬁcally, if*S is* astar-cutset *of H,*then by merelyexamining
the neighborhood of path*u*_{1}*u*_{2}*u*_{3} in*H,*we caneﬃcientlyidentify aconnected compo-
nent *B of* *H* *\ S such* that *(H[S∪ B],u*_{1}*u*_{2}*u*_{3}) preserves the luckiness of *(H,u*_{1}*u*_{2}*u*_{3})
(see Step 3 in the proof of Lemma 4.1). We then let *H = H[C* *∪ B] and* repeat the
aboveprocedurefor*O(n) iterations* until *H has*nostar-cutsets. Thesecondstage,i.e.,
decompositionsvianon-path2-joinsforgraphshavingnostar-cutsets,isbaseduponthe
detectionalgorithmfornon-path2-joinsofCharbitet al.[5](seeLemma 4.8).Thisstage
decomposes an*m-edge* graphhavingnostar-cutsets intoaset of*O(m) smaller* graphs,
each ofwhicheitherconsists *of O(1) nodes*or isan extendedcliquetree (seetheproof
of Lemma 4.2).

Related work. Even-hole-free planargraphs[34] canbe recognized in*O(n*^{3}) time.It is
NP-completetodeterminewhetheragraphcontainsaneven(respectively,odd)holethat
passesagivennode[2,3].TheStrongPerfectGraphTheoremofChudnovsky,Robertson,
Seymour, and Thomas[8] statesthat a graph *G is* perfect if and only if both *G and*
the complement *of G are* odd-hole-free. Although perfect graphs canbe recognized in
*O(n*^{9}) time [6], the tractability of recognizing odd-hole-free graphsremains open (see,
e.g., [26]). Polynomial-time algorithms for detecting odd holes are known for planar
graphs [25], claw-free graphs [29,37], and graphs with bounded clique numbers [17].

Graphscontainingnoholes(i.e.,chordalgraphs)canberecognizedin*O(m+n) time*[35,
36,39,40].Graphscontainingnoholesconsistingofﬁveormorenodes(i.e.,weaklychordal
graphs) canbe recognized in *O(m*^{2}*+ n) time* [32,33]. It takes *O(n*^{2}) time to detect a
holethatpassesany *o((log n/log log n)** ^{2/3}*) givennodes inan

*O(1)-genus*graph[27,28].

See[9,18,22,44]formoreresultsonodd-hole-freegraphs.

Roadmap. Therestofthepaperisorganizedasfollows.Section2givesthepreliminaries
andprovesTheorem 1.1byLemmas 2.3 and 2.4.Section3provesLemma 2.3.Section4
proves Lemma 2.4. Section 5 concludes the paper by explaining how to augment our
proof of Theorem 1.1into*an O(m*^{3}*n*^{5})-timealgorithm thatoutputsan evenholeof an
*n-node* *m-edge*graphcontainingevenholes.

*Fig. 1. C = v*1*c*2*c*3*v*2*c*7*c*8*v*1 isaclean evenholeofthe 11-nodegraph*G,*since*M**G**(C)**= N*_{G}^{2,2}*(C)* = ∅.

*C*^{}*= c*1*c*2*· · · c*9*c*1isanoddholewith*M**G**(C** ^{}*)=

*{v*2

*}.*

2. Preliminariesandthetopmoststructureofour proof

Unless clearly speciﬁed otherwise, all graphs throughout the paper are simple and
undirected.Let*|S| denote*thecardinalityofset *S.*Let*G be*agraph.Let*V (G) consist*
ofthenodesin*G.*Foranysubgraph*H of G,*let*G[H] denote*thesubgraph*of G induced*
by*V (H).*Subgraphs*H andH** ^{}* ofgraph

*G areadjacent in G if*somenode

*of H and*some nodeof

*H*

*areadjacent in*

^{}*G.*Forany

*subset U ofV (G),*let

*G\ U = G[V (G)\ U].*For anysubgraph

*H of G,*let

*N*

*G*

*(H) consist*ofthenodesof

*V (G)\ V (H) that*areadjacent to

*H in G and*let

*N*

_{G}*[H]= N*

_{G}*(H)∪ V (H).*

Let*C be*ahole*of G.*Let*x be*anode in*V (G)\ V (C).*Let*N**C**(x)= N**G**(x)∩ V (C).*

We saythat *x is*a *major* *node* [7] of *C in* *G if* at least three distinct nodes of *N**C**(x)*
are pairwise non-adjacent in*G.*Let *M*_{G}*(C) consist* ofthe major nodes *of C inG.* For
instance,inFig. 1,*M**G**(C)*=∅ and*M**G**(C** ^{}*)=

*{v*2

*}.*

Lemma2.1*(Chudnovskyet al.* *[7,Lemma2.2]).If* *C isashortestevenhole* *ofgraph* *G*
*andx∈ M**G**(C),then|N**C**(x)| iseven.*

If*x∈ N**G**(C)\M**G**(C),*then1*≤ |N**C**(x)|≤ 4 andC[N**C**(x)] has*atmosttwoconnected
components. Moreover, if *C[N*_{C}*(x)] is* not connected, then each connected component
of *C[N**C**(x)] has* at most two nodes. Let *N*_{G}^{i}*(C) with* 1 *≤ i* *≤ 4 consist* of the nodes
*x* *∈ N**G**(C)\ M**G**(C) such* that *|N**C**(x)|* *= i and* *C[N**C**(x)] is* connected. Let *N*_{G}^{i,j}*(C)*
with 1 *≤ i* *≤ j ≤ 2 consist* of the nodes *x* *∈ N**G**(C)\ M**G**(C) such* that *C[N*_{C}*(x)]*

is not connected and the two connected components of *C[N**C**(x)] has* *i and* *j nodes,*
respectively.Wehave

*N**G**(C) = N*_{G}^{1}*(C)∪ N**G*^{2}*(C)∪ N**G*^{3}*(C)∪ N**G*^{4}*(C)∪ N**G*^{1,1}*(C)∪ N**G*^{1,2}*(C)*

*∪ N**G*^{2,2}*(C)∪ M**G**(C).* (1)

We say that *C is* a *clean hole* *of G if* *M**G**(C)* *= N*_{G}^{2,2}*(C)* = ∅. We say that *C is*
a *u*_{1}*u*_{2}*u*_{3}*-hole of G if* *u*_{1}*u*_{2}*u*_{3} is a 3-path of *C and* *C is* a clean shortest even hole
*of G.* Forinstance,if*G is*as showninFig. 1, *then C = v*1*c*2*c*3*v*2*c*7*c*8*v*1 is a*v*1*c*2*c*3-hole

Fig. 2. (a) Abeetle*B,*where*B[{b*1*,**b*2*,**b*3*,**b*4*}] is*adiamond.(b) If*x**∈ N**G*^{4}*(C),*then*G[C∪{x}] is*a*beetle B,*
where*B[{u*1*,**u*2*,**u*3*,**x}] is*adiamond.(c) A node*x**∈ N**G*^{1,2}*(C).*

*of G.* If *H is* an induced subgraph *of G and* *u*_{1}*u*_{2}*u*_{3} is a 3-path *of H,* then we call
*(H,u*_{1}*u*_{2}*u*_{3}) a*tracker of G.A tracker (H,u*_{1}*u*_{2}*u*_{3}*) of G islucky if*thereisa*u*_{1}*u*_{2}*u*_{3}-hole
*of H.*If thereareluckytrackers*of G,*then*G contains*evenholes.Therefore,a setT of
trackers*of G satisfying*thefollowingeven-hole-preservingconditionreducestheproblem
of determining whether *G is* even-hole-freeto the problem of determining whether all
trackers inT arenotlucky:

*Condition L1: IfG contains*evenholes,thenatleastoneelementofT isaluckytracker
*of G.*

Aninducedsubgraph*B of G is* a*beetle of G ifB consists* of(1) a 4-cycle *b*1*b*2*b*3*b*4*b*1

withexactlyonechord*b*2*b*4(i.e.,*a diamond*[16,30]*of G)*and(2) a tree*I ofG\{b*4*} having*
exactlythree*leaves b*_{1},*b*_{2},and*b*_{3}withthepropertythat*I\{b*1*,b*_{2}*,b*_{3}*} is*aninducedtree
*of G not*adjacentto*b*_{4}.SeeFig. 2(a)foranillustration.Node*b*_{5}(respectively,*b*_{6}and*b*_{7})
istheneighborof*b*_{1}(respectively,*b*_{2}and*b*_{3})in*I.*Node*b*_{8}istheonlydegree-3 node*of I.*

Note thatatleastoneofthethreecyclesin*B\ {b*2*},B\ {b*1*,b*4*},*and*B\ {b*3*,b*4*} is* an
evenhole*of G.*Nodes*b*5,*b*6,*b*7,and*b*8neednotbedistinct.Forinstance,as illustrated
by Fig. 2(b),if*C is* ahole*of G andx is* anode of*N*_{G}^{4}*(C),*then *G[C∪ {x}] is*abeetle
*of G.*

Lemma2.2.*IfG isabeetle-freegraph,thenN**G**(C)⊆ N*_{G}^{1,1}*(C)∪N**G*^{1}*(C)∪N**G*^{2}*(C)∪N**G*^{3}*(C)*
*holds* *forany* *cleanshortesteven* *holeC of G.*

Proof. By*M*_{G}*(C)= N*_{G}^{2,2}*(C)*=∅ andEq.(1),itsuﬃcesto show*N*_{G}^{1,2}*(C)= N*_{G}^{4}*(C)*=

∅. *If x* *∈ N**G*^{4}*(C) as* illustrated by Fig. 2(b), then *G[C∪ {x}] is* abeetle *of G,* a con-
tradiction. *If x* *∈ N**G*^{1,2}*(C),*then let *u,* *v*_{1}, and *v*_{2} be the nodes of *N*_{C}*(x) such* that*v*_{1}
and *v*2 are adjacent in *C,* as illustrated by Fig. 2(c). Let *P*1 be the path *of C* *\ {v*2*}*
between*u andv*1.Let*P*2 bethepath*of C\ {v*1*} between* *u andv*2.Either*G[{x}∪ P*1]
or *G[{x}∪ P*2] isanevenhole*of G shorterthan C,*a contradiction. 2

*2.1.* *Proving* *Theorem 1.1*

Lemma 2.3. *It* *takes* *O(m*^{3}*n*^{5}*) time* *to* *complete* *either* *one* *of* *the* *following* *tasks* *for*
*any* *n-node* *m-edge* *graph* *G.* *Task 1:* *Ensuring* *that* *G contains* *even* *holes.* *Task 2:*

*(a) EnsuringthatG isbeetle-freeand(b) obtainingasetT ofO(m*^{2}*n) trackersof G that*
*satisﬁesCondition L1.*

Lemma2.4. *Given* *atracker* *T = (H,u*_{1}*u*_{2}*u*_{3}*) of* *ann-node* *m-edge* *beetle-freegraph* *G,*
*ittakesO(mn*^{4}*) timetoeither* *ensurethatH containsevenholesorensurethatT isnot*
*lucky.*

Proof of Theorem 1.1. We apply Lemma 2.3 on *G in* *O(m*^{3}*n*^{5}) time. If Task 1 is
completed, then the theorem is proved. If Task 2 is completed, then *G is* beetle-free
and we have aset T of *O(m*^{2}*n) trackers* *of G that* satisﬁes Condition L1. ByCondi-
tion L1ofT andLemma 2.4,onecandeterminewhether*G contains*evenholesintime

*|T|· O(mn*^{4})*= O(m*^{3}*n*^{5}). 2

3. ProvingLemma 2.3

A *clique of G is* a complete subgraph *of G.* A clique *of G is* *maximal if* it is not
contained by other cliques *of G.* We need the following theorem and three lemmas to
proveLemma 2.3.

Theorem 3.1 *(Chudnovsky* *and* *Seymour* *[10]).* *Letz*1*,* *z*2*,and* *z*3 *be* *three* *nodes* *of* *an*
*n-node* *graph.* *It* *takesO(n*^{4}*) time* *todetermine* *whether* *thegraph* *contains* *an* *induced*
*treeI with* *{z*1*,z*2*,z*3*}⊆ V (I).*

Lemma 3.2 *(Farber* *[23,* *Proposition 2]* *and* *da Silva* *and* *Vušković* *[20]).* *Let* *G be* *an*
*n-nodem-edge* *4-hole-freegraph.IttakesO(mn*^{2}*) timetoeither* *ensurethat* *G contains*
*evenholes* *orobtain* *allO(n*^{2}*) maximal* *cliques* *of G.*

Lemma3.3 *(da Silva* *andVušković* *[20]).The* *number* *of* *maximal* *cliques* *in* *ann-node*
*m-edgeeven-hole-free* *graph* *isatmostn+ 2m.*

Lemma3.4*(Chudnovsky,Kawarabayashi,andSeymour[7,Lemma 4.2]).Forany* *short-*
*est* *even* *hole* *C of* *a* *4-hole-free* *graph* *G,* *there* *is* *an* *edge* *v*_{1}*v*_{2} *of* *C with* *N*_{G}^{2,2}*(C)* *⊆*
*N*_{G}*(v*_{1})*∩ N**G**(v*_{2}*).*

Lemma3.5. *For* *any* *shortesteven* *hole* *C ofa4-hole-freegraph* *G,* *ifG[M*_{G}*(C)] is* *not*
*acliqueof G,* *thenthere* *isanodeu of* *C withM**G**(C)⊆ N**G**(u).*

Before working on the proof of Lemma 3.5, we ﬁrst proveLemma 2.3 using Theo- rem 3.1andLemmas 3.2, 3.3, 3.4, and 3.5.

ProofofLemma2.3. Weclaimthat*G contains*beetlesifandonlyifatleastoneofthe
*O(m*^{3}*n) choices*ofnode*b*4 andthreedistinctedges*b*1*b*5,*b*2*b*6,and*b*3*b*7*of G satisﬁes*all
of thefollowing fourconditions:

*• G[{b*1*,b*_{2}*,b*_{3}*,b*_{4}*}] is*the4-cycle*b*_{1}*b*_{2}*b*_{3}*b*_{4}*b*_{1} withexactlyonechord *b*_{2}*b*_{4}.

• Theedgesbetween*{b*1*,b*_{2}*,b*_{3}*} and{b*5*,b*_{6}*,b*_{7}*} are*exactly*b*_{1}*b*_{5},*b*_{2}*b*_{6},and*b*_{3}*b*_{7}.

• *{b*5*,b*6*,b*7*}∩ {b*1*,b*2*,b*3*,b*4*}*=∅,butnodes *b*5,*b*6,and*b*7 neednotbe distinct.

• There is an induced tree *I** ^{}* of

*G*

*\ ((N*

*G*

*[b*1]

*∪ · · · ∪ N*

*G*

*[b*4])

*\ {b*5

*, b*6

*, b*7

*}) with*

*{b*5

*,b*6

*,b*7

*}⊆ V (I*

*).*

^{}The claim can be veriﬁed by seeing that if *I** ^{}* is the minimal subtree of

*I*

*satisfying*

^{}*{b*5

*,b*

_{6}

*,b*

_{7}

*}⊆ V (I*

*),then*

^{}*I = I*

^{}*∪ {b*1

*b*

_{5}

*,b*

_{2}

*b*

_{6}

*,b*

_{3}

*b*

_{7}

*} is*atree of

*G\ {b*4

*} with*leaf set

*{b*1

*,b*

_{2}

*,b*

_{3}

*} having*thepropertythat

*I\ {b*1

*,b*

_{2}

*,b*

_{3}

*} is*aninducedtree

*of G not*adjacent to

*b*4.BytheclaimaboveandTheorem 3.1,it

*takes O(m*

^{3}

*n*

^{5}) timetodeterminewhether

*G contains*beetles. It takes

*O(n*

^{4}) time to determine whether

*G contains*4-holes. If

*G contains*4-holes or beetles, then

*G contains*even holes. The lemma is proved by completingTask 1in

*O(m*

^{3}

*n*

^{5}) time.Therestoftheproofassumesthat

*G is*4-hole-free and beetle-free.

By Lemma 3.2, it takes *O(mn*^{2}) time to either ensure that *G contains* even holes
or obtainthe*O(n*^{2}) maximal cliques*of G.* If*G contains*even holes,thenthe lemmais
provedbycompletingTask 1in*O(mn*^{2}) time.Otherwise,wehaveallthe*O(n*^{2}) maximal
cliques*of G.*Ifthenumberofmaximalcliquesin*G is*largerthan*n+2m,*thenLemma 3.3
impliesthat*G contains*evenholes,alsoprovingthelemmabycompletingTask 1.Ifthe
number of maximal cliquesin *G isn+ 2m or* fewer, then let T consistof the trackers
*of G that* areintheform *of (G\ S*1*,u*_{1}*u*_{2}*u*_{3}*) or (G\ S*2*,u*_{1}*u*_{2}*u*_{3}) with

*S*1 *= S*1*(u*1*, u*2*, u*3*, v*1*, v*2*) = (N**G**(v*1)*∩ N**G**(v*2))*∪ (N**G**(u*2)*\ {u*1*, u*3*});*

*S*_{2} *= S*_{2}*(u*_{1}*, u*_{2}*, K)* *= (N*_{G}*(u*_{1})*∩ N**G**(u*_{2}))*∪ V (K),*

where *u*1*u*2 and *v*1*v*2 are edges *of G and* *K is* amaximal clique *of G.* We have*|T|* =
*O(m*^{2}*n).*Since all*O(n+ m) maximal*cliques*of G are* available,T canbecomputed in
time*O(m*^{2}*n)· O(n+ m)= O(m*^{3}*n) time.*ToensurethecompletionofTask 2,itremains
toprovethatT satisﬁesCondition L1.Supposethat*G contains*evenholes.Let*C be*an
arbitraryshortestevenhole*of G.*Thefollowingcaseanalysisshowsthattherearelucky
trackers *of G in*T.

*Case 1:M**G**(C)⊆ N**G**(u*2*) holdsforanodeu*2 *of C.*Let*u*1and*u*3betheneighborsof
*u*2*in C.*By*M**G**(C)⊆ N**G**(u*2)*\ {u*1*,u*3*} and*Lemma 3.4,thereisanedge*v*1*v*2of*C with*
*M**G**(C)∪N*_{G}^{2,2}*(C)⊆ S*1.Bythechoicesof*u*1and*u*3,wehave*(N**G**(u*2)*\{u*1*,u*3*})∩C = ∅.*

Since *v*_{1}*v*_{2} isanedgeofhole*C,*wehave*N*_{G}*(v*_{1})*∩ N**G**(v*_{2})*∩ C = ∅.* Thus,*S*_{1}*∩ C = ∅,*
implyingthat*C is*acleanholeof*G\ S*1and*u*_{1}*u*_{2}*u*_{3}isapathof*C.*Since*C is*ashortest
evenhole*of G,C is*alsoashortestevenholeof*G\ S*1.Therefore,*C is*a*u*_{1}*u*_{2}*u*_{3}-holeof
*G\ S*1.

Fig. 3. (a)Edge*u*1*u*2isagateofthe8-hole*C induced*bynodesotherthan*x*1and*x*2,whicharethemajor
nodes*of C.*(b) and(c)IllustrationsfortheproofofLemma 3.5.

*Case 2:* *M*_{G}*(C)* * N**G**(u) holds* *for* *all* *nodes* *u of C.* By Lemma 3.5, *G[M*_{G}*(C)]*

is a clique *of G.* Let *K be* a maximal clique *of G with* *M**G**(C)* *⊆ V (K).* Combining
with Lemma 3.4, there is an edge *u*1*u*2 of *C with* *M**G**(C)∪ N*_{G}^{2,2}*(C)* *⊆ S*2. We have
*V (K)∩ C = ∅ or* else *M*_{G}*(C)∩ C = ∅ implies* *M*_{G}*(C)* *⊆ V (K)\ {u}* *⊆ N**G**(u)*
for any node *u* *∈ V (K)∩ C,* a contradiction. Since *u*1*u*2 is an edge of *C,* we have
*N*_{G}*(u*_{1})*∩ N**G**(u*_{2})*∩ C = ∅.*Thus,*S*_{2}*∩ C = ∅,*implyingthat*C is*acleanholeof*G\ S*2.
Letting *u*3 be the neighbor of *u*2 in*C other* than *u*1, *u*1*u*2*u*3 is apath of *C.* Since *C*
isashortest evenhole*of G,* *C is* alsoashortest evenholeof *G\ S*2. Therefore,*C is* a
*u*1*u*2*u*3-holeof *G\ S*2. 2

Therestof thesectionproves Lemma 3.5.Anedge *u*1*u*2 ofhole*C is*a*gate* [7] of*C*
withrespectto majornodes*x*_{1} and*x*_{2} of*C if*bothofthefollowingconditionshold:

*Condition G1: There* aretwo edges *u*1*x*2 and *u*2*x*1 and atleast oneof edges *u*1*x*1 and
*u*_{2}*x*_{2}.

*Condition G2: There*is anode*u*0 of*C\ {u*1*,u*2*} such*that*x*1 (respectively,*x*2)isnot
adjacentto*C\ V (P*1) (respectively,*C\ V (P*2)),where *P*1 (respectively,
*P*_{2})isthepathof*C betweenu*_{2} (respectively,*u*_{1})and*u*_{0} thatpasses*u*_{1}
(respectively,*u*2).

SeeFig. 3(a)foranillustration.

Lemma3.6*(Chudnovskyet al.[7,Lemmas 2.3and 2.4]).The* *followingstatements* *hold*
*forany* *shortestevenhole* *C ofa4-hole-freegraph* *G:*

*1. Ifx*1*andx*2 *arenon-adjacentnodesofM**G**(C),thenthereisagateofC withrespect*
*tox*_{1} *andx*_{2} *in G.*

*2. IfX is* *asubsetof* *M*_{G}*(C) with|X|= 3 suchthat* *G[X] hasatmost* *oneedge,* *then*
*X* *⊆ N**G**(u) holdsforsomenode u of C.*

Fig. 4. Illustrations for the proof ofLemma 3.5.

ProofofLemma 3.5. Let*x*_{1}and*x*_{2}betwonon-adjacentnodesof*M*_{G}*(C).*Let*U consist*
of the *nodes u of* *C that* are adjacent to both of *x*_{1} and *x*_{2}. By Lemma 3.6(1), there
is agate*u*_{1}*u*_{2} *of C with* respect to *x*_{1} and *x*_{2}. We have ∅*= U ⊆ {u*1*,u*_{2}*,u*_{0}*},* where
*u*_{0} is anode of *C ensured*by Condition G2. Assume*u*_{0} *∈ U.* By Condition G1, *u*_{0} is
adjacent to*u*_{1} or*u*_{2} in*G or* elseoneof*u*_{1}*x*_{1}*u*_{0}*x*_{2}*u*_{1} and*u*_{2}*x*_{1}*u*_{0}*x*_{2}*u*_{2} wouldbe a4-hole
*of G.* If *u*_{0} is adjacent to *u*_{1} as illustrated by Fig. 3(b), then Condition G2 implies
*N*_{C}*(x*_{1}) = *{u*0*,u*_{1}*,u*_{2}*},* which contradicts with *x*_{1} *∈ M**G**(C).* If *u*_{0} is adjacent to *u*_{2}
as illustrated by Fig. 3(c), then Condition G2 implies *N*_{G}*(x*_{2}) = *{u*0*,u*_{1}*,u*_{2}*},* which
contradicts with *x*_{2} *∈ M**G**(C).* Therefore, *u*_{0} *∈ U,/* and thus *U* *⊆ {u*1*,u*_{2}*}.*The lemma
holds trivially if *|M**G**(C)|* = 2. To prove the lemma for *|M**G**(C)|* *≥ 3,* we ﬁrst show
the claim: *“Each* *node x∈ M**G**(C)\ {x*1*,x*_{2}*} is* *adjacent* *to U .”* If oneof *x*_{1} and *x*_{2} is
not adjacent*to x,* then theclaim followsfrom Lemma 3.6(2). If both of*x*1 and *x*2 are
adjacent *to x,* then eachnode *u∈ U is* adjacent*to x in* *G or*else *ux*1*xx*2*u is*a4-hole,
a contradiction.Theclaimisproved.

By the claim above, the lemma holds if *|M**G**(C)|* = 3 or *|U|* = 1. It remains to
consider thecaseswith *|M**G**(C)|≥ 4 and* *U ={u*1*,u*2*} (thus,*there areedges*u*1*x*1 and
*u*2*x*2) by showing that either *u*1 or *u*2 is adjacent to each node *x* *∈ M**G**(C).* Assume
*x*3*∈ M**G**(C)\ N**G**(u*2) and*x*4*∈ M**G**(C)\ N**G**(u*1) forcontradiction.Bytheclaimabove,
*u*1*x*3 and*u*2*x*4areedges*of G.*Weknow*x*3*∈ N/* *G**(x*4) orelse*u*1*u*2*x*4*x*3*u*1isa4-hole.See
Fig. 4(a).Observethat*x*4cannotbeadjacenttobothof*x*1and*x*2orelse*u*1*x*1*x*4*x*2*u*1is
a4-hole.*Case 1:x*4 *isnotadjacent* *tox*2.ByLemma 3.6(2),a node*u*3of*C is*adjacent
toallof*x*2,*x*3,and*x*4.Since*u*3 isadjacenttobothof*x*3and*x*4,wehave*u*3*∈ {u/* 1*,u*2*}.*

SeeFig. 4(b).If*u*2*u*3isanedgeof*C,*then*u*1*x*3*u*3*u*2*u*1isa4-hole;otherwise,*u*2*x*2*u*3*x*4*u*2

is a4-hole, a contradiction.*Case 2:* *x*4 *is* *notadjacent* *tox*1.ByLemma 3.6(2),a node
*u*3of*C is*adjacenttoall*of x*1,*x*3,and*x*4.Since*u*3isadjacenttobothof*x*3 and*x*4,we
have*u*3*∈ {u/* 1*,u*2*}.*SeeFig. 4(c).If *u*2*u*3 isanedge of*C,*then *u*1*x*3*u*3*u*2*u*1 isa4-hole;

otherwise,*u*2*x*1*u*3*x*4*u*2 isa4-hole,a contradiction. 2
4. ProvingLemma 2.4

Subset *S ofV (H) is*a*star-cutset* [11]ofgraph*H ifS⊆ N**H**[s] holds*forsome*node s*
*of S and* thenumberofconnectedcomponentsof*H\ S is*largerthanthat*of H.*

Lemma4.1. *Foranytracker* *T = (H,u*1*u*2*u*3*) of* *ann-node* *m-edge* *beetle-freeconnected*
*graph* *G,* *it* *takes O(mn*^{3}*) time* *to* *complete* *one* *of* *the* *following* *three* *tasks.* *Task 1:*

*Ensuring* *that* *H contains* *even* *holes.* *Task 2:* *Ensuring* *that* *T is* *not* *lucky.* *Task 3:*

*Obtaining* *an* *induced* *subgraph* *H*^{}*of H having* *no* *star-cutsetssuch* *that* *if* *T is* *lucky,*
*thenH*^{}*contains* *evenholes.*

Lemma 4.2. *It* *takes* *O(mn*^{4}*) time* *to* *determine* *if* *an* *n-node* *m-edge* *graph* *having* *no*
*star-cutsetscontainseven* *holes.*

Proofof Lemma 2.4. Weapply Lemma 4.1 ontheinput tracker*T = (H,u*1*u*2*u*3*) of G*
in *O(mn*^{3}) time. If Task 1 or 2 is completed, then the lemma is proved. If Task 3 is
completed,then since*H** ^{}* hasnostar-cutsets, Lemma 4.2 impliesthatittakes

*O(mn*

^{4}) time to determine whether

*H*

*contains even holes. Since*

^{}*H*

*is an induced subgraph*

^{}*of H,*if

*H*

*containsevenholes,thenso does*

^{}*H;*otherwise,

*T is*notlucky. 2

Section4.1proves Lemma 4.1.Section4.2proves Lemma 4.2.

*4.1.* *Proving* *Lemma 4.1*

Astar-cutset*S of*graph*H is* *full ifS = N*_{H}*[s] holds*forsomenode*s ofS.*Fullstar-
cutsetsinan *n-node* *m-edge*graphcanbe detected in*O(mn) time.* Node*x dominates*
*node y in*graph*H ifx= y and N**H**[y]⊆ N**H**[x].*Node*y isdominated inH if*somenode
*of H dominatesy in* *H.*Weneedthefollowing threelemmasto proveLemma 4.1.

Lemma 4.3 *(Chvátal* *[11,* *Theorem 1]).* *A* *graph* *having* *no* *dominated* *nodes* *and* *full*
*star-cutsetshas* *nostar-cutsets.*

Lemma 4.4. *If* *T = (H,u*1*u*2*u*3*) isa* *tracker* *of* *an* *n-node* *m-edge* *beetle-freeconnected*
*graph* *G,* *then* *ittakes O(mn*^{2}*) time* *to* *obtain* *atracker* *T*^{}*= (H*^{}*,u*^{}_{1}*u*^{}_{2}*u*^{}_{3}*) of G,* *where*
*H*^{}*isaninducedsubgraphof H havingnodominatednodes,suchthatifT islucky,then*
*soisT*^{}*.*

Proof. Weﬁrstprovethefollowingclaimforanybeetle-freegraph*H:“Ifanodex of H*
*dominates* *a* *node y ofa* *clean* *shortesteven* *hole* *C of H,* *then* *C*^{}*= H[C∪ {x}\ {y}]*

*is* *a* *clean* *shortest* *even* *hole* *of H.” Let* *u andv be* the neighbors of *y onC.* Since *C*
is ahole and *y* *∈ C,*we *know x* *∈ C,/* *implying x* *∈ N**H**(C).*Since *x dominates* *y and*

*|N**C**[y]|* = 3, there is a connectedcomponent *of C[N**C**(x)] having*at least 3 nodes.By
Lemma 2.2, we have *x* *∈ N**H*^{3}*(C),* implying *N*_{C}*(x)* = *{u,y,v}.* Thus, *C** ^{}* is a shortest
even hole

*of H.*Assume

*z*

*∈ M*

*H*

*(C*

*)*

^{}*∪ N*

*H*

^{2,2}*(C*

*) for contradiction.*

^{}*By y*

*∈ N*

*H*

^{3}

*(C*

*),*

^{}*z*

*= y.*By

*C\ {y}*

*= C*

^{}*\ {x},*exactly one of

*x and*

*y is*adjacent to

*z in*

*H or*else

*z*

*∈ M*

*H*

*(C)∪ N*

*H*

^{2,2}*(C),*contradicting the fact that

*C is*clean.

*Case 1:*

*z*

*∈ N*

*H*

^{2,2}*(C*

*).*

^{}*If z* *∈ N**H**(y)\ N**H**(x),*then we*have z* *∈ M**H**(C),*contradicting theassumption that*C*
isacleanhole*of H.If z∈ N**H**(x)\ N**H**(y),then z∈ N**H*^{1,2}*(C),*contradictingLemma 2.2.

Fig. 5. An illustration for the proof ofLemma 4.4.

*Case 2:* *z* *∈ M**H**(C** ^{}*). By

*|N*

*C*

^{}*(z)|*

*≥ 3 and*Lemma 2.1,

*|N*

*C*

^{}*(z)|*

*≥ 4.*By

*M*

_{H}*(C)*=

*N*

_{H}

^{2,2}*(C)*= ∅ and Lemma 2.2,

*|N*

*C*

*(z)|*

*≤ 3.*By

*C*

*\ {x}*

*= C*

*\ {y},*we have

*z*

*∈*

*N*

_{H}*(x)\ N*

*H*

*(y),|N*

*C*

*(z)|*= 3, and

*|N*

*C*

^{}*(z)|*= 4. ByLemma 2.2,

*z∈ N*

*H*

^{3}

*(C).*SeeFig. 5 for anillustration.Thus,

*C[N*

*C*

*(z)] is*a3-path,implyingthat

*H[C*

^{}*∪ {z}] is*abeetle

*B*

*of H in*which

*B[N*

*B*

*[z]] is*adiamond,a contradiction.Theclaimisproved.

Thealgorithmﬁrstiterativelyupdates*(H,u*_{1}*u*_{2}*u*_{3}) bythefollowingstepsuntil*H has*
nodominated nodes,andthenoutputstheresulting*(H,u*1*u*2*u*3) as*(H*^{}*,u*^{}_{1}*u*^{}_{2}*u*^{}_{3}):

*Step 1: Let* *x andy be*twonodes*of H such*that*x dominatesy.*

*Step 2: If*thereis an*i∈ {1,2,*3*} withy = u**i*,then let*u**i**= x.*

*Step 3: Let* *H = H\ {y}.*

It takes *O(mn) time*to detect nodes*x and* *y such* that*x dominates* *y.*Each iteration
of the loop decreases *|V (H)| by* onevia Step 3.Therefore, the overall runningtime is
*O(mn*^{2}).Graph*H** ^{}*isaninducedsubgraphoftheinitial

*H.H*

*hasnodominatednodes.It suﬃcestoensurethatifthetracker*

^{}*T = (H,u*1

*u*2

*u*3

*) of G at*thebeginningofaniteration islucky,thenthetrackerattheendoftheiteration,denoted

*T*

^{}*= (H*

^{}*,u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}),remains lucky.Let

*C be*a

*u*1

*u*2

*u*3-hole

*of H.*If

*y /∈ C,*then

*C is*a

*u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}-holeof

*H*

^{}*= H\{y}.*If

*y*

*∈ C,*thentheclaimaboveensuresthat

*C*

^{}*= H[C∪ {x}\ {y}] is*aclean shortesteven hole

*of H.*Since

*x dominatesy,*

*u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}isapathof hole

*C*

*. Thus,*

^{}*C*

*isa*

^{}*u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}-hole

*of H*

*. Eitherway,*

^{}*(H*

^{}*,u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}) islucky. 2

Lemma4.5.*If(H,u*_{1}*u*_{2}*u*_{3}*) isaluckytrackerofgraph* *G andS isafullstar-cutsetof H,*
*then* *oneof* *thefollowingtwoconditions* *holds:*

*Condition B1: For* *each* *u*1*u*2*u*3*-hole* *C of H,* *there* *exists* *aconnected* *component* *B of*
*H\ S satisfyingC⊆ H[B ∪ S].*

*Condition B2: There* *are* *two* *non-adjacent* *nodes* *s*1 *and* *s*2 *of* *S and* *two* *connected*
*componentsB*_{1} *andB*_{2} *of* *H\ S with{s*1*,s*_{2}*}⊆ N**H**(B*_{1}*) and{s*1*,s*_{2}*}⊆*
*N**H**(B*2*).*

Proof. Let *s be* a node of *S with* *N**H**[s]* *= S.* Let *C be* a *u*1*u*2*u*3-hole *of H.* Assume
thatCondition B1doesnothold withrespect to*C.* Thereexist twodistinct connected
components*B*1 and*B*2 of*H\ S such*that*V (C)∩ V (B*1)*= ∅ andV (C)∩ V (B*2)*= ∅.*

Thus,*C[S] has*atleasttwoconnectedcomponents.Let*s*_{1}and*s*_{2}betwonodesindistinct
connected componentsof *C[S].* By*{s*1*,s*_{2}*}⊆ N**H**[s],* we have*s* *∈ C or/* else *s,* *s*_{1}, and
*s*2 areinthesameconnectedcomponentof*C[S].*ByLemma 2.2,wehave*s∈ N**H*^{1,1}*(C),*
implying*{s*1*,s*2*}= V (C)∩S.*Itfollowsthatboth*s*1and*s*2areadjacenttoboth*B*1and
*B*2.Letpaths*P*1and*P*2bethetwoconnectedcomponentsof*C\{s*1*,s*2*}.*Oneof*P*1and
*P*_{2} hastobein*B*_{1}andtheotherof*P*_{1}and*P*_{2} hastobein*B*_{2}.Therefore,Condition B2
holds. 2

ProofofLemma 4.1. Let*T*_{0} betheinitialgiventracker*(H,u*_{1}*u*_{2}*u*_{3}*) of G.*Thealgorithm
iteratively updates *(H,u*1*u*2*u*3) by the following three steps until Task 1, 2, or 3 is
completed:

*Step 1: Apply* Lemma 4.4 in *O(mn*^{2}) time on tracker *T = (H,u*_{1}*u*_{2}*u*_{3}) to obtain a
tracker *T*^{}*= (H*^{}*,u*^{}_{1}*u*^{}_{2}*u*^{}_{3}*) of G,* where *H** ^{}* is an induced subgraph

*of H hav-*ing no dominated nodes, such that if

*T is*lucky, then so is

*T*

*. Determine in*

^{}*O(mn) time*whether

*H*

*hasfullstar-cutsets.If*

^{}*H*

*hasfullstar-cutsets,thenlet*

^{}*(H,u*1

*u*2

*u*3)

*= (H*

^{}*,u*

^{}_{1}

*u*

^{}_{2}

*u*

^{}_{3}) andproceed toStep 2;Otherwise, completeTask 3 byoutputting

*H*

*.*

^{}*Step 2: Let* *S be* a full star-cutset *of H.* If Condition B2 of Lemma 4.5 holds, then
complete Task 1byoutputting that*G contains*even holes.Otherwise,proceed
to Step 3.

*Step 3: If*eitheroneof thefollowing statementshold for*U ={u*1*,u*_{2}*,u*_{3}*}:*

*• U* *⊆ S and*aconnectedcomponent*B ofH\ S is*adjacenttoboth*u*_{1}and*u*_{3};

*• U* * S andU* *⊆ B ∪ S holds*foraconnectedcomponent*B ofH\ S,*

thenlet*H = H[B∪ S] and*proceedtothenextiterationoftheloop.Otherwise,
complete Task 2byoutputtingthat*T*0 isnotlucky.

Step 1 does notincrease *|V (H)|.*If Step 3 updates *H,* then *|V (H)| is*decreased byat
least one, since *H* *\ S has* more than one connected component. The algorithm halts
in*O(n) iterations.*Step 1 takes *O(mn*^{2}) time.Step 2takes *O(mn*^{2}) time:For anytwo
non-adjacentnodes *s*1and *s*2 in*S,* ittakes*O(m) time*to determinewhether*s*1 and*s*2

have two or more common neighboring connected components of *H* *\ S.* Step 3 takes
*O(m) time.*Theoverallrunningtimeis*O(mn*^{3}).

We ﬁrst show the following claim for each iteration of the algorithm: *“If* *the*
*(H,u*1*u*2*u*3*) atthebeginningofaniterationisaluckytrackerof G,then(1) theinterme-*
*diate(H,u*1*u*2*u*3*) throughouttheiterationremainsaluckytrackerof G,and(2) Step 3,*
*ifreached,proceedstothenextiteration.” It*suﬃcestoconsiderthesituationthatStep 3
isreachedandfocusontheupdateoperationthatreplaces*H withH[B∪ S] via*Step 3.

BydeﬁnitionofStep 2,Condition B2doesnothold.ByLemma 4.5,Condition B1holds.

Fig. 6. An illustration for the proof ofLemma 4.1.

Thatis, some*u*1*u*2*u*3-hole*C of H is* inaconnectedcomponent*B** ^{∗}* of

*H*

*\ S.*Weprove theclaimbyshowingthat

*B*

*hastobetheconnectedcomponent*

^{∗}*B ofH\ S in*Step 3.

Since *B*^{∗}*= B holds*triviallyforthecase *{u*1*,u*2*,u*3*} S,*we assume*{u*1*,u*2*,u*3*}⊆ S.*

If*s∈ C,*thenexactlytwonodesof*C are*adjacentto*s inH;*andotherwise,Lemma 2.2
impliesthat*s has*atmostthreeneighbors*of H inC.*Eitherway,wehave*|V (C)∩S|≤ 3.*

Since *u*_{1}*u*_{2}*u*_{3} is apath of even hole *C,* nodes *u*_{1} and *u*_{3} are not adjacent in*H.* Since
Condition B2 does not hold, at most one connected component *of H* *\ S can* be ad-
jacent to *both u*1 and *u*3 in *H.* By *V (C)* *⊆ B*^{∗}*∪ S and* *|V (C)∩ S|* *≤ 3,* we have
*(N**C**(u*1)*∪ N**C**(u*3))*\ {u*2*}⊆ B** ^{∗}*,implying

*B*

^{∗}*= B.*Theclaimisproved.

For the correctnessof the algorithm,we consider the three possible stepsvia which
the algorithm halts. Step 1: Since *H** ^{}* has no dominated nodes and full-star-cutsets,
Lemma 4.3impliesthat

*H*

*hasnostar-cutsets.Bytheclaimabove,Task 3iscompleted.*

^{}Step 2: Condition B2 holds. Let *P*1 be a shortest path between *s*1 and *s*2 in *H[B*1*∪*
*{s*1*,s*2*}].* Let *P*2 be a shortest path *between s*1 and *s*2 in *H[B*2 *∪ {s*1*,s*2*}].* Since *s*1

and *s*_{2} are not adjacent, at least oneof the three cycles of graph *P*_{1}*∪ P*2*∪ {ss*1*,ss*_{2}*}*
is an even hole *of H.* Since *H is* an induced subgraph *of G,* *G contains* even holes.

See Fig. 6foran illustration.Task 1is completed.Step 3: By theclaim above,if*T*0 is
lucky, then Step 3 always proceeds to the next iteration of the loop. Thus, Task 2 is
completed. 2

*4.2.* *ProvingLemma 4.2*

*4.2.1.* *Extendedclique* *trees*

Graph*H is*an*extendedcliquetree*[21]ifthereisaset*S of*twoorlessnodes*of H such*
thateach biconnectedcomponentof*H\ S is*aclique. da Silva and Vušković[21, §2.3]

described*an O(n*^{5})-timealgorithmtodeterminewhetheran*n-node*extendedcliquetree
containseven holes,whichcanactuallybeimplementedtorunin*O(n*^{4}) time.

Lemma 4.6. *It* *takes* *O(n*^{4}*) time* *to* *determine* *whether* *an* *n-node* *extended* *clique* *tree*
*contains* *evenholes.*

Proof. Let*H*_{0}bethe*n-node*extendedcliquetree.Let*x andy be*twonodesof*H*_{0} such
thateachbiconnectedcomponentof*H = H*0*\ {x,y} is*aclique.Fornodes*u andv of H,*