Docsity

Advanced Computational Complexity-Lecture 12 Slides-Computer Science, Slides of Advanced Computational Complexity

Partial preview of the text

Download Advanced Computational Complexity-Lecture 12 Slides-Computer Science and more Slides Advanced Computational Complexity in PDF only on Docsity!

Lecture 1: Completeness in L , NL , and P

Matthew Johnson

[email protected]

Composing log-space reductions

We know that polynomial-time reductions compose, that is, if L 1 ≤ L 2 ≤ L 3 then L 1 ≤ L 3. This fact is helpful when proving completeness in NP : we only need to reduce a known NP -complete problem to the problem under consideration. A similar result would be useful for proving NL -completeness of problems. Lemma Log-space reductions compose: that is, if L 1 ≤L L 2 ≤L L 3 then L 1 ≤L L 3.

Proof idea: Let T 1 and T 2 be log-space transducers that compute L 2 from L 1 and L 3 from L 2 , respectively. Since the output of T 1 can be much longer than O(log n), we cannot simply cascade the transducers. So, every time we need a symbol from the output of T 1 , we compute it again, without actually writing the output of T 1.

Another NL -complete problem

We already know that 2-SAT is in P. In fact, we have

Theorem 2-SAT is NL -complete.

To prove this, we first prove that 2-SAT is in NL.

It is an exercise in the assignment to construct a log-space reduction from UNREACHABILITY to 2-SAT to prove completeness.

Proof idea

Encode a 2-CNF formula φ as a graph G(φ) as follows: the vertices of G(φ) are the variables of φ and their negations; there is an edge (α, β) iff the clause (¬α ∨ β) (or (β ∨ ¬α)) is v in φ. Intuitively, the edges capture the logical implication (⇒) because

(α ⇒ β) ≡ (¬β ⇒ ¬α) ≡ (¬α ∨ β) ≡ (β ∨ ¬α).

G(φ) has a symmetry: (α, β) is an edge iff (¬β, ¬α) is an edge. Note also that paths in G(φ) correspond to valid implications (by transitivity of ⇒).

Useful lemma

Lemma φ is unsatisfiable if and only if there is a variable x such that there are paths from x to ¬x and from ¬x to x in G(φ).

Proof. (‘if’-part) Suppose such paths exist and still φ can be satisfied by an assignment T.

Suppose that T (x) = TRUE. Then T (¬x) = FALSE. Since there is a path from x to ¬x, there is an edge (α, β) on this path such that T (α) = TRUE and T (β) = FALSE. But (α, β) corresponds to the clause (¬α ∨ β) is φ. Hence, φ is not satisfied by T , a contradiction. If T (x) = FALSE then the argument is similar.

Proof continued

(‘only if’-part) Suppose that there is no variable with such paths in G(φ). We show that then φ is satisfiable.

Repeat the following procedure until each node has a truth value:

  1. Pick any unassigned node α with no path from α to ¬α.
  2. Assign TRUE to all nodes reachable from α, and
  3. Assign FALSE to all nodes from which ¬α is reachable.

Strong-Connectivity

STRONG-CONNECTIVITY

Instance : A directed graph G. Question : Is G strongly connected (that is, are there directed paths in both directions between each pair of vertices in G)?

Theorem STRONG-CONNECTIVITY is NL -complete.

We will see the “completeness” part of the proof; a reduction from REACHABILITY.

Example Construction

s t

Given an instance G, s, t of REACHABILITY...

Reduction

The construction can be done in log-space (just need a counter to remember which vertices have been processed). Claim: t is reachable from s in G, if and only if G′^ is strongly-connected. (⇒): if there is a directed path p from s to t, then between any pair of vertices u and v in G′^ there is a directed path consisting of us · · · p · · · tv. (⇐): if G′^ is strongly-connected then there is a path from s to t. This path contains only edges in G else it visits s or t more than once. Thus there is also a path from s to t in G.

Log-space reductions and L

It is obvious that any problem which is polynomial-time reducible to a problem in P is also in P. Again, it is much less straightforward that any problem which is log-space reducible to a problem in L is also in L. However, one can slightly modify the proof of Lemma 1 to show that this is true. Theorem If L 1 ≤L L 2 and L 2 is in L then L 1 is in L.

Corollary If any NL -complete problem is in L then L = NL.

Interestingly, REACHABILITY for undirected graphs is in L. This is a very recent (and very non-trivial) result by O. Reingold, see http://eccc.uni-trier.de/eccc-reports/2004/TR04-094/

P -completeness

Our main examples of problems in P , REACHABILITY and 2-SAT, appear to be in NL. Are there problems which are in P , but not (known to be) in NL? In the usual way, we can define P -complete problems (w.r.t. log-space reductions).

Theorem If any P -complete problem is in NL then NL = P.

Hence, P -complete problems are least likely to be in NL.

HORN-SAT

A clause is said to be Horn if it has at most one unnegated variable. For example, (x), (¬x), (¬x ∨ ¬y ∨ z) or (¬x ∨ ¬y). Note that ¬x ∨ ¬y ∨ z ≡ (x ∧ y) ⇒ z ¬x ∨ ¬y ≡ (x ∧ y) ⇒ FALSE

A CNF formula is Horn if every clause in it is Horn.

HORN-SAT Instance : A Horn CNF φ. Question : Is φ satisfiable?

Theorem HORN-SAT is P -complete.