• No results found

Editing to Eulerian graphs

N/A
N/A
Protected

Academic year: 2021

Share "Editing to Eulerian graphs"

Copied!
16
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Contents lists available atScienceDirect

Journal

of

Computer

and

System

Sciences

www.elsevier.com/locate/jcss

Editing

to

Eulerian

graphs

Konrad

K. Dabrowski

a

,

,

Petr

A. Golovach

b

,

Pim van

’t

Hof

b

,

Daniël Paulusma

a

aSchoolofEngineeringandComputingSciences,DurhamUniversity,ScienceLaboratories,SouthRoad,DurhamDH13LE,UnitedKingdom bDepartmentofInformatics,UniversityofBergen,PB7803,5020Bergen,Norway

a

r

t

i

c

l

e

i

n

f

o

a

b

s

t

r

a

c

t

Articlehistory:

Received25October2014

Receivedinrevisedform 11September 2015

Accepted9October2015 Availableonline11November2015 Keywords:

Euleriangraphs Graphediting Polynomialalgorithm

The Eulerian Editing problem asks, given agraph G and an integer k, whether G can be modifiedintoanEulerian graphusingat most k edgeadditions andedgedeletions. Weshowthatthisproblemispolynomial-timesolvableforbothundirectedanddirected graphs.Wegeneralizetheseresultsforproblemswithdegreeparityconstraintsanddegree balanceconstraints,respectively.Wealsoconsiderthevariantswherevertexdeletionsare permitted. Combinedwithknownresults,thisleadstofull complexity classificationsfor bothundirectedanddirectedgraphsandforeverysubsetofthethreegraphoperations.

©2015ElsevierInc.All rights reserved.

1. Introduction

Graphmodificationproblemsplaya centralrole inalgorithmicgraphtheory,partlyduetothefact thatthey naturally ariseinnumerouspracticalapplications.A graphmodificationproblemtakesasinputagraph G andaninteger k,andasks whether G can be modified intoa graphbelongingto a prescribedgraph class

H

,usingat most k operationsofcertain allowedtypes.Themostcommonoperationsthatareconsideredinthiscontextareedgeadditions (

H

-Completion),edge deletions(

H

-EdgeDeletion),vertexdeletions(

H

-VertexDeletion),andacombinationofedgeadditionsandedgedeletions (

H

-Editing).Theintensive studyofgraph modificationproblemshas produceda plethora ofclassical andparameterized complexityresults(seee.g.[2–8,10,13,15–17,19,21–23,25,26]).

Anundirected(resp.directed)graph G isEulerianifitcontainsawalk thatbeginsandendswiththesamevertexand that uses everyedge (resp.arc) exactly once.As an immediateconsequence,an undirectedgraphis Eulerianifandonly ifitisconnectedandevery vertexhasevendegree.Similarly,a directedgraphisEulerianifitisstronglyconnected1 and

balanced,i.e.thein-degreeofeveryvertexequalsitsout-degree.Euleriangraphsformawell-knowngraphclassbothwithin algorithmicandstructuralgraphtheory.

Severalgroupsof authorshaveinvestigated theproblemof decidingwhether ornot agiven undirectedgraphcan be madeEulerianusinga smallnumberofoperations.Boesch et al.[2]presentedapolynomial-timealgorithm for Eulerian Completion,andCai andYang [5]showedthat theproblems EulerianVertexDeletion and EulerianEdgeDeletionare NP-complete[5].Whenparameterizedbythenumber k ofallowedoperations,itisknownthat EulerianVertexDeletion

Theresearch leadingtotheseresults hasreceivedfundingfrom theEuropeanResearch Councilunderthe EuropeanUnion’sSeventhFramework Programme(FP/2007–2013)/ERCGrantAgreementno. 267959andfromEPSRCGrantEP/K025090/1.Anextendedabstractofthispaperappearedinthe proceedingsofFSTTCS2014[9].

*

Correspondingauthor.

E-mailaddresses:konrad.dabrowski@durham.ac.uk(K.K. Dabrowski),petr.golovach@ii.uib.no(P.A. Golovach),pim.vanthof@ii.uib.no(P. van’tHof), daniel.paulusma@durham.ac.uk(D. Paulusma).

1 Replacing“stronglyconnected”by“weaklyconnected”yieldsanequivalentdefinitionofEuleriandigraphs,asitiswell-knownthatabalanceddigraph isstronglyconnectedifandonlyitisweaklyconnected(seee.g.[8]).

http://dx.doi.org/10.1016/j.jcss.2015.10.003 0022-0000/©2015ElsevierInc.All rights reserved.

(2)

is W[1]-hard [5],while EulerianEdgeDeletionis fixed-parametertractable [8]. Cyganet al. [8]showedthatthe classical andparameterizedcomplexityresultsfor EulerianVertexDeletionand EulerianEdgeDeletionalsoholdforthedirected variants oftheseproblems.Recently, Goyalet al. [17] improvedthefixed-parametertractability resultsofCygan et al.[8]

forthedirectedandundirectedvariantsof EulerianEdgeDeletionbygivingalgorithmswithrunningtimesthatare single-exponential in k. The sameauthorsalso provedthat the UndirectedConnectedOddEdgeDeletionproblem, whichasks whetherit ispossible toobtain aconnectedgraphin whichall verticeshaveodd degreeby deletingatmost k edges, is fixed-parametertractablewhenparameterizedby k.

AnotherproblemthatcanbeseenasinvolvingeditingtoanEulerianmultigraphisthe ChinesePostmanproblem,also knownasthe RouteInspectionproblem[20].Inthisproblemaconnectedgraph G,togetherwithaninteger k,isgivenand thequestioniswhetherornotthereexistsaclosedwalkin G thatuseseveryedgeof G atleastonceandthathaslengthat most

|

E

(

G

)

|

+

k.Inotherwords,canweaddatotalofatmost k copiesofexistingedgesto G inordertomodify G intoan Eulerianmultigraph?EdmondsandJohnson[12]showedthatboththeundirectedanddirectedvariantofthisproblemcan be solved inpolynomial time. The RuralPostmanproblemgeneralizesthe ChinesePostmanproblem, asitrequires that onlyeveryedgeofsomesubsetof E

(

G

)

needstobeusedatleastonceintheclosedwalk.Dornet al.[10]provedthatthe RuralPostmanisfixed-parametertractablefordirectedmultigraphswhenparameterizedbythenumberofarcsthatmay beadded.

Ourcontribution Wegeneralize, extendandcomplementknownresultsongraphmodificationproblemsdealing with Eu-lerian graphs and digraphs.The main contribution ofthis paper consistsof two non-trivialpolynomial-time algorithms: one forsolving the EulerianEditing problem, andone forsolving thedirected variantofthisproblem. Giventhe afore-mentioned NP-completenessresultfor EulerianEdgeDeletionandthefactthat

H

-Editing is NP-completeformanygraph classes

H

[3,26],wefinditparticularlyinterestingthat EulerianEditing turnsouttobepolynomial-timesolvable.Tothe best ofourknowledge,theonlyother naturalnon-trivialgraphclass

H

forwhich

H

-Editing isknowntobe polynomial-timesolvableistheclassofsplitgraphs[18].

In fact, ourpolynomial-timealgorithms are implications oftwo more generalresults.In orderto formally state these results, we need to introduce some terminology. Let ea, ed and vd denote the operations edge addition, edge deletion and vertexdeletion, respectively. Forany set S

⊆ {

ea

,

ed

,

vd

}

andnon-negative integer k, we say that a graph G canbe

(

S

,

k

)

-modified intoagraph H if H canbeobtainedfrom G byusingatmost k operationsfrom S.Wedefinethefollowing problemforevery S

⊆ {

ea

,

ed

,

vd

}

:

CDPE

(

S

)

: Connected Degree Parity Editing

(

S

)

Instance: A (simple) graph G, an integer k and a function

δ

: V

(

G

)

→ {

0

,

1

}

.

Question: Can G be

(

S

,

k

)

-modified into a connected graph H with dH

(

v

)

≡ δ(

v

) (

mod 2

)

for each v

V

(

H

)

?

Inspired by thework of Cygan et al. [8]on directed Euleriangraphs, we also studya naturaldirected variant of the CDBE

(

S

)

problem. Denoting the in- and out-degreeof a vertex v ina digraph G by din

G

(

v

)

and doutG

(

v

)

, respectively, we

definethefollowingproblemforevery S

⊆ {

ea

,

ed

,

vd

}

:

CDBE

(

S

)

: Connected Degree Balance Editing

(

S

)

Instance: A (simple) digraph G, an integer k and a function

δ

: V

(

G

)

→ Z

.

Question: Can G be

(

S

,

k

)

-modified into a weakly connected digraph H with doutH

(

v

)

dinH

(

v

)

= δ(

v

)

for each

v

V

(

H

)

?

In Section 3, we prove that CDPE

(

S

)

can be solved in polynomial time when S

= {

ea

}

and when S

= {

ea

,

ed

}

. The first ofthesetwo results extendsthe resultby Boesch et al.[2]on EulerianCompletion andthesecond yields the first polynomial-time algorithm for EulerianEditing, astheseproblems are equivalent to CDPE

(

{

ea

})

andCDPE

(

{

ea

,

ed

})

, re-spectively, whenweset

δ

0 (i.e. when

δ(

v

)

=

0 forevery v

V

(

G

)

).Thecomplexity oftheproblemdrasticallychanges when vertex deletion is allowed: we prove that forevery subset S

⊆ {

ea

,

ed

,

vd

}

with vd

S, the CDPE

(

S

)

problem is NP-completeand W[1]-hardwithparameter k,evenwhen

δ

0.ThiscomplementsresultsbyCaiandYang[5]statingthat CDPE

(

S

)

is NP-completeand W[1]-hardwithparameter k when S

= {

vd

}

and

δ

0 or

δ

1.Ourresults,together withthe

(3)

Table 1

AsummaryoftheresultsforCDPE(S)andCDBE(S).All results arenewexceptthosefor which areferenceis given.The numberofallowedoperations k isthe pa-rameterintheparameterizedresults,andifa parame-terizedresultisstated,thenthecorrespondingproblem is NP-complete. S CDPE(S) CDBE(S) ea,ed P P ea P P ed FPT[8] FPT[8] vd W[1]-hard[5] W[1]-hard[8] ea,vd W[1]-hard W[1]-hard ed,vd W[1]-hard W[1]-hard ea,ed,vd W[1]-hard W[1]-hard

aforementionedresults duetoCygan et al.[8]2 andCai andYang[5],yield acomplete classificationofboth theclassical

andtheparameterizedcomplexityofCDPE

(

S

)

forall S

⊆ {

ea

,

ed

,

vd

}

;seethemiddlecolumnofTable 1.

InSection4,weusedifferentandmoreinvolvedargumentstoclassifytheclassicalandparameterizedcomplexityofthe CDBE

(

S

)

problemforall S

⊆ {

ea

,

ed

,

vd

}

.Interestingly,theclassificationweobtainforCDBE

(

S

)

turnsouttobeidenticalto theoneweobtainedforCDPE

(

S

)

.Inparticular,ourproofofthefactthatCDBE

(

S

)

ispolynomial-timesolvablewhenS

= {

ea

}

andS

= {

ea

,

ed

}

impliesthatthedirectedvariantsof EulerianCompletionand EulerianEditingarenotsignificantlyharder thantheirundirectedcounterparts.AllresultsonCDBE

(

S

)

aresummarizedintherightcolumnofTable 1.

We would like to emphasize that there are no obvious hardness reductions between the different problemvariants. Theparameter k in theproblemdefinitionsrepresentsthebudgetforalloperationsintotal;addinganewoperationto S maycompletelychangethe problem,asthereis nowayofforbiddingitsuse.Hence, ourpolynomial-timealgorithmsfor CDPE

(

{

ea

,

ed

})

andCDBE

(

{

ea

,

ed

})

do notgeneralize the polynomial-timealgorithmsfor CDPE

(

{

ea

})

andCDBE

(

{

ea

})

,and assuchrequiresignificantlydifferentarguments.Inparticular,ourmainresult,statingthat EulerianEditingis polynomial-time solvable, is nota generalization ofthe fact that EulerianCompletionispolynomial-timesolvable andstands inno relationtothe FPT-resultbyCyganet al.[8]for EulerianEdgeDeletion.

Weendthissectionbymentioningtwosimilargraphmodificationframeworksintheliteraturethatformedadirect mo-tivationfortheframeworkdefinedinthispaper.MathiesonandSzeider[23]consideredthe DegreeConstraintEditing(S) problem, whichisthatoftestingwhetheragraph G canbe

(

S

,

k

)

-modifiedintoa graph H inwhich thedegreeofevery vertexbelongstosomelistassociatedwiththatvertex;recentlysomenewresultsforthisproblemwereobtainedbyFroese et al.[13]andGolovach[16].Golovach[15]performedasimilarstudytothatofMathiesonandSzeider [23],butwiththe additionalconditionthattheresultinggraphmustbeconnected.

2. Preliminaries

We considerfinitegraphs G

= (

V

,

E

)

that maybe undirectedor directed;in thelattercasewe will always callthem digraphs.Allourundirectedgraphswillbesimple,thatis,withoutloopsormultipleedges;inparticular,thisisthecasefor both theinputandtheoutput graphinevery undirectedproblemweconsider. Similarly,forevery directedproblemthat we consider,we onlyconsider simpledigraphs,that is,we donot allowthe input oroutputdigraph to containmultiple arcs(butwedoallow oppositearcs).Inourproofswewillalsomakeuseofdirectedmultigraphs,whicharedigraphsthat arepermittedtohavemultiplearcs.

The completegraph on n verticesis denoted Kn and thecomplete bipartite graphwithclasses ofsize s and t is

de-noted Ks,t.Thelength ofapathorcycleisequaltothenumberofedgesthatitcontains.

Wedenoteanedgebetweentwovertices u and v inagraphby uv.Wedenoteanarcbetweentwovertices u and v by

(

u

,

v

)

,where u isthetail of

(

u

,

v

)

and v isthehead.Wesaythataset A ofarcsoredgeshassize

|

A

|

.Thedisjointunion oftwographs G1 and G2isdenotedG1

+

G2.

Let G

= (

V

,

E

)

be a graphor a digraph. Throughout thepaper we assume that n

= |

V

|

andm

= |

E

|

.For U

V ,we let G

[

U

]

bethegraph(digraph)withvertexset U andanedge(arc)betweentwovertices u and v ifandonlyifthisisthe casein G; wesaythat G

[

U

]

isinducedby U .Wewrite G

U

=

G

[

V

\

U

]

.ForE

E,we let G

(

E

)

be thegraph(digraph) withedge(arc)set E whosevertexsetconsistsoftheend-vertices ofthe edgesin E; wesaythat G

(

E

)

isedge-induced by E.Let S beasetof(ordered)pairsofverticesof G.WeletG

S bethegraph(digraph)obtainedbydeletingalledges (arcs)of S

E from G,andweletG

+

S bethegraph(digraph)obtainedbyaddingalledges(arcs)of S

\

E to G.Wemay write G

e or G

+

e if S

= {

e

}

.

LetG

= (

V

,

E

)

beagraph.A component of G isamaximalconnectedsubgraphof G.Thecomplement of G isthegraph

G

= (

V

,

E

)

withvertexset V andanedgebetweentwodistinctvertices u and v ifandonlyif uv

/

E.Foravertexv

V ,

2 The FPT-resultsbyCyganet al.[8]onlycoverCDPE({ed})andCDBE({ed})whenδ0,butitcaneasilybeseenthattheirresultscarryoverto CDPE({ed})andCDBE({ed})foranyfunctionδ.

(4)

we let NG

(

v

)

= {

u

|

uv

E

}

denoteits (open)neighbourhood.The degree of v isdenoteddG

(

v

)

= |

NG

(

v

)

|

.The graph G is even ifall itsverticeshaveevendegree,anditisEulerian ifit isevenandconnected.Wesaythat aset D

E isan edge cut-set in G ifG

D hasmorecomponentsthan G.Anedgecut-setofsize 1 issaidtobeabridge.

Amatching ofa graph G isaset ofedges,inwhichnotwo edgeshaveacommonend-vertex; itiscalledamaximum

matching ifits numberof edges ismaximum overall matchings of G.We need the followinglemma dueto Micaliand Vazirani.

Lemma1.([24]) Amaximummatchingofann-vertexgraphcanbefoundin O

(

n5/2

)

time.

Let G

= (

V

,

E

)

be adigraph. If

(

u

,

v

)

isan arc, then

(

v

,

u

)

isthe reverse ofthisarc. Fora subset F

E, we let FR

=

{(

u

,

v

)

|(

v

,

u

)

F

}

denote the setof arcswhose reverse isin F . The underlying graph of G is theundirected graphwith vertexset V wheretwoverticesu

,

v

V areadjacentifandonlyif

(

u

,

v

)

or

(

v

,

u

)

isanarcin G.Wesaythat G is(weakly) connected if its underlying graphis connected.A component of G is a connected componentof its underlyinggraph. An arc a

E is a bridge in G ifit is a bridge inthe underlying graphof G. A vertex u isan in-neighbour orout-neighbour

of avertex v if

(

u

,

v

)

E or

(

v

,

u

)

E,respectively. LetNinG

(

v

)

= {

u

| (

u

,

v

)

E

}

andNoutG

(

v

)

= {

u

| (

v

,

u

)

E

}

,where we call dinG

(

v

)

= |

NinG

(

v

)

|

and doutG

(

v

)

= |

NoutG

(

v

)

|

the in-degree and out-degree of v, respectively. A vertex v

V is balanced

if doutG

(

v

)

=

dGin

(

v

)

,or equivalently,its degreebalance doutG

(

v

)

dinG

(

v

)

=

0.Recall that G is Eulerian if it is connectedand

balanced,thatis,theout-degreeofeveryvertexisequaltoitsin-degree.

Let G

= (

V

,

E

)

be a graph and let T

V . A subset J

E is a T -join if the set of odd-degree vertices in G

(

J

)

is precisely T . If G is connectedand

|

T

|

is eventhen G has atleast one T -join. InSection 3 we need to finda minimum T -join,thatis,oneofminimumsize.WeusethefollowingresultofEdmondsandJohnson [12]todoso.

Lemma2.([12]) LetG

= (

V

,

E

)

beagraph,andletT

V .ThenaminimumT -join(ifoneexists)canbefoundin O

(

n3

)

time. Lemma 2wasusedbyCyganet al.[8]tosolve

H

-EdgeDeletioninpolynomialtimewhen

H

istheclassofevengraphs. Itwouldimmediatelyyieldapolynomial-timealgorithmforCDPE

(

{

ed

})

ifwedroppedtheconnectivitycondition.

WeneedavariantofLemma 2fordigraphsinSection4.LetG

= (

V

,

E

)

beadirectedmultigraphandlet f

:

T

→ Z

bea functionforsomeT

V .A multisetE

E withT

V

(

G

(

E

))

isadirectedf -join in G ifthefollowingtwoconditionshold:

doutG(E)

(

v

)

d

in

G(E)

(

v

)

=

f

(

v

)

forevery v

T and d

out

G(E)

(

v

)

d

in

G(E)

(

v

)

=

0 forevery v

V

(

G

(

E

))

\

T .A directed f -joinis

minimum ifithasminimumsize.ThenextlemmawasusedbyCyganet al.[8]tosolve

H

-EdgeDeletioninpolynomialtime when

H

istheclassofbalanced digraphs;itwouldalsoyieldapolynomial-timealgorithmforCDBE

(

{

ed

})

ifwedropped theconnectivitycondition.

Lemma3.([8]) LetG

= (

V

,

E

)

beadirectedmultigraphand f

:

T

→ Z

beafunctionforsomeT

V .A minimumdirected f -join F (ifoneexists)canbefoundinO

(

nmlog nlog log m

)

time.Moreover,F consistsofmutuallyarc-disjointdirectedpathsfromvertices u with f

(

u

)

>

0 tovertices v with f

(

v

)

<

0.

3. Connecteddegreeparityediting

LetS

⊆ {

ea

,

ed

,

vd

}

.InSection3.1wewillshowthatCDPE

(

S

)

ispolynomial-timesolvableifS

= {

ea

}

orS

= {

ea

,

ed

}

and inSection3.2wewillshowthatitis NP-completeand W[1]-hardwithparameter k ifvd

S.

3.1. Thepolynomial-timesolvablecases

First,let

{ea}

S

⊆ {ea

,

ed}.Let

(

G

,

δ,

k

)

bean instanceofCDPE

(

S

)

withG

= (

V

,

E

)

.Let A beasetofedgesnot in G, andlet D beasetofedgesin G,withD

= ∅

ifS

= {

ea

}

.Wesaythat

(

A

,

D

)

isasolution for

(

G

,

δ,

k

)

ifitssize

|

A

|

+ |

D

|

k,

the congruence dH

(

u

)

≡ δ(

u

) (

mod 2

)

holdsfor every vertex u and thegraph H

=

G

+

A

D is connected; ifwe drop

thecondition that H isconnectedthen

(

A

,

D

)

isasemi-solution for

(

G

,

δ,

k

)

.IfS

= {

ea

}

we maydenotethesolutionby A ratherthan

(

A

,

D

)

(sinceD

= ∅

).WeconsidertheoptimizationversionforCDPE

(

S

)

.Theinputisapair

(

G

,

δ)

,andweaim tofindtheminimum k suchthat

(

G

,

δ,

k

)

hasasolution(ifoneexists).Wecallsuchasolutionoptimal anddenoteitssize by optS

(

G

,

δ)

.We saythata(semi)-solutionfor

(

G

,

δ,

k

)

isalsoa(semi)-solutionfor

(

G

,

δ)

.If

(

G

,

δ,

k

)

hasnosolutionfor anyvalueof k,then

(

G

,

δ)

isano-instance ofCDPE

(

S

)

andoptS

(

G

,

δ)

= +∞

.

Let T

= {

v

V

|

dG

(

v

)

≡ δ(

v

) (

mod 2

)

}

.Define GS

=

Kn if S

= {

ea

,

ed

}

and GS

=

G if S

= {

ea

}

. Notethat if S

= {

ea

}

then GS containsnoedgesof G,sointhiscaseanyT -joinin GS canonlycontainedgesin E

(

G

)

.Thefollowingkeylemma

isaneasyobservation.

Lemma4.Let

{

ea

}

S

⊆ {

ea

,

ed

}

.Let

(

G

,

δ)

beaninstanceofCDPE

(

S

)

and A

E

(

G

)

,D

E

(

G

)

.Then

(

A

,

D

)

isasemi-solutionof CDPE

(

S

)

ifandonlyifA

D isaT -joinin GS.

(5)

WerecallthatBoesch et al.[2]provedthat EulerianCompletioncanbesolved inpolynomialtime, thatis,CDPE

(

S

)

is polynomialtimesolvableifS

= {

ea

}

and

δ

0.Weextendthisresulttoarbitrary

δ

.Ourproofisbasedaroundsimilarideas butwe alsohadtodosome furtheranalysis. Themaindifferenceinthetwoproofsisthefollowing.If

δ

0 thennoneof theaddededgesinasolutionwillbeabridge inthemodified graph(asthenumberofverticesofodddegreeinagraph isalwayseven).Howeverthisisnolongertrueforarbitrary

δ

andextraargumentsareneeded.Wethereforepresentafull proofofourresult.

Theorem1.LetS

= {

ea

}

.ThenCDPE

(

S

)

canbesolvedin O

(

n3

)

time.

Proof. Let S

= {

ea

}

andlet

(

G

,

δ)

bean instanceof CDPE

(

S

)

.We firstuseLemma 2to check in O

(

n3

)

time whether GS hasa T -join.Ifnot then

(

G

,

δ)

hasnosemi-solutionby Lemma 4,andthus nosolutioneither.Wemaythereforeassume that

|

T

|

isevenand F isaminimumT -joinin GS.(RecallthatLemma 2statesthatwecanfind F in O

(

n3

)

timeifitexists.)

Wealsoassumethateither T

= ∅

or G isnotconnected,otherwisethetrivialsolutionA

= ∅

isclearlyoptimal.Let p bethe numberofcomponentsof G thatdonotcontainanyvertexof T andlet q bethenumberofcomponentsof G thatcontain atleastonevertexof T .

Wewillprove thefollowingseriesofstatements.Undertheassumptions madeinthe previousparagraph,these state-mentsgivenecessaryandsufficientconditionsfor

(

G

,

δ)

tobeayes-instance,andif

(

G

,

δ)

isayes-instancetellustheexact sizeofanoptimalsolutionfor

(

G

,

δ)

.WerecallthatG1

+

G2denotesthedisjointunionoftwographs G1 and G2.

(

G

,

δ)

isano-instanceifp

=

2

,

q

=

0 andG

=

K1

+

Kt fort

1.

– optS

(

G

,

δ)

=

4 if p

=

2

,

q

=

0 andG

=

Ks

+

Kt fors

,

t

2.

– optS

(

G

,

δ)

=

3 if p

=

2

,

q

=

0 and G hasacomponentthatisnotcomplete.

– optS

(

G

,

δ)

=

p if p

3

,

q

=

0.

– optS

(

G

,

δ)

=

max

{|

F

|,

p

+

q

1

,

p

+

12

|

T

|}

ifq

>

0.

Wesplitourproofintotwopartsdependingonthevalueof q.

Case1: q

=

0.

In this case T

= ∅

, so by Lemma 4 for any semi-solution A, every vertex in GS

(

A

)

must have even degree in GS

(

A

)

.

In other words, every vertexof G must be incident to an even number ofedges in A. Since T

= ∅

,we assumedabove that G wasdisconnected,sop

2 andanysolution A mustbenon-empty.Thismeansthat GS

(

A

)

mustcontainacycle,so optS

(

G

,

δ)

3.Recallthat GS

(

A

)

isasubgraphof G.

Suppose p

=

2.IfG

=

K1

+

Kt fort

2 then G

=

K1,t,whichdoesnotcontainacycle.Therefore

(

G

,

δ)

isano-instance

in this case. If G

=

Ks

+

Kt for s

,

t

2 then G

=

Ks,t, which contains no cycles of length 3. Therefore optS

(

G

,

δ)

4

in this case. Indeed, if u

,

v are vertices in the Ks component of G and u

,

v are vertices in the Kt component, then A

= {

uu

,

uv

,

v v

,

vu

}

is a solution of size 4 and this solution must therefore be optimal. Finally, suppose G contains exactlytwocomponents,atleastoneofwhichisnotaclique.Let x

,

y benon-adjacentverticesinthiscomponentandlet z beavertexintheothercomponent.Then A

= {

xy

,

yz

,

zx

}

isasolutionofsize 3,whichmustthereforebeoptimal.

Finally,supposethat p

3.Since G

+

A mustbeconnectedforanysolution A,everycomponentin G mustcontainat leastonevertexincidenttoanedgeof A.ByLemma 4,thisvertexmustbeincidenttoanevennumberofedgesof A, mean-ingthat itmustbeincidenttoatleasttwosuchedges.Therefore optS

(

G

,

δ)

p.Indeed,ifwechoosevertices v1

,

. . . ,

vp,

onefromeachcomponentof G then A

= {

v1v2

,

v2v3

,

. . . ,

vp−1vp

,

vpv1

}

isasolutionofsize p,whichisthereforeoptimal. Thisconcludestheq

=

0 case.

Case2: q

>

0.

In this case T

= ∅

.We first show that optS

(

G

,

δ)

max

{|

F

|,

p

+

q

1

,

p

+

12

|

T

|}

. Since F is a minimum T -join in GS, Lemma 4impliesthatoptS

(

G

,

δ)

≥ |

F

|

.Since G has p

+

q components,anysolution A mustcontainatleastp

+

q

1 edges

toensure that G

+

A isconnected,so optS

(

G

,

δ)

p

+

q

1.Finally, let G1

,

. . . ,

Gp be thecomponentsof G that donot

containanyverticesof T .If A isasolutiontheneverycomponent Gi mustcontainavertexincidenttosomeedgein A.By Lemma 4,thisvertexmustbeincidenttoanevennumberofedgesof A,meaningthatitmustbeincidenttoatleasttwo suchedges.ByLemma 4,everyvertexof T mustbeincidenttosomeedgein A.Therefore A mustcontainatleastp

+

12

|

T

|

edges,sooptS

(

G

,

δ)

p

+

12

|

T

|

.

Nextweshowthatwecanalwaysconstructasolutionofsizemax

{|

F

|,

p

+

q

1

,

p

+

12

|

T

|}

.Todothis,wetrytoreplace edges of F insuch awaythat F remainsa minimum T -joinin GS,butthe numberofcomponentsin G

+

F isreduced.

Afterwehavefinishedthisprocess,ifG

+

F isconnectedthensettingA

=

F givesasolutionofsize

|

F

|

,whichistherefore optimal.Otherwise,wewillbeabletousethestructureof F toconstructasolutionofsizeeitherp

+

q

1 or p

+

12

|

T

|

.

Consider thegraph GS

(

F

)

.Since F isaminimum T -join, GS

(

F

)

cannotcontain anycycles(otherwise theedgesinthe

cyclecouldberemovedfrom F togiveasmallerT -join).Weprovethefollowingclaim.

(6)

Suppose,forcontradiction,thatthereissuchapathwithedgeset P andend-vertices u and v.Notethat u and v arein the samecomponentofG

+

F .Since G

+

F isnot connected(otherwise A

=

F wouldbe anoptimalsolutionofsize

|

F

|

), theremustbeavertexx

V

(

G

)

whichisinadifferentcomponentofG

+

F fromtheonecontaining u and v.Inthiscase

ux

,

xv

E

(

GS

)

.Let F

= (

F

\

P

)

∪ {

ux

,

xv

}

.Then F isalsoa T -join in GS,since thedegreeparityofanyvertexin G

+

F

isthesameasitsdegreeparityinG

+

F .However,

|

F

|

<

|

F

|

,whichcontradictsthefactthat F isaminimumT -join.This provesClaim 1.

Nowsupposethatu

,

v

,

u

,

varefourdistinctverticesin F withuv

,

uv

F ,suchthat uv isnotabridgeinG

+

F and

thevertices u and uareindifferentcomponentsofG

+

F .Let F

= (

F

\ {

uv

,

uv

})

∪ {

uv

,

uv

}

.Then Fisalsoaminimum

T -joinin GS.However,G

+

F hasonecomponentlessthanG

+

F .Indeed,since uv isnotabridgeinG

+

F ,thevertices u

,

u

,

v

,

v mustall be inthesamecomponentof G

+

F.Therefore,ifsuchedges uv

,

uv

F exist,we replace F by F. Wedothisexhaustivelyuntilnofurthersuchpairsofedgesexist.Atthispointeithereveryedgein F mustbeabridgeor everyedgein F isinthesamecomponentofG

+

F .Weconsiderthesepossibilitiesseparately.

First suppose that every edge in F is a bridge. Chooseuv

F andlet G1

,

. . . ,

Gk be the componentsof G

+

F , with u

,

v

V

(

G1

)

.Notethatsinceeveryedgein F isabridge,k

=

p

+

q

− |

F

|.

Nowlet vi

V

(

Gi

)

fori

∈ {2

,

. . . ,

k

}.

LetA

=

F if k

=

1 and A

= (

F

\ {

uv

})

∪ {

uv2

,

v2v3

,

. . . ,

vk−1vk

,

vkv

}

otherwise.Now everyvertexin G

+

A hasthesamedegreeparity

asinG

+

F ,so A isaT -joinin GS.ThegraphG

+

A isconnected,so A isasolution.However,

|

A

|

= |

F

|

1

+

p

+

q

− |

F

|

=

p

+

q

1.Therefore A isanoptimalsolution.

We maynowassume thateveryedgein F is inthesamecomponentofG

+

F .IfG

+

F isconnected,then A

=

F isa solutionofsize

|

F

|

andisthereforeoptimal,sowemayassumethatG

+

F isnotconnected.

Supposeuv

,

v w

F .Thenu w

E

(

G

)

,asotherwisewecouldreplace uv

,

v w in F by u w togetasmallerT -join in GS.

Suppose that uv

,

v w do not forman edge cut-set in G

+

F .In other words, we suppose that u and v are inthe same componentofG

+ (

F

\ {

uv

,

v w

})

.Let x beavertexinadifferentcomponentofG

+

F fromtheonecontainingu

,

v

,

w.Then

ux

,

xw

E

(

GS

)

.Let F

= (

F

\ {

uv

,

v w

})

∪ {

ux

,

xw

}

.Then F must alsobe a minimumT -joinin GS.However, G

+

F has

one lesscomponentthan G

+

F .Indeed,x is inthe samecomponentofG

+

F asu

,

v

,

w.Inthiscasewemayreplace F by F. Again, we apply this replacement exhaustively until it can no longer be applied. This process ends when either

G

+

F becomesconnected(inwhichcase A

=

F isan optimalsolutionofsize

|

F

|

)or,foreverypairofedgesoftheform

uv

,

v w

F ,wefindthat

{

uv

,

v w

}

isanedgecut-setinG

+

F .Wemayassumethelatteristhecase. Wewillprovethefollowingclaim.

Claim 2.Let uv

,

v w

F .Thenthecomponent C of G

+ (

F

\ {

uv

,

v w

})

thatcontains v containsnovertices of T .Moreover, dGS(F)

(

v

)

=

2 and v istheuniquevertexof GS

(

F

)

in C .

WeproveClaim 2asfollows.Wefirstshowthat C containsnoverticesof T .Suppose,forcontradiction,thatx

T

V

(

C

)

(x is notnecessarily distinctfrom v). Then byLemma 4, x mustbe theend-vertex ofsomeedge in F

\ {

uv

,

v w

}

,say xy (again y isnotnecessarilydistinctfrom v).Notethat x and y areinthesamecomponentofG

+ (

F

\ {

uv

,

v w

})

,whichis differentfromthecomponentcontaining u and w. Let F

= (

F

\ {

xy

,

uv

,

v w

})

∪ {

ux

,

w y

}

.Then F isalsoa T -join in GS,

but

|

F

|

= |

F

|

1,contradictingtheminimalityof F .Hence,C containsnoverticesof T .

ByClaim 1andthedefinitionofaT -join,everyvertexof GS

(

F

)

thatisnotin T musthaveaneighbourin T .Inparticular,

this meansthat inthe graph G

+ (

F

\ {

uv

,

v w

})

,no vertexof V

(

C

)

\ {

v

}

hasaneighbour in T andthe vertex v has no neighboursin T

\ {

u

,

w

}

,otherwiseinbothcasessuchaneighbourwouldbein C ,acontradiction.Thiscompletestheproof ofClaim 2.

Recall,thatbyClaim 1,GS

(

F

)

isaforestinwhicheachcomponentisastar.Then,byClaim 2,eachcomponentof GS

(

F

)

is in fact a path of length 1 or 2. Hence, GS

(

F

)

consists of 12

|

T

|

vertex-disjoint paths of length at most 2 with their

ends in T .Since GS

(

F

)

has

|

F

|

edges, GS

(

F

)

consistsof

|

T

|

− |

F

|

paths oflength 1 and

|

F

|

12

|

T

|

paths oflength 2.By Claim 2,themiddlevertexofeverypathoflength 2 liesinadifferentcomponentofthose p componentsof G thatdonot contain anyverticesof T .LetG0

,

G1

,

. . . ,

Gk be thecomponentsofG

+

F suchthat G0 istheonly componentcontaining vertices of T . Note that k

=

p

− (|

F

|

12

|

T

|)

. Let vi

V

(

Gi

)

for i

∈ {

1

,

. . . ,

k

}

. Choose uv

F and let A

= (

F

\ {

uv

})

{

uv1

,

v1v2

,

. . . ,

vk−1vk

,

vkv

}

. Then every vertexin G

+

A hasthe samedegree parity asin G

+

F and the graph G

+

A

is connected, so A isa solution. Furthermore,

|

A

|

= |

F

|

+

p

− (|

F

|

12

|

T

|)

=

p

+

12

|

T

|

,so A is an optimalsolution. This concludestheproofofCase 2.

Notethat p and q canbecomputedand T canbefoundin O

(

n

+

m

)

time.RecallthataminimumT -joinin GS canbe

found in O

(

n3

)

time by Lemma 2,sothe valueof optS

(

G

,

δ)

canbe computedin O

(

n3

)

time. Notethat theconstructive

proofsforCases 1and 2canbeturnedintoalgorithms.ForCase 1,ifp

=

2,thenwecancheckin O

(

n

+

m

)

timewhether ornot G isthedisjointunionoftwocliquesandeitherreturnano-answerorfindasolution.If p

3,thenwecanfinda solution in O

(

n

+

m

)

time.ForCase 2,observethat fora given F ,we canfindthecomponentsandthebridges ofG

+

F

in O

(

n2

)

time.Hence,asG

+

F hasatmost n components,glueingthesecomponentsofG

+

F vianon-bridgeedgesuv

F can be done in O

(

n3

)

time. Ifevery edge of F is a bridgeof G

+

F , then therest ofthe construction ofa solution can be done in O

(

n

)

time.Otherwise wedo asfollows.We partition theedges of GS

(

F

)

into pathsoflength 1 andpaths of

length 2 with their endsin T . This canbe done in O

(

n

)

time. The replacements ofpaths oflength 2 consisting oftwo edges uv

,

v w thatdonotformanedgecut-setofG

+

F bypairsofedgesux

,

xw thatdocanbedonein O

(

n3

)

time.After

(7)

this, wecan findanoptimalsolution in O

(

n

)

time.We concludethat an optimalsolution A canbe foundin O

(

n3

)

total

time.

2

Wearenowreadytopresentthemainresultofthissection.Provingthisresultrequiressignificantlydifferentarguments thantheonesusedintheproofofTheorem 1.LetS

= {

ea

,

ed

}

andlet

(

G

,

δ)

beaninstanceofCDPE

(

S

)

.If F isaT -join in

GS

=

Kn,let D

=

F

E

(

G

)

and A

=

F

\

D.ThenbyLemma 4,

(

A

,

D

)

isasemi-solution.Notethatif F isaminimumT -join

in GS thenitisamatchinginwhicheveryvertexof T isincidenttopreciselyoneedgeof F ,so

|

F

|

=

12

|

T

|

.Wewillshow

howthisallowsustocalculateoptS

(

G

,

δ)

directlyfromthestructureof G,withouthavingtofindaT -join.Notethatthere

isnoconnectedgraphonexactlytwoverticesinwhichboth verticeshaveodddegree.Similarly, nographcancontain an oddnumberofverticesofodddegree.Thismeansthatnot everyinstanceofCDPE

(

S

)

isayes-instance. However,wewill showthatallno-instancesaretrivial,thatis,theyoccurwhen

|

T

|

isoddor G containsonlytwovertices.

Theorem2.LetS

= {

ea

,

ed

}

.ThenCDPE

(

S

)

canbesolvedinO

(

n

+

m

)

timeandanoptimalsolution(ifoneexists)canbefound

in O

(

n3

)

time.

Proof. Let S

= {

ea

,

ed

}

andlet

(

G

,

δ)

be aninstanceofCDPE

(

S

)

.ByLemma 4,wemayassumethat

|

T

|

iseven,otherwise

(

G

,

δ)

is a no-instance.IfG

=

K2 and T

=

V

(

G

)

, or G

=

K1

+

K1 and T

= ∅

, then

(

G

,

δ)

isa no-instance.If G

=

K2 and

T

= ∅

then,trivially,optS

(

G

,

δ)

=

0,andifG

=

K1

+

K1 andT

=

V

(

G

)

thenoptS

(

G

,

δ)

=

1.Toavoidthesetrivialinstances,

wethereforeassumethat G containsatleastthreevertices.UndertheseassumptionswewillshowthatoptS

(

G

,

δ)

isalways

finiteandgiveexactformulasforthevalueofoptS

(

G

,

δ)

.Let p bethenumberofcomponentsof G thatdonotcontainany

vertexof T and let q be thenumber ofcomponents of G thatcontainat leastone vertexof T . Weprove thefollowing seriesofstatements.

– optS

(

G

,

δ)

=

0 if p

=

1

,

q

=

0,

– optS

(

G

,

δ)

=

max

{

3

,

p

}

ifp

2

,

q

=

0,

– optS

(

G

,

δ)

=

12

|

T

|

+

1 if p

=

0

,

q

=

1,G

[

T

]

=

K1,r,forsomer

1,andeachedgeof G

[

T

]

isabridgeof G,

– optS

(

G

,

δ)

=

max

{

p

+

q

1

,

p

+

12

|

T

|}

inallothercases.

Notethatifp

=

1

,

q

=

0,thenthefirststatementappliesandthetrivialsolution

(

A

,

D

)

= (∅,

∅)

isoptimal.Wenowconsider theremainingthreecasesseparately.

Case1: p

2 andq

=

0.

Then T

= ∅

,sobyLemma 4foranysemi-solution

(

A

,

D

)

,everyvertexinGS

(

A

D

)

musthaveevendegreeinGS

(

A

D

)

.

In other words, every vertexof G must be incident to an even numberof edges in A

D. Since p

2, the graph G is disconnected,soanysolution

(

A

,

D

)

isnon-empty.Thismeansthat GS

(

A

D

)

mustcontainacycle,sooptS

(

G

,

δ)

3 ifa

solutionexits.Suppose p

=

2.As G hasatleastthreevertices,itcontains acomponentcontaining an edge xy.Let z bea vertexinits other component. Weset A

= {

xz

,

yz

}

and D

= {

xy

}

to obtaina solutionfor

(

G

,

δ)

.Since

|

A

|

+ |

D

|

=

3, this solutionisoptimal.Supposep

3.SinceG

+

A

D mustbeconnectedforanysolution

(

A

,

D

)

,everycomponentin G must containatleastonevertexincidenttoanedgeof A.ByLemma 4,thisvertexmustbeincidenttoanevennumberofedges of A

D,meaningthatitmustbeincidenttoatleasttwosuchedges.ThereforeoptS

(

G

,

δ)

p.Indeed,ifwechoosevertices

v1

,

. . . ,

vp,onefromeachcomponentof G,thensettingA

= {

v1v2

,

v2v3

,

. . . ,

vp−1vp

,

vpv1

}

andD

= ∅

givesasolutionof size p,whichisthereforeoptimal.ThisconcludesCase 1.

Case2: p

=

0

,

q

=

1,G

[

T

]

=

K1,rforsomer

1 andeachedgeof G

[

T

]

isabridgeof G.

Then G isconnected.Let v0 bethe centralvertexof thestar G

[

T

]

andlet v1

,

. . . ,

vr be theleaves. ByLemma 4, inany

semi-solution

(

A

,

D

)

,everyvertexof T mustbeincidenttoanoddnumberofedgesin A

D,sooptS

(

G

,

δ)

12

|

T

|

. Weclaimthat optS

(

G

,

δ)

12

|

T

|

+

1.Suppose,forcontradiction, that

(

A

,

D

)

isasemi-solutionofsize

|

A

|

+ |

D

|

=

1 2

|

T

|

. Then A

D mustbeamatchingwitheachedgejoiningapairofverticesof T .However,thenv0vi

A

D forsome i.Since v0vi

E

(

G

)

,wemusthavev0vi

D.However,since v0viisabridgeof G, v0and vimustthenbeindifferentcomponents

ofG

+

A

D,soG

+

A

D isnotconnectedand

(

A

,

D

)

isnotasolution,acontradiction.ThereforeoptS

(

G

,

δ)

12

|

T

|

+

1. Nextweshowhowtofindasolutionofsize 12

|

T

|

+

1.Since

|

T

|

iseven,r mustbeodd.Firstsupposethatr

=

1.Since G isconnectedand v0v1 isabridge,G

\ {

v0v1

}

hasexactlytwocomponents.Since G containsatleastthreevertices,one of thesecomponentscontainsanothervertex x.Withoutlossofgeneralityassumexv0

E

(

G

)

,inwhichcasexv1

/

E

(

G

)

.Then settingA

= {

xv1

}

andD

= {

xv0

}

givesasemi-solution.Sincex

,

v0

,

v1areallinthesamecomponentofG

+

A

D,thegraph

G

+

A

D mustbeconnected,so

(

A

,

D

)

isasolution.Since

|

A

|

+ |

D

|

=

2

=

12

|

T

|

+

1,thissolutionisoptimal.Nowsuppose

r

3.LetA

= {

v1v2

,

v2v3

}

∪{

v2iv2i+1

|

2

i

12

(

r

1

)

}

andD

= {

v0v2

}

.Then

(

A

,

D

)

isasemi-solutionandsincev0

,

. . . ,

vr

areallinthesamecomponentofG

+

A

D,wefindthat

(

A

,

D

)

isasolution.Since

|

A

|

+|

D

|

=

2

+

12

(

r

1

)

1

+

1

=

12

|

T

|

+

1, thissolutionisoptimal.ThisconcludesCase 2.

(8)

Case3: q

1 andCase 2doesnothold.

Then T

= ∅

.LetG1

,

. . . ,

Gp bethecomponentsof G withoutverticesof T andletG

=

G

− (

V

(

G1

)

∪ · · · ∪

V

(

Gp

))

.Notethat G

=

G if p

=

0 andthat G isnottheemptygraph,asq

>

0.Choosevi

V

(

Gi

)

fori

∈ {

1

,

. . . ,

p

}

.

WefirstshowthatoptS

(

G

,

δ)

max

{

p

+

q

1

,

p

+

12

|

T

|}

.Since G hasp

+

q components,anysolution

(

A

,

D

)

mustcontain atleastp

+

q

1 edgesin A toensurethat G

+

A

D isconnected,sooptS

(

G

,

δ)

p

+

q

1.If

(

A

,

D

)

isasolutionthen

every component Gi mustcontain avertexincident tosome edgein A. ByLemma 4, thisvertexmust beincident toan

evennumberofedgesofA

D,meaningthatitmustbeincidenttoatleasttwosuchedges.ByLemma 4,everyvertexof T mustbeincidenttosomeedgein A

D.Therefore A

D mustcontainatleastp

+

12

|

T

|

edges,sooptS

(

G

,

δ)

p

+

12

|

T

|

.

We now show howto finda solutionof sizemax

{

p

+

q

1

,

p

+

12

|

T

|}

.We start by findinga maximummatching M in G

[

T

]

.Let U bethesetofverticesin T thatarenot incidenttoanyedgein M.Wedividetheargumentintotwocases, dependingonthesizeof U .

Case3a: U

= ∅

.

Inthiscase,byLemma 4,setting A

=

M andD

= ∅

givesasemi-solution.Nowsupposethatuv

,

uv

M,suchthat uv is notabridgeinG

+

M andthevertices u and uareindifferentcomponentsofG

+

M.Let M

= (

M

\ {

uv

,

uv

})

∪ {

uv

,

uv

}

. Then M isalso amaximum matchingin G

[

T

]

.However, G

+

M has onecomponent lessthan G

+

M. Indeed,since uv is nota bridgein G

+

M,the verticesu

,

u

,

v

,

v mustall beinthe samecomponentofG

+

M.Therefore,ifsuchedges

uv

,

uv

M exist,we replace M by M.We dothisexhaustivelyuntil nofurther suchpairs ofedges exist.At thispoint eitherevery edgein M isabridge inG

+

M orevery edgein M isinthesamecomponentofG

+

M. Weconsiderthese possibilitiesseparately.

Firstsupposethateveryedgein M isabridgeinG

+

M.Chooseuv

M andletQ1

,

. . . ,

QkbethecomponentsofG

+

M,

withu

,

v

V

(

Q1

)

.Notethat sinceeveryedge in M isabridge,k

=

p

+

q

− |

M

|

.Now let xi

V

(

Qi

)

fori

∈ {

2

,

. . . ,

k

}

.Let D

= ∅

andletA

=

M ifk

=

1 andA

= (

M

\ {

uv

})

∪ {

ux2

,

x2x3

,

. . . ,

xk−1xk

,

xkv

}

otherwise.NoweveryvertexinG

+

A

D has

thesamedegreeparityasinG

+

M,so

(

A

,

D

)

isasemi-solutionbyLemma 4.ThegraphG

+

A

D isconnected,so

(

A

,

D

)

isasolution.As

|

A

|

+ |

D

|

= |

M

|

1

+

p

+

q

− |

M

|

+

0

=

p

+

q

1,wefindthat

(

A

,

D

)

isanoptimalsolution.

Now supposethatevery edgein M isinthesamecomponentofG

+

M.Notethat G1

,

. . . ,

Gp aretheremaining

com-ponents of G

+

M.Chooseuv

M. Let D

= ∅

andlet A

=

M if p

=

0 and A

= (

M

\ {

uv

})

∪ {

uv1

,

v1v2

,

. . . ,

vp−1vp

,

vpv

}

otherwise.Then everyvertexinG

+

A

D hasthesameparityasinG

+

M andG

+

A

D isconnected,sobyLemma 4

(

A

,

D

)

isasolution.Since

|

A

|

+ |

D

|

=

12

|

T

|

1

+

p

+

1

=

p

+

12

|

T

|

,thissolutionisoptimal.ThisconcludesCase 3a.

Case3b: U

= ∅

.

Notethat z

= |

U

|

mustbe evensince

|

T

|

iseven.Everypairofverticesin U mustbenon-adjacent in G,asotherwise M wouldnotbemaximum.Therefore G

[

U

]

isaclique.LetU

= {

u1

,

. . . ,

uz

}

.

RecallthatG

=

G

− (

V

(

G1

)

∪ · · · ∪

V

(

Gp

))

.Weclaimthat Q

=

G

+

M isconnected.Clearlyeveryvertexoftheclique U

must be inthe samecomponentof Q

=

G

+

M. Suppose forcontradictionthat Q1 isa componentof Q thatdoesnot contain U . Then Q1 mustcontain some edge w1w2

M. However, inthiscase M

= (

M

\ {

w1w2

})

∪ {

u1w1

,

u2w2

}

is a largermatchinginG

[

T

]

than M,whichcontradictsthemaximalityof M.Therefore Q isconnected.

First suppose that z

4 (recallthat z is even). Let M

= {

u1u2

,

u3u4

, . . . ,

uz−1uz

}

. Since U isa clique, G

+

M

M is

connected.Ifp

=

0 setA

=

M andD

=

M.Ifp

>

0 set A

=

M

∪ {

u1v1

,

v1v2

,

. . . ,

vp−1vp

,

vpu2

}

andD

=

M

\ {

u1u2

}

.Then

G

+

A

D isconnected,so

(

A

,

D

)

isasolutionbyLemma 4.Thissolutionhassize

|

A

|

+ |

D

|

=

p

+

12

|

T

|

,soitisoptimal. Now supposethat z

3.Then z

=

2.Ifp

>

0,let A

=

M

∪ {

u1v1

,

v1v2

,

. . . ,

vp−1vp

,

vpu2

}

and D

= ∅

.Then G

+

A

D isconnected,so

(

A

,

D

)

isasolutionbyLemma 4.Thissolutionhassize

|

A

|

+ |

D

|

=

p

+

12

|

T

|

,soitisoptimal.Assumethat

p

=

0,soG

+

M containsonlyonecomponent.If u1u2isnotabridgeinG

+

M,let A

=

M andD

= {

u1u2

}

.Then G

+

M is connected,so

(

A

,

D

)

isasolution.Thissolutionhassize

|

A

|

+ |

D

|

=

p

+

12

|

T

|

,soitisoptimal.

Nowassumethat u1u2isabridgeinQ

=

G

+

M.Let Q1and Q2denotethecomponentsofQ

− {

u1u2

}

withu1

V

(

Q1

)

andu2

V

(

Q2

)

.Notethat u1u2isalsoabridgein G.Weclaimthattheedgesof M areeitherallin Q1orallin Q2.Suppose forcontradictionthat y1z1

E

(

Q1

)

M and y2z2

E

(

Q2

)

M.Then M

= (

M

\ {

y1z1

,

y2z2

})

∪ {

u1y2

,

u2y1

,

z1z2

}

wouldbe alargermatchingin G

[

T

]

than M,contradictingthemaximalityof M.Withoutlossofgenerality,wemaythereforeassume thatalledgesof M arein Q1.

LetM

= {

x1y1

,

. . . ,

xryr

}

,wherer

=

12

|

T

|

1.Weclaimthat u1 mustbeadjacentin G toallverticesofT

\ {

u1

}

.Suppose forcontradictionthat u1 isnon-adjacentin G tosome vertexofT

\ {

u1

}

.Sinceu1u2

E

(

G

)

,thisvertexwouldhavetobe incident tosome edgein M.Withoutlossofgenerality, assumeu1x1

/

E

(

G

)

.Then M

= (

M

\ {

x1y1

})

∪ {

u1x1

,

u2y1

}

would be alargermatchingin G

[

T

]

than M,contradicting themaximalityof M.Therefore u1 isadjacentin G toevery vertexof

T

\ {

u1

}

.Inparticular,since p

=

0,itfollowsthatq

=

1 and G isconnected.

Suppose that everyedge between u1 and T

\ {

u1

}

isa bridge in G.Then no twoverticesof T

\ {

u1

}

canbe adjacent, and G

[

T

]

=

K1,r. However,then Case 2applies, whichwe assumedwas not thecase. Withoutloss ofgenerality,we may

thereforeassumethat u1x1isnotabridgein G.LetA

= (

M

\ {

x1y1

})

∪ {

y1u2

}

andD

= {

u1x1

}

.ThenG

+

A

D isconnected, so

(

A

,

D

)

isasolution.Since

|

A

|

+ |

D

|

=

12

|

T

|

1

1

+

1

+

1

=

p

+

12

|

T

|

,thissolutionisoptimal.ThisconcludesCase 3b andthereforealsoconcludesCase 3.

It isclear that optS

(

G

,

δ)

can be computed in O

(

n

+

m

)

time. We also observe that the above proof isconstructive. Hence,wenotonlysolvethedecisionvariantofCDPE

(

ea

,

ed

)

butwecanalsofindanoptimalsolutioninpolynomialtime.

Referenties

GERELATEERDE DOCUMENTEN

Zijm consortium’s experience motivates further research on: (1) “improving effectiveness of spare part supply by additive manufacturing as dual sourcing option”, (2) “the influence

The analysis of the systems considered in this thesis provides insights into the impact of the characteristics of sen- sor networks (for instance, the deployment of the sensors,

To do so, we develop several bounds and asymptotic (fluid and diffusion) approximations for the vector process which describes the total number of EVs and the number of not

Butts (2008) relational event model was employed to examine the communication dynamics amongst the pilots in the cockpit of flight AF447, and illustrate how communication patterns

Weil die Verteilung der Energie uber den beiden Elektroden innerhalb einer Periode genau gemessen werden kann, brauchen wir uns bei der Versuchsdurchfuhrung nicht

cent syllables, would make it les s easy to allow one and only one syllable identification per presented fragment, whereas any such addition would also distort

The Kingdom capacity (K-capacity) - denoted as ϑ (ρ) - is defined as the maximal number of nodes which can chose their label at will (’king’) such that remaining nodes

Op proefboerderij Ebelsheerd zijn van 2002 t/m 2004 proeven aangelegd waarin mixen van deze herbiciden in verschillende (lagere) doseringen gespoten zijn (tabel 3a).. De proeven