Contents lists available atScienceDirect
Journal
of
Computer
and
System
Sciences
www.elsevier.com/locate/jcss
Editing
to
a
planar
graph
of
given
degrees
✩
Konrad
K. Dabrowski
a,
∗
, Petr
A. Golovach
b,
Pim van ’t
Hof
c,
Daniël Paulusma
a,
Dimitrios
M. Thilikos
d,
e,
faSchoolofEngineeringandComputingSciences,DurhamUniversity,UnitedKingdom bDepartmentofInformatics,UniversityofBergen,Norway
cSchoolofBuiltEnvironment,RotterdamUniversityofAppliedSciences,Rotterdam,TheNetherlands dComputerTechnologyInstituteandPress“Diophantus”,Patras,Greece
eDepartmentofMathematics,NationalandKapodistrianUniversityofAthens,Athens,Greece fAlGCoproject-team,CNRS,LIRMM,Montpellier,France
a
r
t
i
c
l
e
i
n
f
o
a
b
s
t
r
a
c
t
Articlehistory:
Received21February2016
Receivedinrevisedform 17November2016 Accepted26November2016
Availableonline1December2016 Keywords:
Graphediting Connectedgraph Planargraph Polynomialkernel
Weconsider thefollowinggraphmodificationproblem. Lettheinput consistofagraph
G= (V,E),aweightfunctionw:V∪E→ N,acostfunctionc:V∪E→ N0andadegree
functionδ:V→ N0,togetherwiththreeintegerskv,keand C .Thequestioniswhetherwe
candeleteasetofverticesoftotalweightatmost kv andasetofedgesoftotalweight
atmost ke sothat the totalcostofthe deleted elements isatmost C andevery
non-deletedvertex v hasdegreeδ(v)intheresultinggraph G.Wealsoconsiderthevariantin which G mustbeconnected.BothproblemsareknowntobeNP-completeandW[1]-hard whenparameterizedbykv+ke.Weprovethat,whenrestrictedtoplanargraphs,theystay
NP-completebuthavepolynomialkernelswhenparameterizedbykv+ke.
©2016TheAuthors.PublishedbyElsevierInc.ThisisanopenaccessarticleundertheCC BYlicense(http://creativecommons.org/licenses/by/4.0/).
1. Introduction
Graphmodificationproblemscaptureavarietyoffundamentalgraph-theoreticproblems,andassuchtheyareverywell studied inalgorithmic graphtheory.The aimis tomodify some givengraph G intosome other graph H ,that satisfies a
certainproperty,byapplyingatmostsomegivennumberoperationsfromaset S ofprespecifiedgraphoperations.Well-known graph operations are the edge addition, edge deletion and vertex deletion, denoted by ea
,
ed and vd, respectively. For example,ifS= {
vd}
and H mustbeacliqueorindependentset,thenweobtaintwobasicgraphproblems,namely Clique and IndependentSet,respectively.Togiveafewmoreexamples,if H mustbeaforestandeitherS= {
ed}
orS= {
vd}
,then we obtain theproblems FeedbackEdgeSetand FeedbackVertexSet,respectively. As wediscussin detaillater, it isalso commontoconsidersets S consistingofmorethanonegraphoperation.✩ An extendedabstractofthispaper appearedinthe proceedingsofCSR2015[10].Thefirstand fourthauthors were supportedbyEPSRCGrant
EP/K025090/1.TheresearchofthesecondauthorreceivedfundingfromtheEuropeanResearchCouncilundertheEuropeanUnion’sSeventhFramework Programme(FP/2007–2013)/ERCGrantAgreementn.267959.Theresearchofthefifthauthorwasco-financedbytheEuropeanUnion(EuropeanSocial FundESF)andGreeknationalfundsthroughtheOperationalProgram“EducationandLifelongLearning”oftheNationalStrategicReferenceFramework (NSRF)–ResearchFundingProgram:ARISTEIAII.
*
Correspondingauthor.E-mailaddresses:konrad.dabrowski@durham.ac.uk(K.K. Dabrowski),petr.golovach@ii.uib.no(P.A. Golovach),p.van.t.hof@hr.nl(P. van ’tHof), daniel.paulusma@durham.ac.uk(D. Paulusma),sedthilk@thilikos.info(D.M. Thilikos).
http://dx.doi.org/10.1016/j.jcss.2016.11.009
0022-0000/©2016TheAuthors.PublishedbyElsevierInc.ThisisanopenaccessarticleundertheCCBYlicense (http://creativecommons.org/licenses/by/4.0/).
A property ishereditary if it isclosed under takinginduced subgraphs. A property isnon-trivial if itis both true for infinitelymanygraphsandfalseforinfinitelymanygraphs.AclassicresultofLewisandYannakakis[24]isthatthevertex deletionproblemis NP-hard foranyproperty thatisboth hereditaryandnon-trivial. Inan earlierpaper,Yannakakis[33]
alsoshowedNP-hardnessresultsfortheedgedeletionproblemforseveralproperties,suchasbeingplanarorouter-planar.
Natanzon, Shamir andSharan [29] and Burzyn, Bonomo and Durán [5] proved that the graph modification problem is
NP-completeforseveraltargethereditarygraphpropertieswhenS
= {
ea,
ed}
.Aswecanseefromtheaboveresults,graphmodificationproblemsareoftenintractableevenforelementarycaseswhen
S
⊆ {
ea,
ed}
.Assuch,manypapersinthisarea studythecomplexity ofgraphmodificationproblemswhenparameterized bythetotalnumberofpermittedoperations k.Cai[6]provedthatthegraphmodificationproblemisFPTwhenparameterizedby k,if S
= {
ea,
ed,
vd}
andthedesired property isthat ofbelonging toanyfixed graph classcharacterized by a finiteset offorbiddeninduced subgraphs. Khot andRaman[21] determinedallnon-trivialhereditarypropertiesforwhichthevertexdeletionproblemisFPTonn-vertexgraphswithparametern
−
k and proved thattheproblemis W[
1]
-hardwithrespectto thisparameter forallother such properties.Fromtheaforementionedresultsweseethatthegraphmodificationproblemhasbeenthoroughlystudiedforhereditary properties.Severalothernaturaltypesofpropertieshavealsobeenconsidered.Forinstance,Dabrowskietal.[9]combined anumberofpreviousresults[4,7,8]withnewresultstogiveacompleteclassificationofthe(parameterized)complexityof theproblemofmodifying aninputgraphintoaconnectedgraphwhereeachvertexhassomeprescribeddegreeparityfor everysetS
⊆ {
ea,
ed,
vd}
.1.1. Ourfocus
In this paper we consider the case when the vertices of the resulting graph must satisfy some prespecified degree constraints (note that such properties are non-hereditary, so the resultof Lewis and Yannakakis does not apply to this case).Thisisa naturaldirectiontoconsidergiventhe classicalstructuralresults[25,32] onso-called f -factorsingraphs, whicharespanningsubgraphsinwhicheachvertex u musthavedegree f
(
u)
forsomespecifiedfunction f (theseresults immediately imply that an f -factor in a graph can be found in polynomial time if one exists, while finding connectedf -factors,e.g.Hamiltoncycles,isNP-complete).
Beforepresentingourresults,webrieflydiscusstheknownresultsandthegeneralframeworktheyfallunder.
Generalframework. MoserandThilikosin[28] andMathiesonandSzeider[27] initiatedaninvestigationintothe param-eterizedcomplexityofgraphmodificationproblemswithrespecttodegreeconstraints.Thisleadstothefollowinggeneral problem.
DegreeConstraintEditing(S)
Instance: Agraph G,integersd,k andafunction
δ
:
V(
G)
→ {
1,
. . . ,
d}
.Question: Can G bemodified intoagraph G suchthatdG
(
v)
= δ(
v)
foreach v∈
V(
G)
usingatmost k operationsfromtheset S?
MathiesonandSzeider[27] classifiedtheparameterizedcomplexityofthisproblemfor S
⊆ {
ea,
ed,
vd}
.Inparticularthey showedthefollowing results.If S⊆ {
ea,
ed}
thenthe problemispolynomial-timesolvable. Ifvd∈
S thenthe problemis NP-complete,W[
1]
-hardwithparameter k andFPTwithparameter d+
k.Moreover,theyprovedthatthelatterresultholds evenforamoregeneralversion,inwhichtheverticesandedgeshavecostsandthedesireddegreeforeachvertexshould be insome givensubset of{
1,
. . . ,
d}
. If{
v}
⊆
S⊆ {
ed,
vd}
, they proved thatthe problemhasa polynomial kernelwhen parameterizedby d+
k evenifverticesandedges havecosts. Recently,Mathieson[26] consideredgrapheditingproblems foranumberofalternativeformsofdegreeconstraints.Golovach[19]consideredthecasesS= {
ea,
vd}
andS= {
ea,
ed,
vd}
andproved(amongstotherresults)thatforthesecasestheproblemhasnopolynomialkernelwhenparameterizedbyd+
kunless NP
⊆
coNP/
poly. Froese,Nichterlein andNiedermeier [14] gave morekernelization resultsfor DegreeConstraint Editing(S).Golovach[18] introduced avariantof DegreeConstraintEditing(S) withthe extracondition that theresulting graph must be connected. He proved that, for S
= {
ea}
,this variantis NP-complete, FPTwhen parameterized by k, and hasa polynomialkernelwhenparameterizedby d+
k. Theconnectedvariantisreadilyseen tobeW[
1]
-hard whenvd∈
S bya straightforward modificationofthe proof ofthe W[
1]
-hardness resultfor DegreeConstraintEditing(S),when vd∈
S,as givenbyMathiesonandSzeider[27].Ourresults. InthelightoftheaboveNP-completenessandW
[
1]
-hardness resultswhen vd∈
S itisnaturaltorestrictthe inputgraph G toaspecialgraphclass.Hence,inspiredbytheaboveresults,weconsiderthesetS= {
ed,
vd}
andstudyboth variantsoftheseproblems(whereweinsistthattheresultinggraph Gisconnectedandwherewedonot)forplanar inputgraphs.Theproblemvariantnotdemandingconnectivityisdefinedasfollows.(Infacttheproblemswe studyareslightly moregeneral.)
PlanarDegreeConstraintDeletion
Instance: AplanargraphG
= (
V,
E)
,integerskv,keandafunctionδ
:
V→ N
0.Question: Can G bemodified into a graph G such that dG
(
v)
= δ(
v)
for each v∈
V(
G)
usingat most kv vertexdeletionsandatmost ke edgedeletions?
We note that PlanarDegreeConstraintDeletion is NP-complete even if
δ
≡
3 and that its connected variant isNP-complete evenif
δ
≡
2. Theseobservations followdirectlyfrom therespective facts that both testingwhethera pla-nargraphofmaximumdegreeatmost 7 hasanon-trivialcubicsubgraphisNP-complete[31]andtestingwhetheracubic planargraphhasaHamiltoniancycleisNP-complete[15].IncontrasttotheaforementionedW
[
1]
-hardnessresultsforgeneralgraphs,ourtwomainresultsarethattheweighted versionof PlanarDegreeConstraintDeletionanditsconnectedvariantbothhavepolynomialkernelswhenparameterized by kv+
ke (see Section2.2fortheexact definitionoftheseweightedversions). Notethatby settingkv=
0 orke=
0 weobtainthesameresultsfor DegreeConstrainedEditing(S) when S
= {
ed}
andS= {
vd}
,respectively(thoughthe S= {
ed}
caseisnotsurprising,sincethisproblemissolvableinpolynomialtimeongeneralgraphs[27]).In order to obtain our results we first show that both problemsare polynomial-timesolvable forany graph class of bounded treewidth.We thenuse avariantof theprotrusiondecomposition/replacement techniquesintroduced by Bodlaen-der et al.[3].Thesetechniqueswere successfullyusedforvariousproblemsonsparsegraphs[13,16,17,22].Westressthat our problems do not fit into the meta-algorithmic framework of Bodlaender et al. [3]on kernelization. Our kernels re-quireprotrusionreplacementmachinerythatisdifferentfromthegeneralone in[3].Hence ourapproachis,unavoidably, problem-specific.
2. Preliminaries
Inthissectionwestateterminologyandnotationusedthroughoutthepaper.
2.1. Basicterminologyandnotation
Allgraphsinthispaperarefinite,undirectedandwithoutloopsormultipleedges.Thevertexsetofagraph G isdenoted by V
(
G)
andtheedgesetisdenotedby E(
G)
.ForasetX⊆
V(
G)
,welet G[
X]
denotethesubgraphof G inducedby X .We let G−
X=
G[
V(
G)
\
X]
; notethat weallowthecasewhere XV(
G)
.If X= {
x}
,wemaywrite G−
x instead.ForasetL
⊆
E(
G)
,weletG−
L bethegraphobtainedfrom G bydeletingalledgesof L.IfL= {
e}
thenwemaywriteG−
e instead.For v
∈
V(
G)
,let EG(
v)
= {
e∈
E(
G)
|
e is incident to v}
.For X⊆
V(
G)
,let EG(
X)
=
v∈XEG(
v)
.Fore∈
E(
G)
withe=
uv,let V
(
e)
= {
u,
v}
.ForasetL⊆
E(
G)
let V(
L)
=
e∈LV(
e)
.Let G be a graph.For a vertex v, we let NG
(
v)
denote its (open)neighbourhood, that is,the set of vertices adjacentto v. The degree ofa vertex v is denotedby dG
(
v)
= |
NG(
v)
|
.Fora set X⊆
V(
G)
,we write NG(
X)
= (
v∈XNG(
v))
\
X .The closedneighbourhood NG
[
v]
=
NG(
v)
∪ {
v}
, andfora non-negative integer r, NrG[
v]
is the set ofvertices atdistanceat most r from v;note that N0
G
[
v]
= {
v}
andthat N1G[
v]
=
NG[
v]
.Let X⊆
V(
G)
,andlet r be a positive integer. We letNr G
[
X]
=
v∈XNrG
[
v]
.The set X isan r-dominating set of G if V(
G)
⊆
NrG[
X]
.We let∂
G(
X)
=
X∩
NG(
V(
G)
\
X)
be theboundary of X in G,i.e.thesetofverticesin X thathaveneighbours G outsideof X .
A treedecomposition ofa graph G isapair
(X ,
T)
where T is atreeandX = {
Xi|
i∈
V(
T)
}
isacollectionofsubsets(calledbags)of V
(
G)
suchthat(i)
i∈V(T)Xi=
V(
G)
,(ii) foreachedgexy
∈
E(
G)
,thereisani∈
V(
T)
suchthatx,
y∈
Xi,and(iii) foreachx
∈
V(
G)
,theset{
i|
x∈
Xi}
inducesaconnectedsubtreeof T .Thewidth ofatreedecomposition
(
{
Xi|
i∈
V(
T)
},
T)
ismaxi∈V(T){|
Xi|
−
1}
.Thetreewidth ofagraph G (denoted tw(
G)
)isthe minimumwidthoverall treedecompositionsof G.Atreedecomposition
(X ,
T)
ofagraph G is nice,if T isarooted binarytreesuchthatthenodesof T areoffourtypes:(i) aleafnode i isaleafof T with Xi
= ∅
;(ii) anintroducenode i hasonechild iwith Xi
=
Xi∪ {
v}
forsomevertexv∈
V(
G)
;(iii) aforgetnode i hasonechild iwith Xi
=
Xi\ {
v}
forsomevertexv∈
VG;and(iv) ajoinnode i hastwochildren iand i with Xi
=
Xi=
Xi,and, moreover,theroot r isaforgetnodewith Xr
= ∅
.Kloks[23]provedthateverytreedecompositionofagraphcanbeconvertedinlineartimetoanicetreedecompositionofthesamewidthsuchthatthesizeoftheobtainedtreeislinearin thesizeoftheoriginaltree.
Lemma1.Let V1 and V2bethebipartitionclassesofaplanarbipartitegraph G suchthatdG
(
v)
≥
3 forevery v∈
V2and V2isnon-empty.Then
|
V2|
≤
2|
V1|
−
4.Proof. Let G besuchagraph.Let C
(
G)
and F(
G)
bethesetofcomponentsandfacesin G,respectively.Since G isbipartite, theborderofeveryinternalfaceof G mustcontainatleastfouredges.Thisalsoappliestotheinfiniteouterface,since G containsavertexofdegreeatleast 2 (edgescontainedintheborderofafacethatarenotpartofacyclearecountedtwice). Every edge is partof atmost two faces. It followsthat 4|
F(
G)
|
≤
2|
E(
G)
|
. Euler’sFormula forplanar graphs states that|
V(
G)
|
−|
E(
G)
|
+|
F(
G)
|
−|
C(
G)
|
=
1.Combiningthiswiththeaboveinequality,wefindthat|
E(
G)
|
≤
2|
V(
G)
|
−
2|
C(
G)
|
−
2≤
2|
V(
G)
|
−
4.Now3
|
V2|
≤
v∈V2dG(
v)
,sinceeveryvertexin V2 hasdegreeatleast 3.Weknowthatv∈V2dG
(
v)
= |
E(
G)
|
since G isbipartite.Combiningtheseobservationswiththeinequalityfoundaboveimpliesthat3|
V2|
≤
2(
|
V1|
+ |
V2|)
−
4.Therefore|
V2|
≤
2|
V1|
−
4.2
2.2. Fullproblemdescription
As mentionedin Section 1the problemswe solveare moregeneral than PlanarDegreeConstraintDeletionandits connectedvariant.The generalizationswe studyare analogousto thoseused forother editingproblems inthe literature (seee.g.[27]).Theunconnectedvariantthatwesolveisdefinedasfollows:
DeletiontoaPlanarGraphofGivenDegrees(DPGGD)
Instance: AplanargraphG
= (
V,
E)
,integerskv,ke,C andfunctionsδ
:
V→ N
0, w:
V∪
E→ N
,c:
V∪
E→ N
0.Question: Can G bemodifiedintoagraph GbydeletingasetU
⊆
V withw(
U)
≤
kvandasetD⊆
E withw(
D)
≤
kesuchthatc
(
U∪
D)
≤
C anddG(
v)
= δ(
v)
forv∈
V(
G)
?Inthisproblem, w istheweight and c isthecost function.Thequestioniswhetheritispossibletodeleteverticesandedges oftotalweightatmost kv and ke,respectively,sothatthetotalcostofthedeletedelementsisatmost C andtheobtained
graphsatisfiesthedegreerestrictionsprescribedbythegivenfunction
δ
.Notethatifwedeleteavertex,theedgesincident to that vertexcan no longerbe present, so they are automatically deleted; theseedges do not contribute to theweight orcost ofthesolution.Weincludecosts to makeourresultsasgeneralaspossible.Inparticularnote that theinteger C isneithera constantnor aparameter,butpartofthe input.Addingcosts inthiswaydoesnotfundamentally complicate ourproof.Asthegoalistominimizethetotalcosts,thecostsforedgesandverticesarecombined.Besidescosts,wealso includeweights,mainlyfortechnicalreasons.WecallthevariantofDPGGD,inwhichthedesiredgraph G mustbe connected,the DeletiontoaConnectedPlanar
GraphofGivenDegreesproblem(DCPGGD).
2.3. Protrusiondecompositions
For a graph G anda positive integer r, a set X
⊆
V(
G)
is an r-protrusion of G if|∂
G(
X)
|
≤
r and tw(G[
X])
≤
r. Forpositiveintegers s and s,an
(
s,
s)
-protrusiondecompositionofagraph G (seealsoFig. 1) isa partition= {
R0,
. . . ,
Rp}
of V
(
G)
suchthat(i) max
{
p,
|
R0|}
≤
s,(ii) foreachi
∈ {
1,
. . . ,
p}
,R+i=
NG[
Ri]
isans-protrusionof G,and(iii) foreachi
∈ {
1,
. . . ,
p}
,NG(
Ri)
⊆
R0∩ ∂
G[
R+i]
.The sets R+1
,
. . . ,
R+p are called the protrusions of. Originally, condition (iii) only demanded that NG
(
Ri)
⊆
R0 holdsforeach i
∈ {
1,
. . . ,
p}
.However, we can move every vertex in NG(
Ri)
\ ∂
G[
R+i]
to Ri without affectingany ofthe otherproperties.Henceweassumewithoutlossofgeneralitythatsuchverticesdonotexistandmayindeedstatecondition(iii) asabove(whichisconvenientforourpurposes).Notethatifavertexv
∈
Ri+hasaneighbouroutsideof R+i thenv∈
NG(
Ri)
bythedefinitionof R+i.Itfollowsthateveryvertexof
∂
G[
R+i]
alsoliesinNG(
Ri)
andthereforeNG(
Ri)
= ∂
G[
R+i]
.Thefollowingstatementisimplicitin[3](seeLemmas 6.1and 6.2).
Lemma2([3]).Let r and k bepositiveintegersandlet G beaplanargraphthathasanr-dominatingsetofsizeatmost k.Then G has an
(
O(
kr),
O(
r))
-protrusiondecomposition,whichcanbeconstructedinpolynomialtime.2.4. Parameterizedcomplexity
Parameterizedcomplexityisatwodimensionalframeworkforstudyingthecomputationalcomplexityofaproblem.One dimension is theinput size n and the other is aparameter k. A problemis said tobe fixedparametertractable (or FPT)
Fig. 1. A protrusion decomposition with p=3. Recall that R+i =NG[Ri]and note that the sets∂G(R+i)=NG(Ri)are not necessarily pairwise disjoint.
if itcan be solved intime f
(
k)
·
nO(1) forsome function f .A kernelization for a parameterizedproblemis apolynomialalgorithmthatmapseachinstance
(
x,
k)
withinput x andparameter k toaninstance(
x,
k)
suchthat(i)
(
x,
k)
isayes-instanceifandonlyif(
x,
k)
isayes-instance,and (ii) thesizeof xand kisboundedby f(
k)
foracomputablefunction f .The output
(
x,
k)
is calleda kernel. The function f is said to be the size of the kernel. A kernel is polynomial if f ispolynomial. We refer tothe booksofDowney andFellows [11],FlumandGrohe [12],andNiedermeier [30] fordetailed introductionstoparameterizedcomplexity.
3. Thepolynomialkernels
In this section we construct polynomial kernels for DPGGD and DCPGGD. We say that a pair
(
U,
D)
with U⊆
V(
G)
and D
⊆
E(
G)
is a solution for an instance(
G,
kv,
ke,
C,
δ,
w,
c)
of DPGGDif w(
U)
≤
kv, w(
D)
≤
ke, c(
U∪
D)
≤
C andG
=
G−
U−
D satisfiesdG(
v)
= δ(
v)
forall v∈
V(
G)
.If(
G,
kv,
ke,
C,
δ,
w,
c)
isaninstanceofDCPGGDthen(
U,
D)
isasolutionifinaddition Gisconnected.NoticethatitcanhappenthatU
=
V(
G)
forasolution(
U,
D)
.In ordertoproveour mainresults,wefirst needtointroduce someadditionalterminologyandprovesome structural results. We say that a solution
(
U,
D)
is ofminimumcost if c( ˆ
U,
Dˆ
)
≥
c(
U,
D)
for every solution( ˆ
U,
Dˆ
)
.We say that a solution(
U,
D)
foran instance of DPGGD or DCPGGD is efficient if D has no edges incident tothe vertices of U . Since deleting a vertex automatically removes all incident edges with no weight or cost penalty,we can make the following observation.Observation1.Anyyes-instanceof DPGGDor DCPGGDhasanefficientsolutionofminimumcost.
Wewillalsomakeuseofthefollowingsimpleobservation.
Observation2.Let
(
G,
kv,
ke,
C,
δ,
w,
c)
beinstanceof DPGGDor DCPGGDthathasanefficientsolution(
U,
D)
.IfdG(
v)
= δ(
v)
forsomev
∈
V(
G)
then v isnotincidenttoanedgeof D.Wesaythataninstance
(
G,
kv,
ke,
C,
δ,
w,
c)
of DPGGD (DCPGGD respectively)isnormalized if(i) forevery v
∈
V(
G)
,δ(
v)
≤
dG(
v)
≤ δ(
v)
+
kv+
ke,and(ii) everyvertex v inthesetS
= {
u∈
V(
G)
|
dG(
u)
= δ(
u)
}
isadjacenttoavertexinS=
V(
G)
\
S.Lemma3.Thereisapolynomial-timealgorithmthatforeachinstanceof DPGGDor DCPGGDeithersolvestheproblemorreturnsan equivalentnormalizedinstance.
Proof. Let
(
G,
kv,
ke,
C,
δ,
w,
c)
beaninstanceof DPGGD.Tosimplifynotation,wekeepthesamenotationforthefunctionsδ,
w,
c ifwedeleteverticesoredgesanddonotmodifythevaluesofthefunctionsfortheremainingelementsifthisdoes notcreateconfusion.Wesaythatareductionruleissafe ifbyapplyingtheruleweeithersolvetheproblemorobtainanequivalentinstance. Itisstraightforwardtoseethatthefollowingreductionrulesaresafe.
Yes-instancerule.IfS
=
V(
G)
then(
∅,
∅)
isasolution,returnayes-answerandstop.Vertexdeletionrule.If G hasavertex v withdG
(
v)
< δ(
v)
ordG(
v)
> δ(
v)
+
kv+
ke,thendelete v andsetkv=
kv−
w(
v)
,C
=
C−
c(
v)
.Ifkv<
0 orC<
0,thenstopandreturnano-answer.Observe that by the exhaustive application ofthe vertexdeletionrule and applyingthe yes-instancerule whenever
possible,weeithersolvetheproblemorweobtainaninstancewhichsatisfies(i)ofthedefinitionofnormalizedinstances, butwhere S
=
V(
G)
.Notice that, inparticular, the yes-instancerule is appliedifthe set ofverticesbecomes empty.To ensure(ii),weapplythefollowingtworules.Contractionrule.If G hastwoadjacentverticesu
,
v∈
S= {
x∈
V(
G)
|
dG(
x)
= δ(
x)
}
suchthatNG(
v)
⊆
S,thenweconstructtheinstance
(
G,
kv,
ke,
C,
δ
,
w,
c)
asfollows.– Contract uv.DenotetheobtainedgraphG
=
G/
uv andlet z bethevertexobtainedfrom u and v. – Setδ
(
z)
=
dG(
z)
andsetδ
(
x)
=
dG(
x)
foranyx∈
S\ {
u,
v}
.Foreachx∈
S,setδ
(
x)
= δ(
x)
.– Setw
(
z)
=
w(
u)
+
w(
v)
andc(
z)
=
c(
u)
+
c(
v)
.Forx∈
V(
G)
\ {
u,
v}
,setw(
x)
=
w(
x)
andc(
x)
=
c(
x)
.– Foreachxz
∈
E(
G)
,set w(
xz)
=
ke+
1 andc(
xz)
=
0.Forallotheredges xy∈
E(
G)
,set w(
xy)
=
w(
xy)
andc(
xy)
=
c
(
xy)
.Let
(
U,
D)
bean efficientsolutionfor(
G,
kv,
ke,
C,
δ,
w,
c)
.ByObservation 2, D has noedges incidentto u or v. Alsoeither u
,
v∈
U or u,
v∈
/
U , because u and v areadjacentanddG(
u)
= δ(
u)
anddG(
v)
= δ(
v)
.LetU= (
U\ {
u,
v})
∪ {
z}
ifu
,
v∈
U andU=
U otherwise.We havethat(
U,
D)
isa solutionfor(
G,
kv,
ke,
C,
δ
,
w,
c)
.If(
U,
D)
is an efficientsolutionfor
(
G,
kv,
ke,
C,
δ
,
w,
c)
,then Dhasnoedgesincidentto z byObservation 2.Ifz∈
U,letU= (
U\ {
z})
∪ {
u,
v}
andU
=
Uotherwise.Weobtainthat(
U,
D)
isasolutionfortheoriginalinstance.Weexhaustivelyapplytheaboverule.Assumethatitcannotbeappliedfor
(
G,
kv,
ke,
C,
δ,
w,
c)
.Thenwehavethatthisinstancesatisfies (i)andthefollowingholds:foranyv
∈
S=
V(
G)
,either v isadjacenttoavertexin S or v isanisolated vertex.Itremainstodealwithisolatedvertices.Isolatesremovalrule.If G hasanisolatedvertex v,thendelete v.
Toseethataboveruleissafe,noticethat,becausetheconsideredinstancesatisfies(i),itfollowsthat
δ(
v)
≤
dG(
v)
=
0,sov
∈
S.Clearly,bytheexhaustiveapplicationofthe isolatesremovalrule,weeithersolvetheproblemorobtainaninstance thatsatisfies(i)and(ii).Nowconsideraninstance
(
G,
kv,
ke,
C,
δ,
w,
c)
of DCPGGD.Wereplacethe yes-instancerule bythefollowingvariant.
Yes-instancerule(connected).IfS
=
V(
G)
and G isconnected,then(
∅,
∅)
isasolution,returnayes-answerandstop. Itisstraightforwardtoverifythatthe vertexdeletionrule andthe contractionrule aresafeforthisproblem.Byapplying theserulesandbytheapplicationoftheconnectedvariantofthe yes-instancerule wheneverpossible,weeithersolvethe problemorobtain anequivalent instancethatsatisfies (i)andhasthepropertythat forany v∈
S,either v isadjacentto a vertexin S or v isan isolated vertex.Suppose that(
G,
kv,
ke,
C,
δ,
w,
c)
satisfiestheseproperties.Observethat if H isa componentof G, thenfor anysolution
(
U,
D)
, either V(
H)
⊆
U or V(
G)
\
V(
H)
⊆
U . Therefore,itis safetoapply the followingvariantofthe isolatesremovalrule.Isolatesremovalrule(connected).If G has anisolated vertex v, thenif w
(
V(
G)
\ {
v})
≤
kv andc(
V(
G)
\ {
v})
≤
C ,then(
V(
G)
\ {
v},
∅)
isasolution,returnayes-answerandstop.Otherwise,if w(
V(
G)
\ {
v})
>
kv orc(
V(
G)
\ {
v})
>
C ,delete vandsetkv
=
kv−
w(
v)
andC=
C−
c(
v)
;ifkv<
0 orC<
0,thenstopandreturnano-answer.Itis easyto seethat iftheinput graphwas planarthen thegraphformed afterapplyingtherules abovewill alsobe
planar.
2
Lemma4.If
(
G,
kv,
ke,
C,
δ,
w,
c)
isanormalizedyes-instanceof DPGGD(DCPGGDrespectively)then G hasa2-dominatingsetofsizeatmostkv
+
2ke.Proof. We prove the lemma for DPGGD; the proof for DCPGGD is the same. Let
(
G,
kv,
ke,
C,
δ,
w,
c)
be a normalizedyes-instanceoftheproblem.Let
(
U,
D)
beasolutionandW=
U∪
V(
D)
.Clearly,|
W|
≤
kv+
2ke,becausetheweightsareLet S
= {
v∈
V(
G)
|
dG(
v)
= δ(
v)
}
andS=
V(
G)
\
S.Foranyvertexv∈
S,eitherv∈
U or v isadjacenttoavertexof Uor v isincidenttoanedgeof D.Hence,S
⊆
NG[
W]
.Letv∈
S.Becausetheconsideredinstanceisnormalized, v isadjacenttoavertexu
∈
S.Itimplies,that S⊆
N2G[
W]
.2
ThefollowingisadirectconsequenceofLemmas 2 and 4.
Lemma5.Thereisafixedconstant
α
suchthat,if(
G,
kv,
ke,
C,
δ,
w,
c)
isanormalizedyes-instanceof DPGGD(DCPGGDrespec-tively),then G hasan
(
α
(
kv+
2ke),
α
)
-protrusiondecomposition.Moreover,ifthereissuchadecomposition,onecanbeconstructedinpolynomialtime.
The next lemma statesthat, for both DPGGD and DCPGGD,an optimal solution can be found inpolynomial time on
graphsofboundedtreewidth.Theproofisbasedonthestandardtechniquesfordynamicprogrammingovertree decompo-sitions.
Lemma6. DPGGD(DCPGGD respectively)canbe solved,andan efficientsolution
(
U,
D)
ofminimumcostcanbeobtained in(
kv+
ke)
O(q)·
poly(
n)
time(in(
q(
kv+
ke))
O(q)·
poly(
n)
timerespectively)forinstances(
G,
kv,
ke,
C,
δ,
w,
c)
where G isann-vertexgraphoftreewidthatmost q and
δ(
v)
≤
dG(
v)
≤ δ(
v)
+
kv+
keforv∈
V(
G)
.Proof. Weuseamoreorlessstandardapproachforconstructionofdynamicprogrammingalgorithmsforgraphsofbounded treewidth.
First,weconsider DPGGD. Let
(
G,
kv,
ke,
C,
δ,
w,
c)
beaninstanceoftheproblemwheretw(G)
≤
q andδ(
v)
≤
dG(
v)
≤
δ(
v)
+
kv+
ke forall v∈
V(
G)
.Wefirstofall assumethata nicetreedecomposition(X ,
T)
of G withwidtht=
O(
q)
isgiven. Tosimplifylaterarguments,wemayassumet
≥
2.Forthis,wemayusethealgorithmof[2]toobtaina decomposi-tionwhosewidthisatmostfivetimestheoptimalin2O(q)·
n stepsandthenconvertittoanicetreedecompositionusingtheaforementionedresultsofKloks[23].
Let r denotetherootof T .Foranynode i
∈
V(
T)
,let Ti denotethesubtreeof T inducedby i anditsdescendantsandlet Gi
=
G[
j∈V(Ti)Xj
]
.Weapplyadynamicprogrammingalgorithmover(X ,
T)
.First,wedescribethetablesthatareconstructedforthenodesof T .Leti
∈
V(
T)
.Wedefinetableiasapartialfunctionwhoseinputsarequintuples
(
X,
Y,
γ
,
hv,
he)
where– X
⊆
Xi,– Y
⊆
E(
G[
Xi])
,–
γ
:
Xi\
X→ {
0,
. . . ,
kv+
ke}
,– hv
≤
kv and– he
≤
ke.Thevalueoftablei isaminimumcostpair
(
U,
D)
∈
2V(Gi)×
2E(Gi)withthefollowingproperties:(i) foranyv
∈
U andanye∈
D,v and e arenotincident, (ii) w(
U)
≤
hv andw(
D)
≤
he,(iii) U
∩
Xi=
X andD∩
E(
G[
Xi])
=
Y ,(iv) foreveryv
∈
Xi\
X ,thenumberofneighboursof v in GithatbelonginU\
XiplusthenumberofedgesofD\
E(
G[
Xi])
thatareincidentto v isexactly
γ
(
v)
,(v) foreach v
∈
V(
Gi)
\
Xi,dGi(
v)
= δ(
v)
whereGi=
Gi−
U−
D,and,ifnosuchpair
(
U,
D)
exists,thentablei(
X,
Y,
d,
hv,
he)
isvoid.Recall that Xr
= ∅
. Observethat(
G,
kv,
ke,
C,
δ,
w,
c)
is a yes-instanceifand onlyif tabler(
∅,
∅,
∅,
kv,
ke)
is non-void(where
∅
: ∅
→ {
0,
. . . ,
kv+
ke}
).Moreover,insuchacase,thevalueoftabler(
∅,
∅,
∅,
kv,
ke)
isaminimum-costsolutionforthisinstance.
Nowweexplainhowweconstructtableiforeachi
∈
V(
T)
.If i isaleaf node,tablei isconstructedinastraightforwardwaybecause Xi
= ∅
.Indeed,for0≤
hv≤
kv and0≤
he≤
ke we settablei(
∅,
∅,
∅,
hv,
he)
= (∅,
∅)
andhavetablei voidinallothercases.Hence,itremainstogivetheconstructionforintroduce,forget,andjoin nodes.Leti
∈
V(
T)
beanodeofone ofthesetypes.Assumeinductivelythatthefunctiontablei foreverychild iof i hasalreadybeenconstructed.In whatfollowswe write tablei
(
X,
Y,
γ
,
hv,
he)
(
U,
D)
to referto thefollowingprocedure: Iftablei(
X,
Y,
γ
,
hv,
he)
is undefined, set it to be equal to
(
U,
D)
. If tablei(
X,
Y,
γ
,
hv,
he)
= ( ˆ
U,
Dˆ
)
and c( ˆ
U∪ ˆ
D)
>
c(
U∪
D)
, change tablei(
X,
Y,
γ
,
hv,
he)
tobeequalto(
U,
D)
.Otherwise,donotchangetablei(
X,
Y,
γ
,
hv,
he)
.Constructionforanintroducenode. Let i be thechild of i and Xi
=
Xi∪ {
v}
.Notice that NGi(
v)
⊆
Xi.We start withtablei empty.Then, foreach pair hv
,
he where hv≤
kv andhe≤
ke and each pair((
X,
Y,
γ
,
hv,
he),
(
U,
D))
∈
tablei– LetX
←
X∪ {
v}
,Y←
Y,γ
←
γ
,U←
U∪ {
v}
,and D←
D. Ifhv≥
hv+
w(
v)
,thentablei(
X,
Y,
γ
,
hv,
he)
(
U,
D)
.– LetX
←
X,U←
U,γ
←
γ
∪ {(
v,
0)
}
.For every L
⊆ {
vu|
vu∈
E(
G),
u∈
Xi\
X}
, let Y←
Y∪
L, D←
D∪
L, and if he≥
he+
w(
L)
, then tablei(
X,
Y,
γ
,
hv,
he)
(
U,
D)
.Constructionforaforgetnode. Let i be the child of i and Xi
=
Xi\ {
v}
. We start with tablei empty. For each pair((
X,
Y,
γ
,
hv,
he),
(
U,
D))
∈
tablei,wedothefollowing.– If v
∈
X then let X←
X\ {
v}
, Y←
Y,anddefineγ
by replacinginγ
each pair(
u,
γ
(
u))
where uv∈
E(
G)
andu
∈
Xi\
X bythepair(
u,
γ
(
u)
+
1)
.Ifmaxu∈Xi\X
γ
(
u)
≤
kv+
ke,thentablei(
X,
Y,
γ
,
hv,
he)
(
U,
D)
.– Ifv
∈
/
X,thenlet X←
X,L← {
vu∈
E(
G)
|
u∈
Xi}
∩
Y,Y←
Y\
L,anddefineγ
byreplacinginγ
−=
γ
\ {(
v,
γ
(
v))
}
eachpair
(
u,
γ
(
u))
whereuv∈
L bythepair(
u,
γ
(
u)
+
1)
.If
δ(
v)
=
dG(
v)
− |
L|
−
γ
(
v)
andmaxu∈Xi\Xγ
(
u)
≤
kv+
ke,thentablei(
X,
Y,
γ
,
hv,
he)
(
U,
D)
.Constructionforajoinnode. Let iand ibethechildrenof i.Westartwithtableiempty.Foreachpair
((
X,
Y,
γ
,
hv,
he),
(
U,
D))
∈
tablei andeachpair((
X,
Y,
γ
,
hv,
he),
(
U,
D))
∈
tablei wedothefollowing.– Let
γ
←
γ
+
γ
,U←
U∪
UandD←
D∪
D.Ifmaxu∈Xi\X
γ
(
u)
≤
kv+
ke,thenforanytwointegershv,he suchthathv+
hv−
w(
X)
≤
hv≤
kv andhe+
he−
w(
Y)
≤
he
≤
ke,tablei(
X,
Y,
γ
,
hv,
he)
(
U,
D)
.Usingstandardarguments,itisstraightforwardtoverifythecorrectnessofthealgorithm.Toevaluatetherunningtime, recallthattablei receivesa quintuple
(
X,
Y,
γ
,
hv,
he)
asinput.There areatmost 2t+1 possiblechoicesfor X ,23(t+1)−6=
23t−3 choicesof Y (becauseoftheplanarityof G),
(
kv
+
ke+
1)
t+1 choicesofγ
,kv+
1 possiblevaluesof hv andke+
1possiblevaluesfor he.Wethereforehavethateach tablei has
(
kv+
ke)
O(t) entries.Thisimpliesthat therunningtime ofthedynamicprogrammingalgorithmis
(
kv+
ke)
O(t)·
n.Nowweconsider DCPGGD.Thedifferenceisthatwehavetokeeptrackofcomponentsofapartialsolutionasisstandard fordynamicprogrammingalgorithmsforgraphsofboundedtreewidthwithaconnectivityconditionsuchas,e.g.the Steiner Treeproblem. Let
(
G,
kv,
ke,
C,
δ,
w,
c)
bean instanceof DCPGGD wheretw(G)
≤
t andδ(
v)
≤
dG(
v)
≤ δ(
v)
+
kv+
ke forv
∈
V(
G)
.Without lossof generalitywe assume that a nicetreedecomposition(
X ,
T)
of G withtreewidth atmost t is givenandapplyadynamicprogrammingalgorithmover(X ,
T)
.Leti∈
V(
T)
.Wedefinetableci asapartialfunctionwhoseinputsarequintuples
(P,
Y,
γ
,
hv,
he)
where–
P = {
P0,
. . . ,
Ps}
isapartitionof Xi,– Y
⊆
E(
G[
Xi])
,–
γ
:
Xi\
X→ {
0,
. . . ,
kv+
ke}
,– hv
≤
kv and– he
≤
ke.Thevalueoftableci isaminimumcostpair
(
U,
D)
∈
2V(Gi)×
2E(Gi)withthefollowingproperties: (i) foranyv∈
U andanye∈
D, v and e arenotincident,(ii) w
(
U)
≤
hv andw(
D)
≤
he,(iii) U
∩
Xi=
P0 andD∩
E(
G[
Xi])
=
Y ,(iv) foreveryv
∈
Xi\
X ,thenumberofneighboursof v in GithatbelonginU\
Xi,plusthenumberofedgesofD\
E(
G[
Xi])
thatareincidentto v isexactly
γ
(
v)
,(v) foreachv
∈
V(
Gi)
\
Xi,dGi(
v)
= δ(
v)
whereGi=
Gi−
U−
D,(vi) ifs
=
0,thenGi=
Gi−
U−
D isconnectedandifs≥
1,then Gihas s componentsH1,
. . . ,
HssuchthatV(
Hi)
∩
Xh=
Piforh
∈ {
1,
. . . ,
s}
,and,ifnosuchpair
(
U,
D)
exists,thentableic(P,
Y,
d,
hv,
he)
isvoid.Asinthenon-connectedcase,
(
G,
kv,
ke,
C,
δ,
w,
c)
isayes-instanceifandonlyiftablecr(
∅,
∅,
∅,
kv,
ke)
isnon-voidandthevalueoftablecr
(
∅,
∅,
∅,
kv,
ke)
,ifexists,isaminimum-costsolutionforthisinstance.Thepartialfunctiontableci isconstructedforeveryi
∈
V(
T)
similarlytotheconstruction oftablei for DPGGD.Becausethereareatmost
(
t+
1)
t+1partitionsP
ofeach Xi,wehavethateachtablecontains(
t(
kv+
ke))
O(t)entries.Therefore,therunningtimeofthedynamicprogrammingalgorithmis