[英]Converting Not All Equal 2-Sat Pr0blem to an equivalent 2-SAT pr0blem
I'm looking over previous exam papers, and have come across this question which has confused me. 我正在查看以前的试卷,并且遇到了使我感到困惑的问题。
Question: 题:
Convert the Not-All-Equal 2-SAT problem given by the clauses
{x1, x2}, {x2, x3}, {x3, x4}, {x4, x5}, {x5, x1}
to an equivalent 2-SAT problem.将由子句
{x1, x2}, {x2, x3}, {x3, x4}, {x4, x5}, {x5, x1}
给出的非均等2-SAT问题转换为等效的2-SAT问题。 (Hint: the 2-SAT problem contains 10 clauses).(提示:2-SAT问题包含10个子句)。
From my understanding, is this simply finding the negation for each literal in every clause? 根据我的理解,这是否仅仅是在每个子句中找到每个文字的否定? So for example,
{x1, x2} = {-x1, -x2}
, and this is done for each clause? 因此,例如
{x1, x2} = {-x1, -x2}
,这是对每个子句完成的吗? Is this correct? 这个对吗?
That is correct. 那是对的。 Specifically, replace all clauses
(x ∨ y)
with (x ∨ y) ∧ (~x ∨ ~y)
. 具体来说,将所有子句
(x ∨ y)
替换为(x ∨ y) ∧ (~x ∨ ~y)
。 That literally says "x or y have to be true, and x or y have to be false", or equivalently "satisfy (x ∨ y)
while making sure that one of x
and y
is false". 字面意思是“ x或y必须为真,x或y必须为假”,或等效地“满足
(x ∨ y)
同时确保x
和y
为假”。
To prove the equivalence, let us first assume that the NAE 2-SAT problem is satisfiable. 为了证明等价性,让我们首先假设NAE 2-SAT问题是可以满足的。 Let A be a satisfying assignment and let
{x, y}
be one arbitrary clause. 令A为令人满意的赋值,令
{x, y}
为一个任意子句。 Since exactly one of x
and y
are true, this implies that (x ∨ y) ∧ (~x ∨ ~y)
is true. 由于恰好
x
和y
中的一个为真,因此这意味着(x ∨ y) ∧ (~x ∨ ~y)
为真。 Hence, the corresponding two clauses in the 2-SAT formula are satisfied. 因此,满足2-SAT公式中的相应两个子句。 Since
{x, y}
was chosen arbitrarily, we conclude that A satisfies all the clauses in the 2-SAT formula. 由于
{x, y}
是任意选择的,因此我们得出结论A满足2-SAT公式中的所有子句。
Conversely, let us assume that the NAE 2-SAT is not satisfiable. 相反,让我们假设NAE 2-SAT不能令人满意。 That is, for any assignment, there exists some clause
{x, y}
for which x
and y
are either both true or both false. 也就是说,对于任何赋值,都存在一些子句
{x, y}
,其中x
和y
均为真或均为假。 Let A be an arbitrarily chosen assignment and let {x, y}
be a clause that A does not satisfy (in the NAE 2-SAT). 设A为任意选择的赋值,设
{x, y}
为A不满足的子句(在NAE 2-SAT中)。 Since x = y
, this implies that (x ∨ y) ∧ (~x ∨ ~y)
is false (because one of the halves of the conjunction will be false). 由于
x = y
,这意味着(x ∨ y) ∧ (~x ∨ ~y)
为假(因为合取的两半之一为假)。 Hence, A does not satisfy the 2-SAT formula. 因此,A不满足2-SAT公式。 Since A was chosen arbitrarily, we conclude that no assignment satisfies the 2-SAT formula.
由于A是任意选择的,因此我们得出结论,没有赋值满足2-SAT公式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.