Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Circuit-SAT / 3-ColorabilitySlide 60Slide 61Slide 62Slide 63Slide 64COMPSCI 102Introduction to Discrete MathematicsComplexity Theory: Efficient Reductions Between Computational ProblemsLecture 26 (December 3, 2007)A Graph Named “Gadget”K-ColoringWe define a k-coloring of a graph:Each node gets colored with one colorAt most k different colors are usedIf two nodes have an edge between them they must have different colorsA graph is called k-colorable if and only if it has a k-coloringA 2-CRAYOLA Question!Is Gadget 2-colorable?No, it contains a triangleA 2-CRAYOLA Question!Given a graph G, how can we decide if it is 2-colorable?Answer: Enumerate all 2n possible colorings to look for a valid 2-colorHow can we efficiently decide if G is 2-colorable?Else, output an odd cycleAlternate coloring algorithm:To 2-color a connected graph G, pick an arbitrary node v, and color it whiteColor all v’s neighbors blackColor all their uncolored neighbors white, and so onIf the algorithm terminates without a color conflict, output the 2-coloringTheorem: G contains an odd cycle if and Theorem: G contains an odd cycle if and only if G is not 2-colorableonly if G is not 2-colorableA 2-CRAYOLA Question!Theorem: G contains an odd cycle if and Theorem: G contains an odd cycle if and only if G is not 2-colorableonly if G is not 2-colorableA 3-CRAYOLA Question!Is Gadget 3-colorable?Yes!A 3-CRAYOLA Question!3-Coloring Is Decidable by Brute ForceTry out all 3n colorings until you determine if G has a 3-coloring3-Colorability Oracle YES/NOYES/NOA 3-CRAYOLA Oracle3-Colorability Search Oracle NO, orYES here is how: gives 3-coloring of the nodesBetter 3-CRAYOLA Oracle3-Colorability Decision Oracle 3-Colorability Search OracleGIVEN: 3-Colorability Decision Oracle BUT I WANTED a SEARCH oracle for Christmas I am really bummed outChristmas PresentHow do I turn a How do I turn a mere decision mere decision oracle into a oracle into a search oracle?search oracle?GIVEN: 3-Colorability Decision Oracle Christmas PresentWhat if I gave the oracle partial colorings of G? For each partial coloring of G, I could pick an uncolored node and try different colors on it until the oracle says “YES”Beanie’s Flawed IdeaRats, the oracle Rats, the oracle does not take does not take partial partial colorings….colorings….Beanie’s FixGIVEN: 3-Colorability Decision OracleLet’s now look at two other problems:1. K-Clique2. K-Independent SetK-CliquesA 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 themthemThis graph contains a 4-cliqueA Graph Named “Gadget”Given: (G, k)Question: Does G contain a k-clique?BRUTE FORCE: Try out all n choose k BRUTE FORCE: Try out all n choose k possible locations for the k cliquepossible locations for the k cliqueThis graph contains an independent set of size 3Independent SetAn independent set is a set of nodes with An independent set is a set of nodes with no edges between themno edges between themA Graph Named “Gadget”Given: (G, k)Question: Does G contain an independent set of size k?BRUTE FORCE: Try out all n choose k possible locations for the k independent setClique / Independent SetTwo problems that are Two problems that are cosmetically different, but cosmetically different, but substantially the samesubstantially the sameComplement of GGiven a graph G, let G*, the complement of G, be the graph obtained by the rule that two nodes in G* are connected if and only if the corresponding nodes of G are not connectedGG*G has a k-cliqueG* has an independent set of size kLet G be an n-node graphGIVEN: Clique Oracle BUILD:Independent Set Oracle(G,k)(G*, k)Let G be an n-node graphGIVEN: Independent Set Oracle BUILD:Clique Oracle(G,k)(G*, k)Clique / Independent SetTwo problems that are Two problems that are cosmetically different, but cosmetically different, but substantially the samesubstantially the sameThus, we can quickly reduce a 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 otherLet’s now look at two other problems:1. Circuit Satisfiability2. Graph 3-ColorabilityCombinatorial CircuitsAND, OR, NOT, 0, 1 gates wired AND, OR, NOT, 0, 1 gates wired together with no feedback together with no feedback allowedallowedx3x2x1ANDANDORORORANDANDNOT0111Yes, this circuit is satisfiable: 110Circuit-SatisfiabilityGiven a circuit with n-inputs and one output, is there a way to assign 0-1 values to the input wires so that the output value is 1 (true)?BRUTE FORCE: Try out all 2n assignmentsCircuit-SatisfiabilityGiven: A circuit with n-inputs and one Given: A circuit with n-inputs and one output, is there a way to assign 0-1 values output, is there a way to assign 0-1 values to the input wires so that the output value to the input wires so that the output value is 1 (true)?is 1 (true)?3-ColorabilityCircuit SatisfiabilityANDANDNOTTFXYORTFXYTFXYTFXYTFXYX YF F FF T TT F TT T TORTFXNOT gate!ORORNOTx y zxyzORORNOTx y zxyzORORNOTx y zxyzORORNOTx y zxyzORORNOTx y zxyzHow do we force the graph to be 3 colorable exactly when the circuit is satifiable?Let C be an n-input circuitGIVEN: 3-colorOracle BUILD:SATOracleGraph composed of gadgets that mimic the gates in C CYou can quickly transform a method to decide 3-coloring into a method to decide circuit satifiability!Given an oracle for circuit SAT, how can you quickly solve 3-colorability?Can you make a circuit that takes a description of a graph and a node coloring, and checks if it is a valid 3-coloring?X (n choose 2 bits) Y (2n bits)Vn(X,Y)eijcicj……Vn(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 that Y is a valid 3 coloring of X. I.e., V3 coloring of X. I.e., Vnn(X,Y) = 1 iff Y is (X,Y) = 1 iff Y is a 3


View Full Document

Duke CPS 102 - Complexity Theory

Documents in this Course
Lecture

Lecture

34 pages

Lecture

Lecture

42 pages

Lecture

Lecture

46 pages

Lecture

Lecture

77 pages

Notes

Notes

17 pages

Notes

Notes

52 pages

Lecture 9

Lecture 9

72 pages

Lecture

Lecture

7 pages

Lecture

Lecture

11 pages

Lecture

Lecture

28 pages

Lecture

Lecture

25 pages

Forbes

Forbes

9 pages

Lecture

Lecture

53 pages

Lecture

Lecture

21 pages

Lecture 4

Lecture 4

54 pages

Lecture

Lecture

24 pages

Lecture

Lecture

46 pages

Lecture

Lecture

16 pages

Lecture

Lecture

7 pages

Lecture

Lecture

46 pages

Graphs II

Graphs II

34 pages

Lecture

Lecture

81 pages

Lecture

Lecture

46 pages

Load more
Download Complexity Theory
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Complexity Theory and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Complexity Theory 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?