Tag Archives: Difficulty 4

Monotone 3-Satisfiability

I told Daniel when he gave me his Monotone Satisfiability reduction that the actual problem mentioned in G&J was Monotone 3-Satisfiability.  So he went off and did that reduction too.
The Problem:
Monotone 3 SAT. This is a more restrictive case of Monotone SAT

The Description:
Given an formula of clauses F' = \wedge_{i=1}^{n} C'_{i} where each clause in F' contains all negated or non-negated variables, and each clause C_{i} contains at most 3 variables. Does there exist an assignment of the variables so that F' is satisfied?


\\ F_{1} = (x_{1} \vee x_{3}) \wedge \\ (\neg x_{2} \vee \neg x_{3} \vee \neg x_{4}) \wedge  \\ (x_{3} \vee x_{2} \vee x_{4}) \wedge \\ ( \neg x_{3} \vee \neg x_{5} \vee \neg x_{1})
the following assignment satisfies F'_{1}:
\\  x_{1} \mapsto True\\ x_{2} \mapsto False\\ x_{3} \mapsto True\\ x_{4} \mapsto True\\ x_{5} \mapsto False
\\ F_{2} = (\neg x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge \\ (x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge\\ (\neg x_{1} \vee x_{2} \vee \neg x_{3})\wedge \\ (\neg x_{1} \vee \neg x_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee \neg x_{3})\wedge\\ (\neg x_{1} \vee x_{2} \vee x_{3})\wedge\\ (x_{1} \vee \neg x_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee x_{3})
And the following is F_{2}' in Monotone  3SAT form:
\\ F_{2}' = (\neg x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge \\ (\neg y_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge\\ (\neg x_{1} \vee \neg y_{2} \vee \neg x_{3})\wedge \\ (\neg x_{1} \vee \neg x_{2} \vee \neg y_{3})\wedge \\ (x_{1} \vee x_{2} \vee y_{3})\wedge\\ (y_{1} \vee x_{2} \vee x_{3})\wedge\\ (x_{1} \vee y_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee x_{3}) \wedge \\ (y_{1} \vee x_{1}) \wedge (\neg y_{1} \vee \neg x_{1}) \wedge \\ (y_{1} \vee x_{2}) \wedge (\neg y_{2} \vee \neg x_{2})\wedge \\ (y_{1} \vee x_{3}) \wedge (\neg y_{3} \vee \neg x_{3})
are both unsatisfiable.

The reduction:
In the following reduction we are given an instance of 3SAT,
F = \wedge_{i=1}^{n} C_{i}. Here each clause is of the form:
C_{i} = x_{i1} \vee ... \vee x_{ik_i} where
k_{i} < 4
and each x_{ik_i} is a literal of the form \neg z_{l} \ or \ z_{l} .
We use the following construction to build an instance of Monotone  3 SAT out of the above instance of 3SAT :
In each clause C_{i} we have at most one literal, z_{l} \ or \ \neg z_{l} that is not of the same parity as the rest of the literals in the clause. For every such literal, we may preform the following substitution:
z_{l} \rightarrow \neg y_{l} \ or \ \neg z_{l} \rightarrow y_{l} this yields a modified clause C'_{i}.
Now we must be able to guarantee that z_{l} and y_{l} are mapped to opposite truth values, so we introduce the new clause:
C''_{i} \ = \ ( z_{l} \vee y_{l}) \wedge ( \neg z_{l} \vee \neg y_{l}) and conjunct it onto our old formula F producing a new formula F'.

For example:
C_{i} \ = \ (z_{l_1} \vee z_{l_2} \vee \neg z_{l_3}) so we preform the substitution
\neg z_{l_3} \rightarrow y_{l_3}
so C'_{i} \ = \ (z_{l_1} \vee z_{l_2} \vee y_{l_3}) and C''_{i} \ = \ (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3})

Now repeating this procedure will result in a new formula: F' = (\wedge_{i=1}^{n} C'_{i}) \wedge (\wedge_{k=1}^{m} C''_{k}).
We claim logical equivalence between the C_{i} \wedge C''_{i} and C'_{i} \wedge C''_{i} This is semantically intuitive as the C''_{i} clause requires all substituted literal y_{l} in C'_{i} to take the value opposite of z_{l} this was the stipulation for the substitution initially. It is also verifiable by truth table construction for:
\\ (z_{l_1} \vee z_{l_2} \vee \neg z_{l_3}) \wedge (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3}) \Leftrightarrow \\  (z_{l_1} \vee z_{l_2} \vee y_{l_3}) \wedge (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3})

True_{3SAT} \Rightarrow True_{Monotone \ 3 \ SAT}:
If there exists a truth assignment \phi_{F} that satisfies F, then we may extent this truth assignment to produce \phi_{G} which will satisfy
G = F \wedge (\wedge_{k=1}^{m} C''_{k}) by letting \phi_{G} (z_{l}) = \phi_{F} (x_{l}) for all l and letting \phi_{G}(y_{l}) = \neg \phi_{F}(z_{l}) for all l.
Obviously if F is satisfiable G must be by the above construction of \phi_{G}. So by the above claim we have that \phi_{G} will satisfy F'.
True_{Monotone \ 3 \ SAT} \Rightarrow True_{3SAT}:
Continuing from the above, if we have a truth assignment \phi_{F'} that satisfies F', then by the claim above it also must satisfy G. And F is a sub-formula of G so any truth assignment that satisfies G must also satisfy F.

(Back to me)

Difficulty: 4, since it’s a little harder than the regular Monotone Sat one.

Weighted Diameter

It took over a year (the first problem strictly from the Appendix was Domatic Number, last August), but we’re finally at the end of the Graph Theory section!  And the last problem is one that’s actually good for students to solve.

The problem: Weighted Diameter.  This is problem GT65 in the appendix

The description: Given a graph G=(V,E) a collection C of  |E| not necessarily distinct, non-negative integers, and a positive integer K.  Can we find a one-to-one function f  mapping each edge in E to an element of C such that if f(e) is the length of edge e, then G has a diameter of K or less.

In other words, given a set of edge weights C, can we give each edge in E a (distinct) weight from C such that the resulting weighted graph has a path between any two vertices of length ≤ K?

Example: Suppose I have a graph:

weighted dimater3

And C= {1,2,2,2,3,5}.  I think the best was you can label this is:

weighted dimater2

The Diameter here is 7 (The length of the path from A-D).

The reduction: G&J say to use 3-Partition, so we’ll go with that.  We’re given a set A, with 3m elements, a bound B, and want to split the elements of B into sets of size 3 so that each set adds up to m.  We know several things about A, but the important thing for our purposes is that all of the elements in A add up to m*B.

We’ll also assume that |A| is at least 9.  If it’s smaller than that, we can just brute-force the answer.

What we’re going to do is build a graph that is a tree with 3m+1 vertices.  We have a root, and the root has m chains of length 3 extending from it. This gives us exactly 3*m edges.

We set K = 2*B, and set C = A

If there exists a 3-partition of A, then each of the sets of 3 elements can map onto a different chain in the graph.  This makes the longest path in the graph be between any 2 leaves.  Since the length from a leaf to a root is exactly B, the diameter of the graph is 2B.

If there exists a weighted diameter of the graph of cost 2*B, then we need to show that the cost of each chain is exactly B.  Suppose it wasn’t, and the cost from the root to some leaf v is > B, let’s say B+x.  Then, since there are at least 3 chains (since |A| >= 9) and since the sum of all of the weights is m*B exactly), there must exist some leaf w, with the cost of the chain from the root to w > B-x.  The cost of the path from v to w is now > 2B, a contradiction.

If the cost from the root to some leaf is < B, then there must be some other leaf u with the cost from the root to u > B (since the costs of all of the edges add up to m*B), and we can do the above on u.

Since each chain costs exactly B, we can use the edge weights of each chain as the sets of 3 elements that make our 3-Partition.

Difficulty: 4. G&J does say in the comments that this problem is NP-Complete even for trees, so that may have been a hint.  The proof is a little tricky (getting from “diameter ≤ K” to “set adding up to exactly K” requires some work, and there may be a more elegant way than what I did).  But I think this would make a good homework problem.