inspiration versus perspiration: the p = ? np question

Post on 19-Jan-2016

222 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Inspiration Versus Perspiration:The P =? NP Question

Inspiration Versus Perspiration:The P =? NP Question

Computational Complexity Computational Complexity TheoryTheory

Computational Complexity Theory Computational Complexity Theory is is the study of how much of a given the study of how much of a given resource (such as time, space, resource (such as time, space, parallelism, randomness, algebraic parallelism, randomness, algebraic operations, communication, or quantum operations, communication, or quantum steps) is required to perform the steps) is required to perform the computations that interest us the most.computations that interest us the most.

WORST-CASE TIMEWORST-CASE TIME

We say that a program takes We say that a program takes worst-case time T(n), if some worst-case time T(n), if some input of size n takes T(n) steps, input of size n takes T(n) steps, and no input of size n takes and no input of size n takes longer.longer.

The input size is measured in The input size is measured in bits, unless stated otherwise. bits, unless stated otherwise.

A Graph Named “Gadget”A Graph Named “Gadget”

K-COLORINGK-COLORING

A k-coloring of a graph is an A k-coloring of a graph is an assignment of one color to each vertex assignment of one color to each vertex such that:such that:•No more than k colors are usedNo more than k colors are used•No two adjacent vertices receive the No two adjacent vertices receive the same colorsame color

A graph is called A graph is called k-colorablek-colorable iff it has a iff it has a k-coloringk-coloring

A A CCRRAAYYOOLLAA Question! Question!

Is Gadget 2-colorable?Is Gadget 2-colorable?

No, it contains a triangle.

Is Gadget 3-colorable?Is Gadget 3-colorable?

A A CCRRAAYYOOLLAA Question! Question!

Yes.

Given a graph G, what is Given a graph G, what is a fast algorithm to decide a fast algorithm to decide

if it can be 2-colored?if it can be 2-colored?

2 2 CCRRAAYYOOLLAASS

PERSPIRATION; BRUTE FORCE: Try out all 2n ways of 2 coloring G.

Given a graph G, what is Given a graph G, what is a fast algorithm to decide a fast algorithm to decide

if it can be 3-colored?if it can be 3-colored?

3 3 CCRRAAYYOOLLAASS

K-CLIQUESK-CLIQUES

A K-clique is a set of K nodes with all A K-clique is a set of K nodes with all k(K-1)/2 possible edges between k(K-1)/2 possible edges between them.them.

This graph contains a 4-This graph contains a 4-cliqueclique

Given an n-node graph G Given an n-node graph G and a number k, how can and a number k, how can

you decide if G contains a k-you decide if G contains a k-clique? clique?

PERSPIRATION: Try out all n choose PERSPIRATION: Try out all n choose k possible locations for the k cliquek possible locations for the k clique

INSPIRATION: ?INSPIRATION: ?

INDEPENDENT SETINDEPENDENT SET

An An independent setindependent set is a set of is a set of node with no edges between them.node with no edges between them.

This graph contains an independent set of size

3.

Given an n-node graph G Given an n-node graph G and a number k, how can and a number k, how can

you decide if G contains an you decide if G contains an independent set of size k?independent set of size k?

PERSPIRATION: Try out all n choose PERSPIRATION: Try out all n choose k possible locations for independent k possible locations for independent setset

INSPIRATION: ?INSPIRATION: ?

Combinational CircuitsCombinational Circuits

AND, OR, NOT, 0, 1 gates wired AND, OR, NOT, 0, 1 gates wired together with no feedback allowed. together with no feedback allowed.

x3x2x1

OR

AND

AND

AND

OR

OR

OR

CIRCUIT-SATISFIABILITYCIRCUIT-SATISFIABILITY(decision version)(decision version)

Given a circuit with n-inputs Given a circuit with n-inputs and one output, is there a and one output, is there a way to assign 0-1 values to way to assign 0-1 values to the input wires so that the the input wires so that the output value is 1 (true)?output value is 1 (true)?

CIRCUIT-SATISFIABILITYCIRCUIT-SATISFIABILITY(search version)(search version)

Given a circuit with n-inputs Given a circuit with n-inputs and one output, find an and one output, find an assignment of 0-1 values to assignment of 0-1 values to the input wires so that the the input wires so that the output value is 1 (true), or output value is 1 (true), or determine that no such determine that no such assignment exists?assignment exists?

Given a circuit, is it Given a circuit, is it satisfiable?satisfiable?

PERSPIRATION: Try out all 2PERSPIRATION: Try out all 2nn assignmentsassignments

INSPIRATION: ?INSPIRATION: ?

We have seen 4 problems: coloring, clique,

independent set, and circuit SAT.

They all have a common story: A large space of possibilities only a tiny fraction of which satisfy the constraints. Brute

force takes too long, and no feasible algorithm is

known.

CLIQUE / INDEPENDENT SETCLIQUE / INDEPENDENT SET

Two problems that Two problems that are cosmetically are cosmetically different, but different, but substantially the substantially the samesame

Complement Of GComplement Of G

Given a graph G, let GGiven a graph G, let G**, the , the complement of G, be the complement of G, be the graph obtained by the rule graph obtained by the rule that two nodes in Gthat two nodes in G** are are connected if and only if the connected if and only if the corresponding nodes of G are corresponding nodes of G are not connected not connected

Let G be an n-node graph.

GIVEN:Clique Oracle

<G,k>

BUILD:Indep.

SetOracle

<G*, k>

Let G be an n-node graph.

GIVEN: Indep.

Set Oracle

<G,k>

BUILD: Clique

Oracle

<G*, k>

Thus, we can quickly reduce clique problem to an independent set

problem and vice versa.

There is a fast method for one if and only if

there is a fast method for the other.

Given an oracle for circuit SAT, how can you quickly

solve 3-colorability?

VVnn(X,Y)(X,Y)

Let VLet Vn n be a circuit that takes an n-node be a circuit that takes an n-node graph X and an assignment of colors to graph X and an assignment of colors to nodes Y, and nodes Y, and verifiesverifies that Y is a valid 3 that Y is a valid 3 coloring of X. I.e., Vcoloring of X. I.e., Vnn(X,Y)=1 iff Y is a 3 (X,Y)=1 iff Y is a 3 coloring of X.coloring of X.

X is expressed as an n choose 2 bit X is expressed as an n choose 2 bit sequence. Y is expressed as a 2n bit sequence. Y is expressed as a 2n bit sequence. sequence.

Given n, we can construct VGiven n, we can construct Vn n in time O(nin time O(n22).).

Let G be an n-node graph.

GIVEN:SAT

Oracle

G

BUILD:3-

colorOracle

Vn(G,Y)

Given an oracle for circuit SAT, how can you quickly

solve k-clique?

VVn,kn,k(X,Y)(X,Y)

Let VLet Vn n be a circuit that takes an n-node be a circuit that takes an n-node graph X and a subset of nodes Y, and graph X and a subset of nodes Y, and verifiesverifies that Y is a k-clique X. I.e., that Y is a k-clique X. I.e., VVnn(X,Y)=1 iff Y is a k-clique of X.(X,Y)=1 iff Y is a k-clique of X.

X is expressed as an n choose 2 bit X is expressed as an n choose 2 bit sequence. Y is expressed as an n bit sequence. Y is expressed as an n bit sequence. sequence.

Given n, we can construct VGiven n, we can construct Vn,k n,k in time O(nin time O(n22).).

Let G be an n-node graph.

GIVEN:SAT

Oracle

<G,k>

BUILD:CliqueOracle

Vn,k(G,Y)

Given an oracle for 3-colorability, how

can you quickly solve

circuit SAT?

T F

XY

Output

T FX Y

Output

XX YY

FF FF FF

FF TT TT

TT FF TT

TT TT TT

T FX Y

Output

XX YY OROR

FF FF FF

FF TT TT

TT FF TT

TT TT TT

T F

X NOT gate

OR

OR

NOT

x y z

xy

z

OR

OR

NOT

x y z

xy

z

Satisfiabilty of this circuit = 3-colorability of this graph

Let C be an n-input circuit.

GIVEN:3-colorOracle

C

BUILD:SAT

Oracle

Graph composed of gadgets that mimic

the gates in C

Formal StatementFormal Statement

There is a polynomial-time function f There is a polynomial-time function f such that:such that:

C is satisfiable <-> f(C) is 3 C is satisfiable <-> f(C) is 3 colorablecolorable

4 4 Problems All EquivalentProblems All Equivalent

If you can solve one quickly then you If you can solve one quickly then you can solve them all quickly:can solve them all quickly:

Circuit-SATCircuit-SAT

CliqueClique

Independent SetIndependent Set

3 Colorability3 Colorability

top related