您好,欢迎访问三七文档
Fall2006CostasBusch-RPI1NP-completeLanguagesFall2006CostasBusch-RPI2PolynomialTimeReductionsPolynomialComputablefunction:fsuchthatforanystringcomputesinpolynomialtime:)(wfwThereisadeterministicTuringmachine)|(|kwOMFall2006CostasBusch-RPI3)|(||)(|kwOwfsince,cannotusemorethantapespaceintimeM)|(|kwO)|(|kwOObservation:Fall2006CostasBusch-RPI4Languageispolynomialtimereducibletolanguageifthereisapolynomialcomputablefunctionsuchthat:fBwfAw)(ABDefinition:Fall2006CostasBusch-RPI5Supposethatispolynomialreducibleto.Ifthen.Theorem:PBABPAProof:Machinetodecideinpolynomialtime:AOninputstring:w1.Compute)(wfLetbethemachinethatdecidesBM2.Runoninput)(wfMinpolynomialtime3.IfaccceptBwf)(wMFall2006CostasBusch-RPI6Exampleofapolynomial-timereduction:Wewillreducethe3CNF-satisfiabilityproblemtotheCLIQUEproblemFall2006CostasBusch-RPI73CNFformula:)()()()(654463653321xxxxxxxxxxxxEachclausehasthreeliterals3CNF-SAT={:isasatisfiable3CNFformula}wwLanguage:literalclauseFall2006CostasBusch-RPI8A5-cliqueingraphCLIQUE={:graphcontainsa-clique}kG,GkGLanguage:Fall2006CostasBusch-RPI9Theorem:3CNF-SATispolynomialtimereducibletoCLIQUEProof:giveapolynomialtimereductionofoneproblemtotheotherTransformformulatographFall2006CostasBusch-RPI10)()()()(432321421421xxxxxxxxxxxxClause2Clause1Clause31x2x1x2x4x1x2x3x2x4x4x3xTransformformulatograph.Example:Clause4CreateNodes:Fall2006CostasBusch-RPI11)()()()(432321421421xxxxxxxxxxxx1x2x1x2x4x1x2x2x4x4x3x3xAddlinkfromaliteraltoaliteralineveryotherclause,exceptthecomplementFall2006CostasBusch-RPI12)()()()(432321421421xxxxxxxxxxxx1x2x1x2x4x1x2x3x2x4x4x3xResultingGraphFall2006CostasBusch-RPI1310014321xxxx1)()()()(432321421421xxxxxxxxxxxx1x2x1x2x4x1x2x3x2x4x4x3xTheformulaissatisfiedifandonlyiftheGraphhasa4-cliqueEndofProofFall2006CostasBusch-RPI14WedefinetheclassofNP-completelanguagesDecidableNP-completeNP-completeLanguagesNPFall2006CostasBusch-RPI15AlanguageisNP-completeif:•isinNP,and•EverylanguageinNPisreducedtoinpolynomialtimeLLLFall2006CostasBusch-RPI16Observation:IfaNP-completelanguageisproventobeinPthen:NPPFall2006CostasBusch-RPI17NP-completeNPP?DecidableFall2006CostasBusch-RPI18Cook-LevinTheorem:LanguageSAT(satisfiabilityproblem)isNP-completeProof:Part2:reduceallNPlanguagestotheSATprobleminpolynomialtimePart1:SATisinNP(wehaveproventhisinpreviousclass)AnNP-completeLanguageFall2006CostasBusch-RPI19ForanystringwewillconstructinpolynomialtimeaBooleanexpression),(wMesatisfiablis),(wMLwTakeanarbitrarylanguageNPLWewillgiveapolynomialreductionoftoSATLLetbetheNonDeterministicTuringMachinethatdecidesinpolyn.timeMLwsuchthat:Fall2006CostasBusch-RPI200qiqjq…………acceptacceptrejectrejectkn(deepestleaf)depthAllcomputationsofonstringwnw||MFall2006CostasBusch-RPI210qiqjq…………acceptacceptrejectrejectkn(deepestleaf)depthConsideranacceptingcomputationFall2006CostasBusch-RPI220qiq…acceptjqmqaqknlalninqqq1121210initialstateacceptstateComputationpathSequenceofConfigurationsnw21:xnk:1:2Fall2006CostasBusch-RPI23wnknknkn2MaximumworkingspaceareaontapeduringtimestepsknMachineTapeMFall2006CostasBusch-RPI24######0q1iq2n12n:1:2##:xaq:kn32knTableauofConfigurationsAcceptconfigurationindenticalrows123kn1l1231lknaqknkn……Fall2006CostasBusch-RPI25}q,,{q},,{}#{states}of{setalphabet}{tape}#{t1r1CTableauAlphabetFinitesize(constant)Fall2006CostasBusch-RPI26Foreverycellpositionji,andforeverysymbolintableaualphabetCsDefinevariablesjix,,SuchthatifcellcontainssymbolThenElseji,s1,,sjix0,,sjixFall2006CostasBusch-RPI27####0q1iq2n12n:1:2Examples:1#,1,1x3kn1,3,2ikqnx0,1,1x0#,3,2knxFall2006CostasBusch-RPI28moveacceptstartcell),(wM),(wMisbuiltfromvariablessjix,,Whentheformulaissatisfied,itdescribesanacceptingcomputationinthetableauofmachineoninputMwFall2006CostasBusch-RPI29cellmakessurethateverycellinthetableaucontainsexactlyonesymboltjisjitsCtssjiCsjixxx,,,,,,,,allcellEverycellcontainsatleastonesymbolEverycellcontainsatmostonesymbolFall2006CostasBusch-RPI30tjisjitsCtssjiCsjixxx,,,,,,,,allcellSizeof:cell||C2||C()2)32(kn)(2knOFall2006CostasBusch-RPI31startmakessurethatthetableaustartswiththeinitialconfiguration#,22,1,22,1,3,1,2,1,3,1,2,1,1,1,2,1#,1,1start10kkknkkkknnnnnnnqnnxxxxxxxxxDescribestheinitialconfigurationinrow1oftableauFall2006CostasBusch-RPI32Sizeof:start#,32,1,22,1,3,1,2,1,1,1,2,1#,1,1start10kkkkknnnqnnxxxxxxx)(32kknOnFall2006CostasBusch-RPI33acceptmakessurethatthecomputationleadstoacceptanceqjijix,,Fqall,allacceptAnacceptstateshouldappearsomewhereinthetableauAcceptingstatesFall2006CostasBusch-RPI34Sizeof:acceptqjijix,,Fqall,allaccept)()32(22kknOnFall2006CostasBusch-RPI35movemakessurethatthetableaugivesavalidsequenceofconfigurationsmoveisexpressedintermsoflegalwindowsFall2006CostasBusch-RPI36Tableaua1qb2qacWin
本文标题:NP完全问题讲解
链接地址:https://www.777doc.com/doc-2889863 .html