算法作业 NP-complete problems 8.22
来源:互联网 发布:mac os 10.12.5百度云 编辑:程序博客网 时间:2024/06/11 10:49
8.22
In task scheduling,it is common to use a graph representation with a node for each task and a directed edge from task i to task j if i is a precondition for j.This directed graph depicts the precedence constraints in the scheduling problem.Clearly,a schedule is possible if and only if the graph is acyclic;if it isn't,we'd like to identify the smallest number of constraints that must be dropped so as to make it acyclic.
Given a directed graph G=(V,E),a subset E'≤E is called a feedback arc set if the removal of edges E' renders G acyclic.
FEEDBACK ARC SET(FAS):Given a directed graph G=(V,E) and a budget b,find a feedback arc set of <=b edges,if one exists.
(a)Show that FAS is in NP
FAScan be shown to be NP-complete by a reduction from VERTEX COVER.Given an instance (G,b) of VERTEX COVER,where G is an undiected graph and we want a vertex cover of size <=b,we construct a instance (G',b) of FAS as follows.If G=(V,E) has n vertices v1,...,vn,then make G'=(V',E') a directed graph with 2n vertices w1,w1',...,wn.wn',and n+2|E|(directed) edges:
1.(wi,wi') for all i=1,2,...,n.
2.(wi',wj) and (wj',wi) for every (vi,vj)∈E.
(b)Show that if G containsa vertex cover of size b,then G' contains a feedback arc set of size b.
(c)Show that if G' contains a feedback arc set of size b,then G contains a vertex cover of size (at most) b.(Hint:Given a feedback arc set of size b in G',you may need to first modify it slightly to obtain another one which is of a more convenient form,but is of the same size or smaller.Then,argue that G must contain a vertex cover of the same size as the modified feedback arc set.)
(a) 显然FAS是可在多项式时间内验证的,因此属于NP。
(b) 设G的一个大小为b的顶点覆盖为C,对于任意顶点vi∈C ,设其在 ' G中相对应的顶点为wi和wi ',则将边(wi,wi'),添加到 E'。对C中的每个顶点都这样处
理后,所得到的边集E'即是G'的一个大小为b的feedback arc set。因为对于顶点wi和wi',当去掉边(wi,wi')后,所有与wi相连的边都不可能位于任何一个
环中,因为wi不存在出边,同样,所有与wi'相连的边也不可能位于任何一个环中,因为wi'不存在入边。
(c) 对于G中的任意一条边(vi,vj),设其在G'中相对应的顶点为wi,wi',wj,wj',相对应的边为(wi,wi'),(wj,wj'),(wi',wj),(wj',wi). 若E'是G'的一个大小为b的feedback arc set,显然,在这四条边中至少有一条边e属于E',否则就会形成环,而边e必然有个端点属于{wi,wj}.若wi是e的端点,则将vi加入到C,否则将vj加入到C。容易看出,在经过上述处理后,C即是G的一个大小不超过b的顶点覆盖。
- 算法作业 NP-complete problems 8.22
- [算法作业] Chapter 8 NP-complete problems 课后习题部分证明
- NP-complete problems
- P/NP/NP-Complete/NP-Hard Problems
- six basic np-complete problems
- NP-complete problems课后题
- several ways to solve np-complete problems
- Chapter8 NP-complete problems 课后习题8.3
- 课后作业 课本NP-complete证明题
- Chapter 8 NP-complete problems课后习题8.16
- NP-complete
- P,NP,NP Complete
- NP-Hard 和 NP-Complete
- 算法期末作业 NP问题证明
- P,NP,NP-complete,NP-hard
- P/NP/NP-Complete/NP-Hard
- P/NP/NP-Complete/NP-Hard
- P,NP,NP-complete,NP-hard
- 欢迎使用CSDN-markdown编辑器
- 51Nod-最大字段和(动态规划)
- 静态链接库和动态链接库
- 机房效果图制作|简易制作教程赘述
- Spark性能优化——数据倾斜
- 算法作业 NP-complete problems 8.22
- [js] ES6 函数
- jQuery绑定键盘事件
- git 删除远程分支 创建远程分支 (干货)
- 随笔分类
- mysql中engine=innodb和engine=myisam区别
- 原生js和jquery框架下绑定事件的方法
- 287. Find the Duplicate Number找环的起点
- 如何下载Youtobe视频和字幕(可下载自动翻译的中文字幕)