Chapter 8 NP-complete problems课后习题8.16
来源:互联网 发布:openresty nginx 编辑:程序博客网 时间:2024/05/20 03:44
题目
We are feeling experimental and want to create a new dish. There are various ingredients we can choose from and we’d like to use as many of them as possible, but some ingredients don’t go well with others. If there are n possible ingredients (numbered 1 to n), we write down an n x n matrix giving the discord between any pair of ingredients. This discord is a real number
between 0.0 and 1.0, where 0.0 means “they go together perfectly” and 1.0 means “they really don’t go together.” Here’s an example matrix when there are five possible ingredients.
In this case, ingredients 2 and 3 go together pretty well whereas 1 and 5 clash badly. Notice that this matrix is necessarily symmetric; and that the diagonal entries are always 0.0. Any set of ingredients incurs a penalty which is the sum of all discord values between pairs of ingredients. For instance, the set of ingredients {1; 3; 5} incurs a penalty of 0.2+1.0+0.5 = 1.7. We want this penalty to be small.
EXPERIMENTAL CUISINE
Input: n, the number of ingredients to choose from; D, the n x n “discord” matrix; some number p > 0
Output: The maximum number of ingredients we can choose with penalty p.
Show that if EXPERIMENTAL CUISINE is solvable in polynomial time, then so is 3SAT.
证明
3SAT
3SAT问题为输入是一个子句集,每个子句包含不超过3个文字。3SAT的一个实例形如
考虑把3SAT问题转换成EXPERIMENTAL CUISINE问题。
假设对于任何一个3SAT问题,它由n个子句组成,表示为ABC…
假设其中一个子句A=
对于不同子句的ingredients,将它们之间有冲突的ingredients的discord设为1,无冲突的为0。比如,设另一个子句C=
若p=0时,能选择到的ingredients总数等于子句总数n,则说明该3SAT能满足,有解。这样就把3SAT问题转换成EXPERIMENTAL CUISINE问题来求解了。
求解EXPERIMENTAL CUISINE问题时,对于一个ingredient,如果把它加入选择中,p的大小不超过设定值,则可以选择,否则不可以。每次判断都是多项式时间的,经过多项式次数的判断可以得到结果,那么整个过程是可以在多项式时间内完成的。
因此,若EXPERIMENTAL CUISINE在多项式的时间内可解,3SAT亦然。
- Chapter 8 NP-complete problems课后习题8.16
- [算法作业] Chapter 8 NP-complete problems 课后习题部分证明
- Chapter8 NP-complete problems 课后习题8.3
- NP-complete problems课后题
- NP-complete problems
- P/NP/NP-Complete/NP-Hard Problems
- six basic np-complete problems
- NP课后习题8.3
- several ways to solve np-complete problems
- 算法作业 NP-complete problems 8.22
- NP完全问题 课后习题
- 课后作业 课本NP-complete证明题
- 《Algorithms》NP-complete 部分证明习题解答
- 【NP-完全问题】课后习题8.3
- NP-complete
- P,NP,NP Complete
- 算法:一个NP问题的证明(课后习题)
- NP完全问题的证明-算法概论课后习题8.15
- Vue1.0学习总结(1)———指令、事件、绑定属性、模板、过滤器
- package control: install提示There Are No Packages Available For Installation
- https://stackoverflow.com/questions/37505484/cant-exit-git-commit-in-windows
- Mybatis Generator相关xml配置文件含义解析
- Ubuntu使用教程:E: 无法获得锁 /var/lib/apt/lists/lock
- Chapter 8 NP-complete problems课后习题8.16
- materialDesign过度动画
- Android Studio SDK 更新方法
- 初次使用PermissionsDispatcher碰到的问题
- 消除Qt运行边框
- eval和``及$()
- java-并发集合-阻塞队列 LinkedBlockingQueue 演示
- android 自定义属性
- Scala入门到精通——第七节:类和对象(二)