CNPComplete.ppt

  1. 1、本文档共48页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CNPComplete.ppt

What makes a problem hard(2) 3-满足问题仍为NP-完全问题,但2-满足问题有多项式算法 集团问题,当顶点度=常数d时属于类P 平面图集团问题属于类P,因为平面图至多有4-集团 实际有意义的做法是提出合理的限制条件和求近似解, 研究启发式算法. 优化问题和判定问题 3种问题 判定问题 求优化值问题 求优化解问题 优化问题至少与判定问题一样“难” 优化值问题有多项式算法,则判定问题有多项式算法 多数情况下,如果能在多项式时间内求解决策问题,那么也能在多项式时间内获得最优值(图着色问题);有时则不能(TSP) 近似算法(1) 返回次优解的算法。这种算法经常可以通过启发式方法得到,例如:贪心法。 近似算法必须是多项式时间算法。 为量度近似解对优化解的近似程度定义以下术语 FS(I) 是输入I的可行解集。 Val(I,x):实例I的可行解x的目标函数值 opt(I):实例I的优化解的值 近似算法(2) 设A为一近似算法,令A(I)为输入I时该算法输出的可行解 极小化和极大化问题度量近似性能的指标rA(I) 续 式(13.5)定义的RA(m)为最坏情形rA(I)的值,是与输入I无关的指标: 在固定优化值m下求最坏情形的比值 式(13.6)定义的SA(n)也是一与输入独立的指标 Bin-Packing的近似算法 怎么装不同大小、不同形状的货物才能使占用的箱子数最少。该问题形式化如下: 装箱问题 设S = (s1, …, sn) 0 si = 1 , 1 = i = n 将 s1, …, sn 装入尽可能少的箱子里。假定每个箱子都有容量1。 装箱问题是NP-难度问题 搜索算法有指数的复杂度:须试所有可能的S的分划。 装箱问题:FFD算法(贪心法) 将物品按尺寸递减排序,箱子从左到右排列并尽可能放在前面的箱子里。 算法的时间复杂度t(n)=?(n2) 算法:装箱问题 输入: S=(s1,….,sn) ,0si≤1 ,1≤i≤n. S 代表货物1,...,n 的尺寸,每个箱子的容量都是1.0。 输出: bin[i]是放物品i的箱子号,1≤i≤n. 为了使算法简单,在装箱前,货物已经按尺寸从大到小排序。 * A Turing machine is a finite-state machine associated with an external storage or memory medium. (Minsky (1967) p. 117) A Turing machine is essentially a finite-state sequential machine that has the ability to communicate with an external store of information(Booth (1967), p. 354) In complexity theory, the NP-complete problems are the most difficult problems in NP (non-deterministic polynomial time) in the sense that they are the smallest subclass of NP that could conceivably remain outside of P, the class of deterministic polynomial-time problems. The reason is that a deterministic, polynomial-time solution to any NP-complete problem would also be a solution to every other problem in NP. The complexity class consisting of all NP-complete problems is sometimes referred to as NP-C. A more formal definition is given below. One example of an NP-complete problem is the subset sum problem which is: given a finite set of integers, determine whether any non-empty subset of them sums to zero. A supposed answer is very easy to verify for correctness, but no

文档评论(0)

000 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档