FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 SmallMaximalIndependentSets andFasterExactGraphColoring DavidEppstein Univ.ofCalifornia,Irvine Dept.ofInformationandComputerScience
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 TheExactGraphColoringProblem: Givenanundirectedgraph G Determinetheminimumnumberofcolors neededtocolortheverticesof G sothatnotwoadjacentverticeshavethesamecolor Wewantworst-caseanalysis Noapproximations Nounprovenheuristics
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
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 RegisterAllocationApplication Problem:compilehigh-levelcodetomachineinstructions Needtoassociatecodevariablestomachineregisters Evenifcodehasfewexplicltlynamedvariables, compilerscanaddmoreaspartofoptimization Twovariablescansharearegisterifnotactiveatthesametime Solution: Drawagraph,vertices=variables,edges=simultaneousactivity Colorwith k colors, k =numberofmachineregisters Fastenoughexactalgorithmmightbeusableathighlevelsofoptimization
FasterExactGraphColoring 3-coloringO(1.415 n ) Morecaseanalysis,simplerandomizedrestriction 3-coloringO(1.3289 n ),4-coloringO(1.8072 n ) Noimprovementforcoloring Randomwalkinspaceofvalueassignments Generalconstraintsatisfactionalgorithm Complicatedcaseanalysistofjndgoodlocalreductions Reducetomoregeneralconstraintsatisfactionproblem 3-coloringO(1.3446 n ) Transformgraphtoincreasedegreeuntildegree= n –1 Dynamicprogramming D.Eppstein,UCIrvine,WADS2001 k -coloring(unbounded k )O(2.4423 n ) Foreachmaximalindependentset,testifcomplementbipartite 3-coloringO(1.4423 n ) Thispaper: Eppstein,2001: Schöning,1999: Beigel&Eppstein,1995: Schiermeyer,1994: Lawler,1976: Previousworkonexactcoloring k -coloring(unbounded k )O(2.4150 n )
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 so ncolors[S-I] alreadycomputedwhenneeded
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 Lawler’salgorithmanalysis Keyfacts: n -vertexgraphhasO(3 n /3 )maximalindependentsets[Moon&Moser,1965] MIS’scanbelistedintimeO(3 n /3 )[Johnson,Yannakakis,&Papadimitriou1988] Worstcaseexample:n/3disconnectedtriangles Time:sum3 |S|/3 =sum ( n i ) 3 i /3 =O ( (1+3 1/3 ) n ) Bottleneck:listingMIS’sofeverysubsetofverticesofG Space:onenumberpersubset,O(2 n )
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 Firstrefjnement: Whentheloopvisitssubset S , insteadofcomputingitschromaticnumberfromitssubsets, useitschromaticnumbertoupdateitssupersets forSinsubsetsofverticesofG: forIinmaximalindependentsubsetsofG-S: ncolors[S+I]=min(ncolors[S+I], ncolors[S]+1) WhyisitsafetoonlyconsidermaximalindependentsubsetsofG-S? Weneedonlycorrectlycompute ncolors[S] when S ismaximal k -chromatic butif I isnotmaximal,neitheris S+I Analysis SameasoriginalLawleralgorithm
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? If X ismaximal k -chromatic,let I beitssmallestcolorclass Then S=X-I ismaximal( k –1)-chromatic and I willbebelowthelimitfor S So,theouterloopiterationfor S willcorrectlyset ncolors[X]=k
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 SmallMaximalIndependentSets Tocontinueanalysis,weneedfactsandalgorithms analogoustoMoon-MoserandJohnson-Yannakakis-Papadimitriou Theorem: Forany n -vertexgraphGandlimitL thereareatmost3 4L– n 4 n –3L maximalindependentsetsIwith|I| ≤ L AllsuchsetscanbelistedintimeO(3 4L– n 4 n –3L ) Theseboundsaretightwhenn/4 ≤ L ≤ n/3: G=disjointunionof4L– n trianglesand n –3L K 4 ’s
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 Proofidea: ShowsetofMIS’s=unionofMISsetsofmultiplesmallergraphs CombinesmallergraphMIScountstoformrecurrence Firstcase:vertexwithdegree ≥ three
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 IfgivenvertexispartofMIS ThenrestofMISisalsoanMISofG– neighbors(v) Subgraphhasfourfewervertices,smallerboundonremainingMISsize
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 IfgivenvertexisnotpartofMIS ThenitisalsoanMISofG– v Subgraphhasonefewervertex,sameboundonMISsize NotallMIS’sofsubgraphareMIS’soforiginalgraph butovercountingdoesn’thurt
FasterExactGraphColoring EveryMIScontainsv,#MIS(G) ≤ #MIS(n–1,L–1) Provebyinductionthateachexpressionisatmost3 4L– n 4 n –3L has3 n /3 MIS’s,allofsize n /3 Remainingcase,Gconsistsofdisjointtriangles #MIS(G) ≤ 2#MIS(n–3,L–1)+#MIS(n–4,L–1) EachMIScontainsu,containsv,orexcludesuandcontainsw IfGcontainschainu-v-w-xallofdegree=2: IfGcontainsvofdegree=0: D.Eppstein,UCIrvine,WADS2001 #MIS(G) ≤ 2#MIS(n–2,L–1) EveryMIScontainseithervoritsneighbor IfGcontainsvofdegree=1: #MIS(G) ≤ #MIS(n–4,L–1)+#MIS(n–1,L) splitintoMIS’scontainingvornotcontainingv IfGcontainsvofdegree ≥ 3: DetailsofCaseAnalysis Easilyturnedintoeffjcientrecursivealgorithm
FasterExactGraphColoring D.Eppstein,UCIrvine,WADS2001 Analysisofsecondrefjnementtocoloringalgorithm StillnotanybetterthanLawler Problem: IfShaschromaticnumberatmost2thenlimit=|S|/2 andsmallMISboundonlyanimprovementfor|S| ≥ 2 n /5 Doesn’tcoverthetheworstcasesizesofsets|S|forthealgorithm
Recommend
More recommend