[Note: this webpage last modified Friday, 04-Feb-2011 19:44:51 EST]
Something cool about theory of computing, something you can do with it...
Or, is there a problem in the book you'd like to talk about?
Today's attendance.
Administrative...
Homework 2 "notes/pointers" on the Assignments page.
Discussion about gradess.
Any questions about homework 3.
Last two times, described two NP-complete problems: the "encoding of TM's" problem, and circuit-satisfiability. The first just says you can encode questions about the behavior of TM's into an NP problem (not surprising).
For enlightenment (maybe), notice that you could do the same for P to get a P-complete language.
That circuit-SAT problem is NP-complete essentially means that TM's can be simulated by circuits, also probably not surprising if you really understand it. The way we did this is to look at the "computation tableau" that completely describes the execution of a TM - how the "configuration" of the TM evolves over time. We constructed a circuit that takes as input claimed correct values for the entire computation tableau, and we claimed that we could construct a circuit that checks whether each bit in the tableau follows correctly from the (constant number) of bits it depends on in the previous time step.
Note: if you were going to make a similar argument using Java or Python, etc. programming instead of TM's then what would the configuration of the machine be? Program counter (what line of code is next to execute), contents of memory (variables).
This time: a few more "natural" NP-complete problems.
SAT is NP-compelete. Reduction from circuit-SAT - convert questions about circuit-SAT into questions about SAT. The difference is that SAT is formulas whereas circuit-SAT is "circuits".
Given circuit D, want to know if there is an assignment to the input bits cause it to output 1.
We will construct a SAT formula that has variables for every wire in the circuit - that includes the inputs to the circuit, and all inputs and outputs of every gate in the circuit. Then we can construct formulas for each gate to verify that the claimed inputs to that gate actually result in the claimed output. Do an example with OR gate. If the claim is that (x1 or x2) = x3, then this is true if and only if (x1 OR x2 -> x3) AND (x3 -> x1 OR x2). This can be simplified/reduced to a 3CNF formula. Likewise for AND, NOT. We can do this for every gate, and AND together all of those formulas. If the whole thing is true, then all of the claimed values for values of inputs and gates is true, and the circuit evaluates to true iff the output of the entire circuit is 1.
Note: if the formula can be satisfied, then that gives an input to the circuit on which it outputs 1. And if there is an input for the circuit that causes it to output 1, then this gives an assignment that satisfies the formula.
And verify that this transformation can be done in polynomial time.
Do a simple example circuit transformation.
Since we know circuit-SAT is NP-complete and can efficiently translate circuit-SAT question into SAT question, SAT is NP-complete too (see Proposition 2.20 in the text).
Note that the formula we created was actually a 3CNF formula, so 3SAT is NP-complete.
Show that 3-coloring is NP-complete (proposition 2.27).
Like many NP-completeness proofs, it ends up being some constructions of "gadgets" in the graph to enforce conditions in a formula assuming the graph has a 3-coloring.
The construction is described in the book, and that's how we describe it in class too.
Next time: talk about problems that we know for certain are hard. Sometime after that we will come back and look at some NP-complete problems again, possibly instead of looking at "log space". But we'll take a break from NP-complete problems for next time.