Ps 7 Solution
Ps 7 Solution
is a monotone formula. A monotone formula is easy to satisfy, we can simply set all variables to be
true. In the Monotone SAT problem we are given a monotone formula and an integer k, and ask if
there is a way to satisfy formula Φ with setting at most k variables true (and the rest of the variables
false).
Show that the Monotone SAT problem is NP-complete.
Solution 1. Monotone SAT is clearly in NP: all we need to do is to show the k variables that
satisfy all the clauses, and check that those variables are satisfied. This certificate is O(k) and checking
the clauses is linear in the number of terms, and we will only output a “yes” answer for a correct
To prove that the problem is NP-complete, we show that Vertex-Cover ≤ Monotone SAT.
Vertex-Cover is given by an undirected graph G and integer k. To do so, we need to show how to solve
the vertex cover problem using a Monotone SAT subroutine. Consider an input to Vertex-Cover:
a graph G = (V, E) with n nodes and an integer k ≤ n. Assume G has ` isolated vertices, that is vertices
not adjacent to edges. Clearly the answer to Vertex-Cover is ”yes” if k ≥ n − ` as we can select all
vertices adjacent to edges. What remains to solve is the case when k ≤ n − `. We will transform such
a Vertex-Cover problem to an equivalent input to monotone SAT. To do this, we use a variable xv
for all nodes v, and add a clause xv ∨ xw for all edges (v, w), so let Φ = ∧(v,w)∈E xv ∨ xw .
• Given a set of k nodes S in V that form a vertex cover, setting the corresponding variables xv to
true makes the formula satisfiable.
• If the formula Φ is satisfiable by setting k variables true, then the nodes corresponding to these
true variables form a vertex cover.
Solution 2. An alternate way to prove that the problem is NP-complete, we show that SAT ≤
Monotone SAT. Consider a SAT formula Φ with n variables x1 , . . . , xn . This formula has negated
variables. Add n new variables y1 , . . . , yn , and replace all occurrences of x̄i in the formula with yi for
each i. This gives us a monotone formula Φ0 . Now set k = n.
If we can ensure that exactly one of xi or yi is selected for each i in this monotone formula, we will
have a solution to out SAT problem. To do this, add n new clause to Φ0 with (xi ∨ yi ) for all i. Let the
resulting formula Φ00 .
• Given a truth assignment for Φ, we can make Φ00 true by setting yi = x̄i .
• If the formula Φ00 is satisfiable by setting k = n variables true, then due to the n clauses of the
form (xi ∨ yi ) we must have exactly one of xi or yi to be true, that is, we must have that yi = x̄i .
And so x makes the formula Φ true.
(2) Weighted Multiple Interval Scheduling (10 points). Recall the weighted interval scheduling
problem, where we had n possible jobs, each job i had value vi and required a resource for a fixed
interval of time [si , fi ]. The problem was to find a set of jobs I that request disjoint intervals and have
P
maximum total value i∈I vi . A decision version of the problem would have an additional input value
v and ask if there is a set I requesting disjoint intervals with total value at least v, that is i∈I vi ≥ v.
P
In this problem, jobs may require a few disjoint intervals. For example, a single job i may require
the resource for [9am,9:10am] and then again [2pm, 2:22pm] and you can only accept the job i if it is
possible to assign the resource to job i for all the requested intervals of time.
The input to the problem consist of a target value v, and a set of n jobs, each with a value vi and
a set of intervals of time called Ri , where Ri is the set of times job i needs the resource (may consist of
multiple intervals).1 The problem is to decide if there is a subset of jobs I with i∈I vi ≥ v, such that
P
all requests of all the jobs included in I are disjoint, i.e. ∪i∈I Ri consists of disjoint intervals. We call
this the Weighted Multiple Interval Scheduling problem.
For example if the minimum total value is v = 2 and job 1 has R1 = {[1, 3], [4, 6]}, v1 = 1, job 2 has
R2 {[7, 8]}, v2 = 1, and job 3 has R3 = {[2, 4], [7, 8]}, v3 = 1, then choosing I = {1, 2} would satisfy the
requirements. However I = {1, 3} would not since [2, 4] overlaps with [1, 3].
Show that the Weighted Multiple Interval Scheduling problem is NP-complete.
Solution. The problem is clearly in NP: given a set of k requests, one can check that each pair are
indeed requesting disjoint intervals. This can be done in time at most quadratic in the input size (due
to checking all pairs).
To prove that its NP-complete, we reduce from Independent Set. We need to show that we can
solve an Independent Set using a subroutine to Weighted Multiple Interval Scheduling.
Input to the independent set problem is a graph G = (V, E) and an integer k. Have each edge
e ∈ E correspond to a disjoint interval of time (an hour). Nodes correspond to jobs, with node i ∈ V
requesting the intervals that correspond to the edges adjacent to node i, and each job has value 1 with
target value v = k.
• This construction is clearly done in polynomial time
• If G has an independent set I of size k, and the requests corresponding to the k nodes in I
form k requests with disjoint intervals. So the answer to the Weighted Multiple Interval
Scheduling we constructed is also ”yes”.
• if the constructed Weighted Multiple Interval Scheduling problem has k requests with
disjoint intervals, then the nodes corresponding to these requests must form an independent set.
1
You may assume that all numbers involved (values and beginning and end of intervals) are integers, but can be arbitrary
large numbers.