簡體   English   中英

證明決策概率在NP中

[英]Proving a decision prob is in NP

我正在閱讀CLRS,試圖獨自學習並很難找到本節。

我正在嘗試解決,但實際上沒有可參考的解決方案。

可以說輸入為x1, x2, x3, ..., xn m1, m1, m3, ... mn M1 and M2

然后,您必須輸出: A partition into two disjoint subsets S, T (so the intersection is an empty set) so that the sum of each mk (1<=k<=n) of all elements in S is <= M1 and the sum of each mk (1<=k<=n) of all elements in T is <= M2, so that the total value sum of all (xk's in S) + (xk's in T) is maximized. where (1<=k<=n) A partition into two disjoint subsets S, T (so the intersection is an empty set) so that the sum of each mk (1<=k<=n) of all elements in S is <= M1 and the sum of each mk (1<=k<=n) of all elements in T is <= M2, so that the total value sum of all (xk's in S) + (xk's in T) is maximized. where (1<=k<=n)

我試圖證明它在NP中。 當我進行動態編程時,我遇到了一個類似的問題,認為這是針對背包的。 但這似乎更加復雜。 我一直在廢紙上寫東西,但似乎一無所獲。 這是出於個人利益。

讓我們以此為決策版本:

是否有一個分區S,T,使得S和T不相交,S的總權重= M1,T的總權重= M2,S = T的總值≥Y?

(我將其改寫為“重量”和“值”,以使與背包的聯系更加明顯)

現在,這是NP嗎?

是。 有幾種顯示NP成員的方法,最簡單的方法可能是這種方法:有一個見證人可以讓我們(在多項式時間內)確認YES答案是正確的。 見證人只是S和T對。此​​處的驗證也不需要任何技巧,只需測試問題中提到的所有條件即可。

它也是NP-Complete的,因為它將解決背包問題。 這個問題就像有兩個背包,只是將其中一個背包的大小設為零,然后又回到了常規背包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM