Date: 10/05/98
Note taker: Yuehua Cao
Class notes for COMP 7713
Lecture: #9
I. Concepts review:  

II. New for today:

        (Intuitively the reduction should be fast, otherwise useless) Formally we say that a language L1 is polynomial-time reducible to a language L2, written L1 £ p L2, if there exists a polynomial-time computable function

f : {0, 1}* ® {0, 1}* such that for all x Î {0, 1}*, x Î L1 if and only if f(x) Î L2. We call the function f the reduction function, and a polynomial-time algorithm F that computes f as the reduction algorithm.

If p 1® p 2, then T(p 1) £ T(p 2) + TR where T(p ) is the time complexity of p ; TR is
the time complexity of reduction. Using polynomial reduction time
p 2 provides a low-bound of the complexity of p 1.
R: i1 ® i2
T1(|i1|) £ TR(|i1|) + T2(|i2|)
If the reduction is polynomial time, then p 2 is at least as hard as p 1.
How to prove a problem is
        -NP-hard
        -NP-complete
    Cook’s Theorem:
Every problem in NP can be reduced in polynomial-time to the CIRCUIT-satisfiability problem.
Conclusion: CIRCUIT-satisfiability is the "hardest" problem in NP.
CIRCUIT-satisfiability:
  • Given a boolean combinational circuit (using AND, OR, NOT gates), is it satisfiable?
  • Satisfiability: Is there an assignment of values to input variables that makes the output 1.
  • Figure 1. An instance of boolean combinational circuit with four inputs (X1, X2, X3, X4). To allow an output to be 1, a       satisfying assignment can be (0, 1, 0, 0). Given a problem p , how to prove the problem is NP-Complete?
            (1)   Start with a NP-Complete problem (p N)
            (2)   Find a polynomial-time reduction from p N ® p
            (3)   Prove p is in NP

    Examples:

    SAT (SATisfiability) problem:

    Given a boolean expression involving variables & their complements & operator Ù , Ú , is it satisfiable?
    (X1Ú Ø X2) Ù (X3Ú Ø X4Ú X2)Ú (X1Ú X2Ú Ø X3)
    Is there a way to assign values to the formula, so that the result comes to be true?
    Therefore, to be satisfiable, each clause must have at least one literal which is true, subject to the overall constraints from other clauses.
        3SAT:
                        Given a boolean expression involving boolean variables (& their complements and operators Ú , Ù ) in CNF
                        (Conjunctive Normal Form) with at most 3 literals per disjunct.
        Example:
        CNF: (X1Ú X2Ú ØX4Ú X6) Ù (X3Ú ØX2Ú X4Ú X5) Ù (X1Ú ØX2) Ù (X4Ú X5)
        3CNF: (X1Ú X2) Ù (X3Ú ØX2) Ù (X1Ú ØX3) Ù (ØX1Ú ØX4) Ù (X3Ú X4) Ù (X2Ú ØX4)

        The first expression is not in 3CNF, because both the first and the second clauses contain more than 3 literals (4 literals
        in this example), but it can be logically converted to 3CNF as follows:

        (X1Ú X2Ú Ø Y1) Ù (Y1Ú Ø X4Ú X6) Ù (X3Ú Ø X2Ú Ø Y2) Ù (Y2Ú X4Ú X5) Ù (X1Ú Ø X2) Ù (X4Ú X5)

        The logical equivalence between this expression and the original one can be proved using a truth table to see whether both
        expressions return the same value.

        In general, if a boolean expression has one or more term(s) with more than 3 literals, the expression is not in 3CNF.
        However, this expression can be logically converted into one in 3CNF by the addition of new vaiables (such as y1, y2, in
        the example above).

    Clique Problem:

        Instance of the problem: an undirected graph G, and an integer K.

        Question: Does the graph have a "clique" of size at least K?

        A clique in an undirected graph G = (V, E) is a subset V’ Í V of vertices, each pair of which is connected by an edge in E.
        In other words, a clique is a complete subgraph of G. The size of the clique is the number of vertices it contains.

        To prove that CLIQUE is NP-complete, we need show:

        1. It’s easy to show that CLIQUE Î NP, for a given graph G = (V,E), we use the set V’Í V of vertices in the clique as a
        certificate for G. Checking whether V’ is a clique can be accomplished in polynomial time (O(|v’|2) = O(n2))by checking
        whether, for every pair u, vÎ V’, the edge belongs to E.

        2. We next show that the clique problem is NP-hard by proving that 3-SAT £ p CLIQUE. The reduction algorithm begins
        with an instance of 3-SAT. Let F=C1Ù C2Ù × × × Ù Cm be a boolean formula in 3-CNF with m clauses and n variables. For
        r = 1, 2, …, m, each clause Cr has exactly three distinct literals l1r, l2r, and l3r. We shall construct a graph G such that F is
       satisfiable if and only if G has a clique of size m.  The graph G= (V, E) is constructed as follows. For each clause
        Cr = (l1rÚ l2rÚ l3r) in F, we place a triple of vertices v1r, v2r, and v3r in V. We put an edge between two vertices vir and vjs
        if both of the following hold:

        This graph can be easily computed from F in polynomial time. As an example of this construction, if we have

        F = (X1Ú X2Ú ØX7) Ù (X7Ú ØX4Ú X6) Ù (X3Ú ØX2Ú ØX8) Ù (X8Ú X4Ú X5) Ù (X1Ú ØX2) Ù (X4Ú X5),

        Then the graph in Figure 2. shows all the edges in the G incident on one of the vertices corresponding to the first literal
        in the first clause.
     

     

     

        Figure 2 The graph derived from the 3-CNF formula F = C1Ù C2Ù C3Ù C4Ù C5Ù C6, where C1= (X1Ú X2Ú ØX7),
        C2=   (X7Ú ØX4Ú X6), C3= (X3Ú ØX2Ú ØX8), C4= (X8Ú X4Ú X5), C5= (X1Ú ØX2), and C6= (X4Ú X5), in reducing
        3-CNF-SAT to CLIQUE. A satisfying assignment of the formula is (X1 = 1, X2 = 0, X3 = 0, X4 = 0, X5 = 0, X6 = 1,
        X7 = 1, X8 = 1), corresponding to the clique with green shaded vertices. In this example, X1 is connected to every vertex
        except ØX1.

        Now we have shown how to construct an instance of a clique.

        Claim: F is satisfiable if and only if G has a clique of at least size k.

        Proof (in both ways)

        (Þ ) First, suppose that F has a satisfying assignment. Then, each clause Cr contains at least one literal lir that is assigned 1,
        and each such literal corresponds to a vertex vir. Picking one such "true" literal from each clause yields a set of V’ of k
        vertices. We claim that V’ is a clique. For any two vertices vir, vjr Î V’, where r ¹ s, both corresponding literals lir and ljs
          are mapped to 1 by the given satisfying assignment, and thus the literals cannot be complements. Thus, by the construction
        of G, the edge (vir, vjs) belongs to E.

        (Ü ) Conversely, suppose that G has a clique V’ of size k. No edges in G connect vertices in the same triple, and so V’
        contains exactly one vertex per triple. We can assign 1 to each literal lir such that vir Î V’ without fear of assigning 1 to both
        a literal and its complement, since G contains no edges between inconsistent literals. Each clause is satisfied, and so F is
        satisfied. (Any variables that correspond to no vertex in the clique may be set arbitrarily.)