SLIDE 1
SmallMaximalIndependentSets andFasterExactGraphColoring - - PowerPoint PPT Presentation
SmallMaximalIndependentSets andFasterExactGraphColoring - - PowerPoint PPT Presentation
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 SmallMaximalIndependentSets andFasterExactGraphColoring DavidEppstein Univ.ofCalifornia,Irvine
SLIDE 2
SLIDE 3
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Isn’titimpossibletosolvegraphcoloringexactly?
Itseemstorequireexponentialtime[GareyandJohnsonGT4] butthat’sverydifferentfromimpossible
Sowhystudyit?
Withfastcomputerswecandoexponential-time computationsofmoderateandincreasingsize Algorithmicimprovementsareevenmoreimportant thaninpolynomial-timearena Graphcoloringisuseful e.g.registerallocation,parallelscheduling Approximatecoloringalgorithmshavepoorapproximationratios Interestinggapbetweentheoryandpractice worst-caseboundsandempiricalresultsdifferinbaseofexponent
SLIDE 4
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
RegisterAllocationApplication
Problem:compilehigh-levelcodetomachineinstructions Needtoassociatecodevariablestomachineregisters Evenifcodehasfewexplicltlynamedvariables, compilerscanaddmoreaspartofoptimization Twovariablescansharearegisterifnotactiveatthesametime
Solution:
Drawagraph,vertices=variables,edges=simultaneousactivity Colorwithkcolors,k=numberofmachineregisters Fastenoughexactalgorithmmightbeusableathighlevelsofoptimization
SLIDE 5
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Previousworkonexactcoloring
Lawler,1976: Schiermeyer,1994: Beigel&Eppstein,1995: Schöning,1999: Eppstein,2001: Thispaper: 3-coloringO(1.4423n) Foreachmaximalindependentset,testifcomplementbipartite k-coloring(unboundedk)O(2.4423n) Dynamicprogramming 3-coloringO(1.415n) Transformgraphtoincreasedegreeuntildegree=n–1 3-coloringO(1.3446n) Reducetomoregeneralconstraintsatisfactionproblem Complicatedcaseanalysistofjndgoodlocalreductions Generalconstraintsatisfactionalgorithm Randomwalkinspaceofvalueassignments Noimprovementforcoloring 3-coloringO(1.3289n),4-coloringO(1.8072n) Morecaseanalysis,simplerandomizedrestriction k-coloring(unboundedk)O(2.4150n)
SLIDE 6
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Lawler’salgorithm
Dynamicprogramming: Foreachsubgraphinducedbyasubsetofvertices computeitschromaticnumberfrompreviouslycomputedinformation
forSinsubsetsofverticesofG: ncolors[S]=n forIinmaximalindependentsubsetsofS: ncolors[S]=min(ncolors[S], ncolors[S-I]+1)
Outerloopneedstobeorderedfromsmallertolargersubsets soncolors[S-I]alreadycomputedwhenneeded
SLIDE 7
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Lawler’salgorithmanalysis
Keyfacts:n-vertexgraphhasO(3n/3)maximalindependentsets[Moon&Moser,1965] MIS’scanbelistedintimeO(3n/3)[Johnson,Yannakakis,&Papadimitriou1988] Worstcaseexample:n/3disconnectedtriangles Time:sum3|S|/3=sum(
n i)3i/3=O((1+31/3)n)
Bottleneck:listingMIS’sofeverysubsetofverticesofG Space:onenumberpersubset,O(2n)
SLIDE 8
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Firstrefjnement:
WhentheloopvisitssubsetS, insteadofcomputingitschromaticnumberfromitssubsets, useitschromaticnumbertoupdateitssupersets
forSinsubsetsofverticesofG: forIinmaximalindependentsubsetsofG-S: ncolors[S+I]=min(ncolors[S+I], ncolors[S]+1) WhyisitsafetoonlyconsidermaximalindependentsubsetsofG-S?
Weneedonlycorrectlycomputencolors[S]whenSismaximalk-chromatic butifIisnotmaximal,neitherisS+I
Analysis
SameasoriginalLawleralgorithm
SLIDE 9
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Secondrefjnement:
Onlylookatsmallmaximalindependentsubsets
forSinsubsetsofverticesofG: limit=|S|/ncolors[S] forIinmaximalindependentsubsetsofG-S suchthat|I|≤limit: ncolors[S+I]=min(ncolors[S+I], ncolors[S]+1) WhyisitsafetoignorelargemaximalindependentsubsetsofG-S?
IfXismaximalk-chromatic,letIbeitssmallestcolorclass ThenS=X-Iismaximal(k–1)-chromatic andIwillbebelowthelimitforS So,theouterloopiterationforSwillcorrectlysetncolors[X]=k
SLIDE 10
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
SmallMaximalIndependentSets
Tocontinueanalysis,weneedfactsandalgorithms analogoustoMoon-MoserandJohnson-Yannakakis-Papadimitriou
Theorem:
Foranyn-vertexgraphGandlimitL thereareatmost34L–n4n–3LmaximalindependentsetsIwith|I|≤L AllsuchsetscanbelistedintimeO(34L–n4n–3L) Theseboundsaretightwhenn/4≤L≤n/3: G=disjointunionof4L–ntrianglesandn–3LK4’s
SLIDE 11
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Proofidea:
ShowsetofMIS’s=unionofMISsetsofmultiplesmallergraphs CombinesmallergraphMIScountstoformrecurrence
Firstcase:vertexwithdegree≥three
SLIDE 12
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
IfgivenvertexispartofMIS
ThenrestofMISisalsoanMISofG–neighbors(v) Subgraphhasfourfewervertices,smallerboundonremainingMISsize
SLIDE 13
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
IfgivenvertexisnotpartofMIS
ThenitisalsoanMISofG–v Subgraphhasonefewervertex,sameboundonMISsize NotallMIS’sofsubgraphareMIS’soforiginalgraph butovercountingdoesn’thurt
SLIDE 14
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
DetailsofCaseAnalysis
IfGcontainsvofdegree≥3: splitintoMIS’scontainingvornotcontainingv #MIS(G)≤#MIS(n–4,L–1)+#MIS(n–1,L) IfGcontainsvofdegree=1: EveryMIScontainseithervoritsneighbor #MIS(G)≤2#MIS(n–2,L–1) IfGcontainsvofdegree=0: EveryMIScontainsv,#MIS(G)≤#MIS(n–1,L–1) IfGcontainschainu-v-w-xallofdegree=2: EachMIScontainsu,containsv,orexcludesuandcontainsw #MIS(G)≤2#MIS(n–3,L–1)+#MIS(n–4,L–1) Remainingcase,Gconsistsofdisjointtriangles has3n/3MIS’s,allofsizen/3 Provebyinductionthateachexpressionisatmost34L–n4n–3L
Easilyturnedintoeffjcientrecursivealgorithm
SLIDE 15
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Analysisofsecondrefjnementtocoloringalgorithm
StillnotanybetterthanLawler Problem: IfShaschromaticnumberatmost2thenlimit=|S|/2 andsmallMISboundonlyanimprovementfor|S|≥2n/5 Doesn’tcoverthetheworstcasesizesofsets|S|forthealgorithm
SLIDE 16
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Finalrefjnement:
Handlelow-chromatic-numbersubsetsspecially
forSinsubsetsofverticesofG: ifSis3-colorable: computencolors[S]using3-coloringalg ifncolors[S]≥3: limit=|S|/ncolors[S] forIinmaximalindependentsubsetsofG-S suchthat|I|≤limit: ncolors[S+I]=min(ncolors[S+I], ncolors[S]+1)
SLIDE 17
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001
Analysis
EachsetShaslimit≤|S|/3 SotimetofjndsmallmaximalindependentsetsofG-Sis foundbyplugging|G-S|and|S|/3intosmallMISformula: timetoprocessS=O(34|S|/3–|G–S|4|G–S|–3|S|/3) SumoverallSsimplifjestoO((4/3+34/3/4)n),approximately2.415n Additional3-coloringtestpersubsetonlyaddsO(2.3289n)
SLIDE 18