Dueckrewrite规则

rewrite规则  时间:2021-01-12  阅读:()
Acompletealgorithmtosolvethegraph-coloringproblemHubertoAyaneguiandAlbertoChavez-AragonFacultaddeCienciasBasicas,IngenieriayTecnologia,UniversidadAutonomadeTlaxcala,CalzadadeApizaquitos/n,Apizaco,Tlaxcala,Mexico{hayanegui,albertochz}@gmail.
comAbstract.
TheGraphk-ColorabilityProblem(GCP)isawellknownNP-hardproblemwhichconsistinfindingthekminimumnumberofcolorstopainttheverticesofagraphinsuchawaythatanytwoverticesjoinedbyanedgehavealwaysdifferentcolors.
Manyyearsago,SimulatedAnnealing(SA)wasusedforgraphcoloringtaskobtaininggoodresults;howeverSAisnotacompletealgorithmanditnotalwaysgetstheoptimalsolution.
InthispaperGCPistransformedintotheSatisfiabilityProblemandthenitissolvedusingaalgorithmthatusestheThresholdAcceptingalgorithm(avariantofSA)andtheDavis&Putnamalgorithm.
Thenewalgorithmisacompleteoneandsoitgetsbetterqualitythattheclassicalsimulatedannealingalgorithm.
Keywords:graphcoloring,simulatedannealing,thresholdaccepting,davis&putnam.
1IntroductionLetG=(V,E)beagraphwhereVisasetofverticesandEisasetofedges.
Ak-coloringofGisapartitionofVintoksets{V1,…,Vk},suchthatnotwoverticesinthesamesetareadjacent,i.
e.
,ifv,wbelongtoVi,1ik,then(v,w)notbelongtoE.
Thesets{V1,…,Vk}arereferredtoascolors.
Thechromaticnumber,x(G),isdefinedastheminimumkforwhichGisk-colorable.
TheGraphk-ColorabilityProblem(GCP)canbestatedasfollows.
GivenagraphG,findx(G)andthecorrespondingcoloring.
GCPisaNP-hardproblem[1].
GCPisveryimportantbecauseithasmanyapplications;someofthemareplanningandschedulingproblems[2][3],timetabling[4],mapcoloring[5]andmanyothers.
SinceGCPisaNP-hardproblem,untilnowtherearenotknowndeterministicmethodsthatcansolveditinapolynomialtime[1].
Sonon-deterministicalgorithmshavebeenbuilttosolveit;oneofthemisSimulatedAnnealing(SA)[6]thathasbeenusedonGCPwithgoodresults[7][8].
However,SAisnotacompletealgorithmanditnotalwaysgetstheoptimalsolution.
TheapproachusedinthispaperistotransformGCPintoaSatisfiabilityProblem(orSATproblem)[12]andthenusethealgorithmproposedinthispaper.
WeproposetouseiterativelytheThresholdAccepting(TA)algorithm(avariantofSimulatedAnnealing)[9]andthenaDavisandPutnamalgorithm[10].
2SimulatedannealingandthresholdacceptingSimulatedannealing(SA)[6]isastochasticcomputationaltechniquederivedfromstatisticalmechanicstofindnearglobal-minimum-costsolutionstolargeoptimizationproblems.
Inmanyinstances,findingtheglobalminimumvalueofanobjectivefunctionwithmanydegreesoffreedomsubjecttoconflictingconstraintsisanNP-completeproblem,sincetheobjectivefunctionwilltendtohavemanylocalminimums.
Aprocedureforsolvingoptimizationproblemsofthistypeshouldsamplethesearchspaceinsuchawaythatithasahighprobabilityoffindingtheoptimaloranear-optimalsolutioninareasonabletime.
Overthepastdecade,SAhasproventobeapowerfultechniquethatmeetsthesecriteriaforawiderangeofproblems.
SAexploitsananalogybetweenthewayametalcoolandfreezesintoaminimumenergycrystallinestructure(theannealingprocess)andthesearchforaminimuminamoregeneralsystem.
SAmakesarandomsearchwhichnotonlyacceptschangesthatincreaseitscostfunctionf,butalsosomethatdecreaseit.
Forthisreason,SAusesacontrolparameterc,whichbyanalogywiththeoriginalapplicationisknownasthe"SystemTemperature",cstartsouthighandgraduallydecreases.
AdeterioratingrandommovefromsolutionSitoSjisacceptedwithaprobabilityexp-(f(Sj)-f(Si))/c.
Ifthismoveisnotdeteriorating(thenewsolutionSjisbetterthanthepreviousoneSi)thenitisacceptedandanewrandommoveisproposedagain.
Whenthetemperatureishigh,abadmovecanbeaccepted.
Asctendstozero,SAbecomesmoredemandingthroughacceptjustbettermoves.
Thealgorithmforminimizationisshownbelow:ProcedureSIMULATEDANNEALINGBeginINITIALIZE(Si=initial_solution,c=initial_temperature)k=0RepeatRepeatSj=PERTURBATION(Si)IfCOST(Sj)random[0,1)ThenSi=SjUntilstochasticequilibriumk=k+1c=COOLING(c)UntilthermalequilibriumEndTheINITIALIZEfunctionstartstheinitialsolutionSiandtheinitialtemperaturec.
ThePERTURBATIONfunctionmakesarandomperturbationfromSitogenerateaneighborhoodsolutionSj.
TheCOSTfunctiongetsthecostfromasolution.
TheINC_COSTfunctiongetsthedifferenceincostbetweenSjandSi.
Finally,theCOOLINGfunctiondecreasestheactualtemperatureparameterc.
AvariantofSimulatedAnnealing(SA)istheThresholdAcceptingmethod(TA).
ItwasdesignedbyDueck&Scheuer[9]inordertogetamoreefficientalgorithmthanSimulatedAnnealing.
Theprincipaldifference,betweenSAandTA,isthemechanismofacceptingthesolutionrandomlychosenfromthesetofneighborsofthecurrentsolution.
WhileSAusesaprobabilisticmodel(seeequation(1)),TAusesastaticmodel:ifthedifferencebetweenthecostvaluesofthechosensolutionSjandthecurrentoneSiissmallerthanathresholdT(ortemperature),TAacceptsmovingtothechosensolution.
Otherwiseitstaysatthecurrentsolution.
Again,thethresholdparameterTisapositivecontrolparameterwhichdecreaseswithincreasingnumberofiterationsandconvergestovaluenearto0.
Henceforth,ineveryiterationsomesolutiondeteriorationareallowed;thisdeteriorationdependsonthecurrentthresholdT(seeequation(2));inthiswayonlyimprovingsolutionswithalmostnonedeteriorationsolutionareacceptedattheendoftheprocess.
p(S1,S2)=exp(min{f(S1)-f(S2),0}/c)(1)COST(Sj)ThiscouldbebecauseTAdoesnotcomputetheprobabilisticfunction(1)anddoesnotexpendalotoftimemakingrandomdecisions.
TheThresholdAcceptingalgorithmforminimizationisthefollowing:ProcedureTHRESHOLDACCEPTINGBeginINITIALIZE(Si=initial_solution,T=initial_thresholdortemperature)k=0RepeatRepeatSj=PERTURBATION(Si)E=COST(Sj)–COST(Si)IfESALAusesSimulated-annealingapproachwithtwomainloops:internalloopnamedMetropolisCycleandexternalloopcalledTemperatureCycle.
Numberofiterationsininternalandexternalloopusuallyaretunedexperimentally[6],[9].
However,recentlyananalyticalmethodusingaMarkovmodelwasproposedtotuneTAsolvingSATproblems.
ExternalloopexecutedfromainitialtemperatureTiuntilafinaltemperatureTfandtheinternalloopbuildsaMarkovchainoflengthLkwhichdependsonthetemperaturevalueTk(krepresentsthesequenceindexinTemperaturecycle).
AstrongrelationexistsbetweenTkandLkinawaythat:IfTk,Lk0andifTk0,Lk.
(3)DuetoTAisappliedthroughaneighborhoodstructure,V,(PERTURBATIONfunctionmakesarandomperturbationfromSitogenerateaneighborhoodsolutionSj),themaximumnumberofdifferentsolutionsthatcanberejectedfromSiisthesizeofitsneighborhoods,|VSi|.
ThenthemaximumlengthofaMarkovchaininaTAalgorithmisthenumberofsamplesthatmustbetakeninordertoevaluateanexpectedfractionofdifferentsolutionsfromVSiatthefinaltemperatureTf,thisis:Lf=C|VSi|.
(4)whereCvariesfrom1C4.
6(explorationfrom63%until99%),LfisthelengthoftheMarkovchainatTf.
From(3),LkmustbeincrementedinasimilarbutinversewaythatTkisdecremented.
ThenforthegeometricreductioncoolingfunctionusedbyKirkpartick[6],andDueckandScheuer[9],Tk+1=Tk.
(5)theincrementalMarkovchainfunctionmustbe:Lk+1=Lk.
(6)where=exp((lnLf–lnLi)/n).
(7)Here,LiisthelengthoftheMarkovchainatTi,usuallyLi=1,andnisthenumberoftemperaturestepsfromTitoTfthrough(5).
Now,themaximumandminimumcostincrementproducedthroughtheneighborhoodstructureare:ZVmax=Max{COST(Sj)–COST(Si)}.
(8)ZVmin=Min{COST(Sj)–COST(Si)}.
(9)forallSjVSi,andforallSiSThenTiandTfmustbecalculatedas:Ti=ZVmax.
(10)TfZVmin.
(11)ThiswayofdeterminingtheinitialtemperatureenableTAtoacceptanypossibletransitionatthebeginningoftheprocess,sinceTiissetasthemaximumdeteriorationincostthatmaybeproducedthroughtheneighborhoodstructure.
Similarly,TfenablesTAtohavecontroloftheclimbingprobabilityuntilthealgorithmperformsagreedylocalsearch.
3Davis&PutnamMethodSatisfiablityProblem[12](orSAT)isveryimportantincomplexitytheory.
Letbeapropositionalformulalikeformula(12):F=F1&F2&…&Fn(12)whereeveryFiisadisjunction.
EveryFiisadisjunctionofpropositionalformulassuchasX1vX2v.
.
vXr.
EveryFiisaclauseandeveryXjisaliteral.
Everyliteralcantakeatruthvalue(0orfalse,1ortruth).
InSatisfiabilityproblemasetofvaluesfortheliteralsshouldbefound,insuchawaythattheevaluationof(12)betrue;otherwiseif(12)isnottrue,wesaythatFisunsatisfiable.
Besideswesaythat(12)isinConjunctiveNormalFormorCNF.
TheDavis&Putnammethodiswidelyregardedasoneofthebestdeterministicmethodsfordecidingthesatisfiability[12]ofasetofpropositionalclauses[10].
Itisalsoacompleteresolutionmethod.
Thisprocedurecallsitselfafterrewritingtheinputformulaaccordingtoanumberofrulesforgeneratingasmallerformulawiththesametruthvalue.
TherulesusedfortheDavis&Putnammethodare:Rule1:iftheinputformulahasnoclauses,thenitissatisfiableRule2:ifithasaclausewithnoliterals,itisunsatisfiableRule3:ifithasaclausewithexactlyoneliteral,thenmaketheliteraltrueandrewritetheformulaaccordinglyRule4:ifsomevariableappearonlypositivelyornegatively,thenpickonesuchvariableandassignavaluetoittomaketheliteraltrue,andrewritetheformulaaccordinglyIfnonerulecouldbeapplied,onepicksupanarbitraryvariableasabranchingpointandtwonewformulasarederivedbyassigning0and1tothisvariable.
Ifoneofthecallsreturnswiththepositiveanswertheinputissatisfiable;otherwise,itisunsatisfiable.
TheDavis&Putnamalgorithmisshownbelow:FunctionDAVIS-PUTNAM(Informula:clauseslist)BeginREDUCE(formula,vreduce)IfformulaisemptyThenReturnvreduceElseIfformulahasaclausewithnoliteralsThenReturnfailElseChoosealiteralVfromformulavaluation=DAVIS-PUTNAM(SUBSTITUTION(true,V,formula))Ifvaluation!
=failThenReturnADD(V=true,vreduce,valuation)valuation=DAVIS-PUTNAM(SUBSTITUTION(false,V,formula))Ifvaluation!
=failThenReturnADD(V=false,vreduce,valuation)ReturnfailEndifEndDAVIS-PUTNAMFunctionSUBSTITUTION(TF,V,formula)BeginForEachoneclauseCInformulaDoIf[CcontainVandTF=true]or[Ccontain~VandTF=false]ThendeleteCfromformulaElseIf[CcontainVandTF=false]or[Ccontain~VandTF=true]ThendeleteVfromCEndifEndforReturnformulaEnd_SUBSTITUTIONFunctionREDUCE(InOut:formula,vreduce)Beginvreduce=emptyWhileexistsclauseCInformulawithexactlyoneliteralLIfLispositivevariableVThenformula=SUBSTITUTION(true,V,formula)vreduce=CONS(V=true,vreduce)ElseIfLisnegativevariableVThenformula=SUBSTITUTION(false,V,formula)vreduce=CONS(V=false,vreduce)EndifEndwhileReturn(formula)End_REDUCETheDAVIS-PUTNAMfunctionisthemainfunctionanditselectsrandomlyaliteraltosetatrueagroupofvaluesinordertocreateunitaryclauses.
Ifthattruesetvaluesisnotthecorrectsolutionthecomplementsetoftruevaluesistried.
Ifthenewassignmentisneitherasatisfiablesolution,thentheformulaisunsatisfiable.
ThefunctionSUBTITUTIONmakesthepropagationofoneliteraloveralltheclausesinformula,deletingclauseswhereoccursthepositiveliteralLanditsvalueis1(true).
Thereforetheclauseswhere~Loccurscandeletethatliteral.
TheREDUCEfunctioncarriesoutthesearchofunitaryclauses,sothatitcanbepossiblepropagatethroughthefunctionSUBSTITUTION.
4GraphColoringthroughAcceptingandDavis&PutnamInformallycoloringagraphwithkcolorsorGraphk-ColorabilityProblem(GCP)isstatedasfollows:IsitpossibletoassignoneofkcolorstoeachnodeofagraphG=(V,E),suchthatnotwoadjacentnodesbeassignedthesamecolorIfanswerispositivewesaythatthegraphisk-colorableandkisthechromaticnumberx(G).
ItispossibletotransformGraphk-ColorabilityProblem(GCP)intoSatisfiabilityproblem(SAT);thatmeansthatforagivengraphG=(V,E)andanumberk,itispossibletoderiveaCNFformulaFsuchthatFissatisfiableonlyinthecasethatGisk-colorable.
TheformulationofGCPasSATismadeassigningXBooleanvariablesasfollow:1)TakeeverynodeandassignaBooleanvariableXijforeverynodeiandcolorj;thedisjunctionofallthesevariables.
Inthiswayeverynodewillhaveatleastonecolor.
Therefore,inthecaseoffigure1,wehavetheclauses:Node1:X11vX12vX13vX14Node2:X21vX22vX23vX24Node3:X31vX32vX33vX34Node4:X41vX42vX43vX442)Toavoidthefactthatanodehasmorethatonecolor,addtheformulaXij~Xik3)Inordertobesurethattwonodes(Vi,Vj)connectedwithanarchavedifferentcolors,addaclausesuchthatifVihascolork,Vjshouldnotbecolorwiththiscolor.
ThisclauseiswritingasXik~Xjk.
4)Inordertoknowwhichnodesareconnectedwithanedge,anadjacentmatrixAofthegraphisneeded;itselementsare:1ifiisconnectedwithjAij=0otherwiseFig.
1.
GraphcoloringexampleThereductionofagraphtotheConjunctiveNormalForm(CNF)generatessomanyclausesevenforsmallgraphs.
Forexample,forafullgraphwith7nodes(42edges),308clauseswith98literalscanbegenerated.
IfweuseDavis&Putnamalgorithmtocoloragraph,wecouldstartcoloringwithRcolors(thegraph'sdegreeorfromanumbergiven).
Ifitisnotpossibletocolorit,thenwecanincreaseRandtryagain.
Duetofindalargechromaticnumberx(G)isaveryhardtaskforacompletemethodasDavis&Putnam(itdemandsmanyresources),weneedanincompletemethodtohelpinthistask.
ForthisreasonwehavechosentheThresholdAcceptingmethod.
TAwillsearchthechromaticnumber,butasitisknownTAnotalwaysgettheoptimalsolution.
Bythisreason,thenumberfoundbyTAissendtoaDavis&Putnamprocedure,andthisonewillgettheoptimalsolution.
Thecompleteprocessisshowninthefigure2.
Fig.
2.
DescriptionofthecoloringprocessAnygraphcanbecoloredwithGmax+1colors,whereGmaxrepresentsthegraphdegree.
Forthisreason,TAwilltrycoloringwithGmaxcolors.
IfTAgetsasuccess,thenTAwilltrytocolorwithGmax-1,andsoon.
WhenTAfinishes,itsendstotheoutputtheminimumkofcolorsfounded.
Inothercase,whenTAcannotcolorwithGmaxcolors,thenitwillsendk=Gmax+1toDavis&Putnamprocedure.
Fig.
3.
BinarypartitionsDavis&Putnamwillattempttodecreasethevalueofkthroughbinarypartitions.
Thefirstattempt,Davis&Putnamwillchoosethenumberofcolorsgivenby(1+k)/2.
Ifthecoloringisright,itwillcolorwith(1+(1+k)/2)/2colors,i.
e.
,thelefthalf.
Otherwise,thealgorithmwillcolorwith((1+k)/2+k)/2colors,therighthalf.
ThisprocesscontinuesuntilDavis&Putnamcannotdecreasek.
So,thechromaticnumberwasfound.
Thissituationisshowninfigure2.
Thefigure3showsanexamplewhereTAfoundthenumbernineasitsbettersolutionanditissendtoDavis&Putnamprocedure.
WhenDavis&PutnamtakesthelastTAsolution,usingbinarypartitionsandotherrulestheoptimalsolutioniswaited.
Forexampleinthecaseofthefigure3,ifDavis&Putnamcannotcolorwithfivecolors,itmovestootheralternative,tryingwithsevencolors.
Finally,inthelastpartition,i.
e.
(7+9)/2,cannotcolorthegraphandsotheresultisachromaticnumberequaltonine.
5ConclusionInthispaperwepresentedanalgorithmbasedonThresholdAcceptingandDavis&Putnam,tosolvetheGraphk-ColorabilityProblem.
BecausethisproblemisanNP-hardproblemthereisnotaknowndeterministicefficient(polinomial)method.
Non-deterministicmethodsareingeneralmoreefficientbutanoptimalsolutionisnotguarantee.
Thismethodisanewalternativethatpromisestobemoreefficientthatthepreviousones.
Themaincontributionsofthispaperareenumeratedbelow.
1)Weproposedawaytotransformthegraphk-colorabilityproblemintoasatisfiabilityproblem.
2)InordertosolvetheformerproblemweproposedanewapproachwhichmakesuseofthethresholdacceptingandDavis&Putnamalgorithms.
3)Theresultingalgorithmiscompleteandusingitwecangetbetterresultsthatthewell-knownsimulatedannealingalgorithm.
References1.
Garey,M.
R.
andJohnson,D.
S.
,ComputersandInteractability:AGuidetotheTheoryofNP-Completeness,Freeman,SanFrancisco,1979.
2.
Stecke,K.
,DesignPlanning,SchedulingandControlProblemsofFlexibleManufacturing,AnnalsofOperationsResearch,Vol.
3,1985,pp.
3-12.
3.
Leighton,F.
T.
,AGraphColoringAlgorithmforLargeSchedulingProblems,J.
Res.
Nat.
Bur.
Standard,Vol.
84,No.
6,1979,pp.
489-506.
4.
Wood,D.
C.
,ATechniqueforColoringaGraphApplicabletoLargeScaleTimetableProblems,ComputerJournal,Vol.
12,1969,pp.
317-322.
5.
Brelez,D.
,NewMethodstoColorVerticesofaGraph,Comm.
ACM,Vol.
22,1979,pp.
251-256.
6.
Kirkpatrick,S,Gelatt,C.
D.
,Vecchi,M.
P.
,OptimizationbySimulatedAnnealing,Science,No.
220,1983,pp.
671-680.
7.
Chams,M.
,A.
HertzandD.
deWerra,SomeExperimentswithSimulatedAnnealingforColoringGraphs,EuropeanJournalofOperationalResearch,Vol.
32,1987,pp.
260-266.
8.
Johnson,D.
S.
,Aragon,C.
R.
,McGeoch,L.
A.
,Schevon,C.
,OptimizationbySimulatedAnnealing:AnExperimentalEvaluation;PartII:GraphColoringandNumberPartitioning,Oper.
Res.
,No.
39,1991,pp.
378-406.
9.
DueckGunter,ScheuerTobias,ThresholdAccepting:AGeneralPurposeOptimizationAlgorithmAppearingSuperiortoSimulatedAnnealing.
JournalofComputationalPhysics,No.
90,1990,pp.
161-175.
10.
M.
DavisandH.
Putnam,AComputingProcedureforQuantificationTheory.
JournaloftheAssociationforComputingMachinery,Vol.
7,No.
1,1960,pp.
201-215.
12.
ScienceandTechnologyCenterinDiscreteMathematicsandTheoreticalComputerScience,"SatisfiabilityProblem:TheoryandApplications",DimacsSeriesinDiscreteMathematicsandTheoreticalComputerScience,Editors:JunGu,PanosPardalos,Ding-Zhu.

ReliableSite怎么样,月付$95美国洛杉矶独立服务器

ReliableSite怎么样?ReliableSite好不好。ReliableSite是一家成立于2006年的老牌美国商家,主要经营美国独立服务器租赁,数据中心位于:洛杉矶、迈阿密、纽约,带宽1Gbps起步,花19美元/月即可升级到10Gbps带宽,月流量150T足够各种业务场景使用,且免费提供20Gbps DDoS防护。当前商家有几款大硬盘美国独服,地点位于美国洛杉矶或纽约机房,机器配置很具有...

ZJI:520元/月香港服务器-2*E5-2630L/32GB/480G SSD/30M带宽/2IP

ZJI发布了一款7月份特别促销独立服务器:香港邦联四型,提供65折优惠码,限量30台(每用户限购1台),优惠后每月520元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月启用新域名ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务。下面列出这款服务器的配置信息。香港邦联四型CPU:2*E5-2...

IMIDC日本多IP服务器$88/月起,E3-123x/16GB/512G SSD/30M带宽

IMIDC是一家香港本土运营商,商家名为彩虹数据(Rainbow Cloud),全线产品自营,自有IP网络资源等,提供的产品包括VPS主机、独立服务器、站群独立服务器等,数据中心区域包括香港、日本、台湾、美国和南非等地机房,CN2网络直连到中国大陆。目前主机商针对日本独立服务器做促销活动,而且提供/28 IPv4,国内直连带宽优惠后每月仅88美元起。JP Multiple IP Customize...

rewrite规则为你推荐
ip代理地址ip代理是什么?me域名me域名怎么样?台湾vps哪个地区的VPS从大陆访问快呢。php虚拟空间我已经有一套网站php代码和模板,并且有自己的虚拟空间和域名,怎么才能把我的代码加入到网站上.免备案虚拟主机请问哪里好一点的免备案的虚拟主机?重庆虚拟主机重庆市邮政速递物流公司渝北分公司双龙揽投部客服电话asp虚拟主机支持ASP MSSQL 的虚拟主机有哪些推荐m3型虚拟主机在万网上弄了域名和阿里云M3型虚拟主机,怎么部署jsp项目?网络域名ip 地址和域名的区别是什么免费域名注册哪里有免费域名申请
合租服务器 l5520 美国仿牌空间 php免费空间 免费个人空间 刀片服务器的优势 睿云 葫芦机 七十九刀 镇江高防服务器 第八届中美互联网论坛 phpwind论坛 windowsserverr2 alexa搜 域名商城 小米电视主机 六维空间登陆首页 魔兽世界网通服务器 qq空间申请关闭 hp存储服务器 更多