Proof:
Clearly, 3-CNF-SAT is in NP; we just use a satisfying assignment as
the linear-time verifiable certificate. So we just need to show
CIRCUIT-SAT <p 3-CNF-SAT.
From a circuit C made up of gates AND, OR, and NOT, and input variables in a set { 1 .. n}, we will construct a 3-CNF formula F that is satisfiable if and only if F is satisfiable. The construction goes as follows:
c d (d OR c) (NOT d OR NOT c) ((d OR c) AND (d OR NOT c)) d == NOT c - - -------- ---------------- --------------------------- ---------- F F F T F F F T T T T T T F T T T T T T T F F F
NOT c OR d
NOT c OR e
c OR NOT d OR NOT e
c OR NOT d
c OR NOT e
NOT c OR d OR e
We now have a formula F that defines the operation of
the circuit, describing from the variables through the gates to the
output the precise value on the output of each gate. The formula
can only evaluate to True (i.e. be satisfied) if there is some
assignment to the inputs of the circuit that make the output True.
This transformation is carried out in linear time and space: only
up to three clauses are needed for each gate, so for a gate with
n gates, the resulting formula has
(n) clauses. Thus, 3-CNF-SAT is
NP-hard and, being in NP, is NP-complete. []
We don't seem to have accomplished much with this proof; we've replaced one kind of pointy-headed Boolean logic problem with another. However, note that 3-CNF-SAT is a much restricted version of CIRCUIT-SAT. We can use 3-CNF-SAT to prove other problems are NP-complete in instances when tackling all of CIRCUIT-SAT is infeasible or impossible. That is, 3-CNF-SAT is easier to work with when proving things NP-complete.
(Note: It turns out k-CNF-SAT, where clauses have at most k literals, is NP-complete for k > 2. For k = 2, (i.e. 2-CNF-SAT), there is a polynomial time algorithm: a clause (a OR b) is the same as (NOT a IMPLIES b); make a directed graph with vertices the literals and edges the implications derived from the clauses; if any strongly connected component (computable in linear time, similar to the connected components in undirected graphs we saw with Union/Find) of the graph contains a literal and its complement, that is a contradiction, so the formula is not satisfiable. Otherwise, it is. Unfortunately, this algorithm doesn't extend to k-CNF-SAT for k > 2, so we don't get to prove P=NP this way.)
Now let's look at a problem we saw last time:
NP-Completeness Prove that the cnfsat <p neqcnf. This is a reduction by restriction.
4. a) Define the concept of NP-completeness b) If A is NP-complete, and A has a polynomial time algorithm, then a polynomial time algorithm to find a longest path in a directed graph.
4. a) Define the concept of NP-completeness b) If A is NP-complete, and A has a polynomial time algorithm, then a polynomial time algorithm to find a longest path in a directed graph. Answer:
4. a) Define the concept of NP-completeness b) If A is NP-complete, and A has a polynomial time algorithm, then show that there is a polynomial time algorithm to find a longest path in a directed graph.
NP-completeness. We are given an undirected graph where each edge has a positive weight. Given (k, alpha), the problem asks whether there is a subgraph with k nodes such that the total weight of the edges in the subgraph is at least alpha. Prove this problem is NP-Complete.
4. a) Define the concept of NP-Completeness B) Show that there is a polynomial time algorithm that finds a longest path in a directed graph, under the condition that A is NP-complete and A has a polynomial time algorithm.
Prove the following closure properties for the class NP. (a) Prove that the class NP is closed under union. (b) Prove that the class NP is closed under concatenation.
please answer and I will rate!
4. a) Define the concept of NP-completeness b) If A is NP-complete, and A has a polynomial time algorithm, then a polynomial time algorithm to find a longest path in a directed graph. Answer:
Prove this is NP Complete, or it is in P.
This problem is a variant of UNDIRECTED HAMILTON PATH in bounded-degree graphs. The language in question is the set of all triples (G, s, t) for which G is an undirected graph with maximum degree at most 2 containing a Hamilton path from node s to node t.
Show that if G is a group of order np where p is prime and 1 <n<p, then G is not simple.
please solve and I will rate!
4. a) Define the concept of NP-Completeness B) Show that there is a polynomial time algorithm that finds a longest path in a directed graph, under the condition that A is NP-complete and A has a polynomial time algorithm.