a19-NP-Complete 算法导论 教学课件.pptVIP

  • 5
  • 0
  • 约1.56万字
  • 约 40页
  • 2018-01-25 发布于浙江
  • 举报
a19-NP-Complete 算法导论 教学课件

* Cook证明了SAT(Boolean Satisfiability Problem)问题是一个NP完全性问题。 * * * * * * * * * * * * * * * * * Cook 于1971找到一个NPC,现在发现的NPC已经超过3000个 * Search Method 3: Local Search (局部搜索) Example: Determine if the following formula is satisfiable. ? =(u1?u2)?(u1??u2)?(u1?u3)?(u2?u3)?(u1??u3 )?(u2??u3) u1 u2 u3 begin: S= 0 0 0 unsatisfied clauses=3 flip u1: 1 0 0 unsatisfied clauses=1 flip u2: 0 1 0 unsatisfied clauses=2 flip u3: 0 0 1 unsatisfied clauses=3 S= 1 0 0 flip u1: 0 0 0 unsatisfied clauses=3 flip u2: 1 1 0 unsatisfied clauses=0 So ? is satisfiable. S=( 0 0 0 ) :3 ( 0 0 1 ) :3 ( 0 1 0 ) :2 ( 1 0 0 ) :1 S=( 1 0 0 ) :1 ( 1 1 0 ) :0 ( 0 0 0 ) :3 * Search Method 3: Local Search (局部搜索) S=( 0 0 0 ) :3 ( 0 0 1 ) :3 ( 0 1 0 ) :2 ( 1 0 0 ) :1 S=( 1 0 0 ) :1 ( 1 1 0 ) :0 ( 0 0 0 ) :3 GSAT(??CNF) // Las Vegas algorithm begin 1 for i=1 to Max-tries 2 S=random(?); // random assignment 3 for j=1 to Max-moves 4 if S satisfies ? then return(Yes); 5 else S=S with some variable flipped to minimize the number of unsatisfied clauses; 6 end 7 end 8 return(No satisfying truth assignment found); end Example: ? =(u1?u2)?(u1??u2)?(u1?u3) ?(u2?u3)?(u1??u3 )?(u2??u3) * No polynomial-time algorithm has been found for any NP-Complete problem.(对任何NPC,尚没有找到多项式算法) 特殊情况 概率分析 近似算法 启发式算法 34.8 How to solute NP-Complete Class P NP NP-Complete * Exercises Implement GSAT on computers. * Some Stories John Louis von Neumann Born 28 December 1903, Budapest, Hungary; Died 8 February 1957, Washington DC; Brilliant mathematician, synthesizer, and promoter of the stored program concept, whose logical design of the IAS became the prototype of most of its successors - the von Neumann Architecture. * Some Stories John Louis von Neumann von Neumann model * Some Stories von Neumann model 四个主要部分 Memory Arithmetic Logic Unit (ALU, 运

文档评论(0)

1亿VIP精品文档

相关文档