algorithm - np 完备性证明

标签 algorithm computer-science np np-complete

证明下列问题是NP完全的。

The tv problem is to select tv shows for a weekly tv night so that everyone in a group of people sees something that they like. You are given a list of people (P1, . . . , Pn) in the group and a list of possible shows (S1, . . . , Sk). For each show Si, there is a subset of the people who would like that show choice. You also get w, the number of weeks for which you can select shows. The question is whether there are these many movies so that every person likes at least one of them.

我想不通哪个np问题可以归结为这个以及如何建立证书。

最佳答案

您可以将其建模为 Set cover problem .您有元素 {P1, ..., Pn} 和这些元素的 k 个子集 T1, ..., Tk,定义为 Ti = {Pj : Pj 喜欢 Si}。然后你想找到最小的子集集合,使得他们的并集是整个人集。确定必要子集的数量是否小于或等于一个数字是 NP 完全的。寻找实际的最佳子集集合是 NP 难的。

关于algorithm - np 完备性证明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56273346/

相关文章:

computer-science - 为什么正则语言的补语仍然是正则语言?

algorithm - 是多项式时间算法吗

java - 需要帮助将这个等式移植到 java

algorithm - 整数序列的最佳压缩算法

algorithm - 大 O 符号查询

c++ - 这个问题有更好的数据结构和算法选择吗?

javascript - Math.min() 和 Math.max() 之间有什么区别?在 JavaScript 中

computer-science - 一个好的最终高中 AP 计算机科学编程项目?

np - SAT 是 NP 完全的,那么为什么我们不让 k-SAT 对于任意 k 值来说是 NP 完全的

java - 使用启发式实现回溯搜索?