Diketahui bahwa setiap masalah optimasi / pencarian memiliki masalah keputusan yang setara. Misalnya masalah jalur terpendek
- versi optimisasi / pencarian: Diberikan grafik tidak tertimbang yang tidak diarahkan G = ( V , E )
G=(V,E) dan dua simpul v , u ∈ Vv,u∈V , temukan jalur terpendek antara vv dan uu .- versi keputusan: Diberikan grafik tak tertimbang tidak berarah G = ( V , E )
G=(V,E) , dua simpul v , u ∈ Vv,u∈V , dan bilangan bulat non-negatif kk , adakah jalur di GG antara uu dan vv yang panjangnya paling banyak kk ?
Secara umum, "Temukan x ∗ ∈ X
Tetapi apakah kebalikannya juga benar, yaitu apakah ada masalah optimasi yang setara untuk setiap masalah keputusan? Jika tidak, apa contoh masalah keputusan yang tidak memiliki masalah optimasi yang setara?
Jawaban:
Seperti yang sudah dinyatakan dalam komentar, itu tergantung pada definisi, seperti biasa. Upaya saya untuk menjawab ini membutuhkan beberapa definisi, jadi ini akan menjadi contoh lain dari ketidakmampuan saya untuk memberikan jawaban yang ringkas.
Definisi: Sebuah masalah optimasi adalah tuple ( X , F , Z , ⊙ ) dengan(X,F,Z,⊙)
Definisi: Sebuah solusi yang optimal dari sebuah contoh x ∈ X dari masalah optimasi P O adalah solusi yang layak y ∈ F ( x ) yang Z ( x , y ) = ⊙ { Z ( x , y ' ) | y ' ∈ F ( x ) } . Nilai solusi optimal dilambangkan dengan O p t ( x )x∈X PO y∈F(x) Z(x,y)=⊙{Z(x,y′)∣y′∈F(x)} Opt(x) dan disebut optimal .
Definisi: The masalah evaluasi , dilambangkan P E , sesuai dengan masalah optimasi P O adalah sebagai berikut: Mengingat contoh x ∈ X , menghitung O p t ( x ) jika x memiliki solusi yang optimal dan output “tidak ada solusi optimal” sebaliknya.PE PO x∈X Opt(x) x
Perhatikan bahwa ini hanya meminta nilai solusi optimal bukan seluruh solusi itu sendiri dengan semua perinciannya.
Definisi: Masalah keputusan , dilambangkan P D terkait dengan masalah optimisasi P O adalah sebagai berikut: Diberikan pasangan ( x , k ) , di mana x ∈ X dan k ∈ Q , putuskan apakah x memiliki solusi yang layak y sedemikian rupa sehingga Z ( x , y ) ≤ k jika ⊙ = min dan sedemikian rupa sehingga Z ( x , y )PD PO (x,k) x∈X k∈Q x y Z(x,y)≤k ⊙=min ≥kZ(x,y)≥k if ⊙=max⊙=max .
A first observation is now that PO∈NPO⇒PD∈NPPO∈NPO⇒PD∈NP . The proof is not difficult and omitted here.
Now intuitively PEPE and PDPD corresponding to POPO are not more difficult than POPO itself. To express this feeling formally (thereby defining what equivalent is supposed to mean) we will use reductions.
Recall that a language L1L1 is polynomial-time reducible to another language L2L2 if there is a function ff , computable in polynomial time, such that for all words xx , x∈L1⇔f(x)∈L2x∈L1⇔f(x)∈L2 . This kind of reducibility is known as Karp or many-to-one reducibility, and if L1L1 is reducible to L2L2 in this manner, we express this by writing L1≤mL2L1≤mL2 . This is a central concept in the definition of NP-completness.
Unfortunately, many-to-one reductions go between languages and it is not clear how to employ them in the context of optimization problems. Therefore we need to consider a different kind of reducibility, Turing reducibility. First we need this:
Definition: An oracle for a problem PP is a (hypothetical) subroutine that can solve instances of PP in constant time.
Definition: A problem P1P1 is polynomial-time Turing-reducible to a problem P2P2 , written P1≤TP2P1≤TP2 , if instances of P1P1 can be solved in polynomial time by an algorithm with access to an oracle for P2P2 .
Informally, just as with ≤m≤m , the relation P1≤TP2P1≤TP2 expresses, that P1P1 is no more difficult than P2P2 . It is also easy to see that if P2P2 can be solved in polynomial time, so can P1P1 . Again ≤T≤T is a transitive relation. The following fact is obvious:
Let PO∈NPOPO∈NPO , then PD≤TPE≤TPOPD≤TPE≤TPO .
Because given the full solution, computing its value and deciding whether it meets the bound kk is simple.
Definition: If for two problems P1P1 and P2P2 both relations P1≤TP2P1≤TP2 , P2≤P1P2≤P1 hold, we write P1≡TP2P1≡TP2 ; our notion of equivalence.
We are now ready to proof that PD≡TPEPD≡TPE given the corresponding optimization problem is PO∈NPOPO∈NPO and ZZ is integer valued. We have to show that PE≤TPDPE≤TPD holds. We can determine ⊙{Z(x,y)∣y∈F(x)}⊙{Z(x,y)∣y∈F(x)} with a binary search usign the orcale for PDPD . The definition of NPONPO ensures that |Z(x,y)|≤2q(|x|)|Z(x,y)|≤2q(|x|) for some polynomial qq , so the number of steps in the binary search is polynomial in |x||x| . ◻□
For an optimization problem POPO the relation to PEPE is less clear. In many concrete cases, one can show directly that PD≡TPE≡TPOPD≡TPE≡TPO . To prove that this holds generally within the framework given here we need an additional assumption.
First we need to extend ≤m≤m from pairs of languages to pairs of the corresponding decision problems. Then it is easy to see that ≤T≤T is more general than ≤m≤m .
Let PP and P′P′ be decision problems; then P≤mP′⇒P≤TP′P≤mP′⇒P≤TP′ . This holds because a many-to-one reduction can be interpreted as making use of an oracle in a very restricted way: The oracle is called once, at the very end, and its result is also returned as the overall result. ◻□
Now we are ready for the finale:
Let PO∈NPOPO∈NPO and suppose ZZ is integer-valued and that PDPD is NP-complete, then PD≡TPE≡TPO.
Now the details: Assume that the feasible solutions of POPO are encoded using an alphabet ΣΣ equipped with a total order. Let w0,w1,…w0,w1,… be the words from Σ∗Σ∗ listed in order of nondecreasing length and lexicographic order within the blocks of words with common length. (Thus w0w0 is the empty word.) For all y∈Σ∗y∈Σ∗ let σ(y)σ(y) denote the unique integer ii such that y=wiy=wi . Both σσ and σ−1σ−1 can be computed in polynomial time. Let q be a polynomial such that for all x∈X and all y∈F(x) we have σ(y)<2q(|x|).
Now the problem P′O is identical to PO except for a modified objective function Z′. For x∈X and y∈F(x) we take Z′(x,y)=2q(|x|)⋅Z(x,y)+σ(y). Z′ is computable in polynomial time thus P′O∈NPO.
To show that PO≤TP′E we observe that x is feasible for PO if and only if it is feasible for P′E. We can assume that this is the case, since the opposite case is trivial to handle.
The substituion of Z′ for Z is monotonic in the sense that for all y1,y2∈F(x), if Z(x,y1)<Z(x,y2) then Z′(x,y1)<Z′(x,y2). This implies that every optimal solution for x in P′O is an optimal solution of x in PO. Thus our task reduces to the computation of an optimal solution y of x in P′O.
Querying the oracle for P′E we can get the value of Z′(x,y)=2q(|x|)⋅Z(x,y)+σ(y). Forming the remainder of this number modulo 2q(|x|) yields σ(y) from which y can be computed in polynomial time.
sumber
As the comments say, the answer depends on the exact definitions. Let me interpret the question in a very basic (even naïve) way.
Let S be some relation, that is S⊆{(a,b)∣a,b∈Σ∗}.
Now we define a search problem for S:
and a decision problem for S:
(for instance, in the example given in the question, S will hold all the pairs (u,v,k) such that there exists a path between u and v which is shorter than k.)
Note that these two problems are well defined. For this definition, we can ask whether the two problems are "equivalent" for any S. In "equivalent" I mean that if one of them is computable (i.e., there exists an algorithm that solves it) than the other one is computable as well. In general, they are not.
Claim 1: Decision implies Search.
Proof: Let DS be the algorithm that solves the decision problem of S. Given an input a, We can run DS(a,x) for any x∈Σ∗, one after the other, or in parallel. If there exists b such that (a,b)∈S, we will eventually find it. If not, the algorithm might not stop†.
Claim 2: Search does not imply Decision.
The reason is that the search algorithm might return a different b than the one we need. That is, for every a there is some b that is very easy to find, but other b′ that is not. For instance, let L be some undecidable language, then define S={(x,0)∣x∈Σ∗}∪{(x,1)∣x∈L}.
† This depends on S. If, for instance, S is bounded, there might exists an algorithm that does stop.
sumber