15-251 Great Theoretical Ideas in Computer Science.

Slides:



Advertisements
Similar presentations
Reducibility and NP-Completeness COSC 3101B, PROF. J. ELDER 2 Computational Complexity Theory Computational Complexity Theory is the study of how much.
Advertisements

NP-Hard Nattee Niparnan.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
CS Department Fireside Chat All are welcome! Wed Nov 18, 5-6pm, Ols 228e/236d Kim Hazelwood and Wes Weimer Meet and ask them questions in a non-academic.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Lecture 21 NP-complete problems
Complexity class NP Is the class of languages that can be verified by a polynomial-time algorithm. L = { x in {0,1}* | there exists a certificate y with.
Great Theoretical Ideas in Computer Science for Some.
CSE373: Data Structures & Algorithms Lecture 24: The P vs. NP question, NP-Completeness Nicki Dell Spring 2014 CSE 373 Algorithms and Data Structures 1.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CS Department Fireside Chat All are welcome! Wed Nov 18, 5-6pm, Ols 228e/236d Kim Hazelwood and Wes Weimer Meet and ask them questions in a non-academic.
Discrete Structures & Algorithms The P vs. NP Question EECE 320.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Graphs 4/16/2017 8:41 PM NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
NP-Complete Problems Problems in Computer Science are classified into
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.
Complexity Theory: The P vs NP question Lecture 28 (Dec 4, 2007)
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Computational Complexity Classify problems according to the amount of computational resources used by the best algorithms that solve them Recall: worst-case.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
P vs NP: what is efficient computation? Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 29Dec 8, 2005Carnegie Mellon.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
COMPSCI 102 Introduction to Discrete Mathematics.
Announcements Assignment 4: Due Monday, April 5 at Midnight (due to university regulations). Submit solutions to any 2 of the 4 problems. Responsible.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
COMPSCI 102 Introduction to Discrete Mathematics.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 28Dec 5th, 2006Carnegie Mellon University Complexity Theory: A graph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
Inspiration Versus Perspiration: The P = ? NP Question.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
The NP class. NP-completeness
Chapter 10 NP-Complete Problems.
Richard Anderson Lectures NP-Completeness
NP-Complete עוד בעיות NP-שלמות.
Richard Anderson Lecture 26 NP-Completeness
UNIT III DYNAMIC PROGRAMMING ALGORITHMS
Great Theoretical Ideas in Computer Science
Introduction to Discrete Mathematics
Some Great Theoretical Ideas in Computer Science for.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Intro to Theory of Computation
Richard Anderson Lecture 25 NP-Completeness
Great Theoretical Ideas in Computer Science
Richard Anderson Lecture 28 NP-Completeness
NP-Completeness Yin Tat Lee
Instructor: Aaron Roth
Instructor: Aaron Roth
Lecture 23 NP-Hard Problems
Presentation transcript:

Great Theoretical Ideas in Computer Science

Complexity Theory: Efficient Reductions Between Computational Problems Lecture 26 (Nov 18, 2010)

A Graph Named “Gadget”

K-Coloring We define a k-coloring of a graph: Each node gets colored with one color At most k different colors are used If two nodes have an edge between them they must have different colors A graph is called k-colorable if and only if it has a k-coloring

A 2-CRAYOLA Question! Is Gadget 2-colorable? No, it contains a triangle

A 2-CRAYOLA Question! Given a graph G, how can we decide if it is 2-colorable? Answer: Enumerate all 2 n possible colorings to look for a valid 2-color

Else, output an odd cycle Alternate coloring algorithm: To 2-color a connected graph G, pick an arbitrary node v, and color it white Color all v’s neighbors black Color all their uncolored neighbors white, and so on If the algorithm terminates without a color conflict, output the 2-coloring Theorem: G contains an odd cycle if and only if G is not 2-colorable

A 2-CRAYOLA Question! Theorem: G contains an odd cycle if and only if G is not 2-colorable

A 3-CRAYOLA Question! Is Gadget 3-colorable? Yes!

A 3-CRAYOLA Question!

3-Coloring Is Decidable by Brute Force Try out all 3 n colorings until you determine if G has a 3-coloring

3-Colorability Oracle YES/NO A 3-CRAYOLA Oracle

3-Colorability Search Oracle NO, or YES here is how: gives 3-coloring of the nodes Better 3-CRAYOLA Oracle

3-Colorability Decision Oracle 3-Colorability Search Oracle

GIVEN: 3-Colorability Decision Oracle BUT I WANTED a SEARCH oracle for Christmas I am really bummed out Christmas Present

How do I turn a mere decision oracle into a search oracle? GIVEN: 3-Colorability Decision Oracle Christmas Present

What 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 Idea Rats, the oracle does not take partial colorings….

Beanie’s Fix GIVEN: 3-Colorability Decision Oracle

Let’s now look at two other problems: 1. K-Clique 2. K-Independent Set

K-Cliques A K-clique is a set of K nodes with all K(K-1)/2 possible edges between them This graph contains a 4-clique

A Graph Named “Gadget”

Given: (G, k) Question: Does G contain a k-clique? BRUTE FORCE: Try out all n choose k possible locations for the k clique

This graph contains an independent set of size 3 Independent Set An independent set is a set of nodes with no edges between them

A 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 set

Clique / Independent Set Two problems that are cosmetically different, but substantially the same

Complement of G Given 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 connected G G*

G has a k-clique G* has an independent set of size k 

Let G be an n-node graph GIVEN: Clique Oracle BUILD: Independent Set Oracle (G,k) (G*, k)

Let G be an n-node graph GIVEN: Independent Set Oracle BUILD: Clique Oracle (G,k) (G*, k)

Clique / Independent Set Two problems that are cosmetically different, but substantially the same

Thus, 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 other

Let’s now look at two other problems: 1. Circuit Satisfiability 2. Graph 3-Colorability

Combinatorial Circuits AND, OR, NOT, 0, 1 gates wired together with no feedback allowed x3x3 x2x2 x1x1 AND OR

AND NOT Yes, this circuit is satisfiable: 110 Circuit-Satisfiability Given 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 2 n assignments Circuit-Satisfiability Given: 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)?

3-Colorability Circuit Satisfiability AND NOT

F T X Y XY FFF FTT TFT TTT OR F

T F X NOT gate!

OR NOT xyz x y z

OR NOT xyz x y z

OR NOT xyz x y z

OR NOT xyz x y z

OR NOT xyz x y z How do we force the graph to be 3 colorable exactly when the circuit is satifiable?

Let C be an n-input circuit GIVEN: 3-color Oracle BUILD: SAT Oracle Graph composed of gadgets that mimic the gates in C C

You 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 (based on a graph) that takes as input a node coloring, and checks if it is a valid 3-coloring?

Building Blocks XOR OR AND

Building Blocks ≠ XOR OR

V G (Y) Let V G (Y)be a circuit constructed for a graph G, that takes as input an assignment of colors to nodes Y, and verifies that Y is a valid 3 coloring of G. I.e., V G (Y)= 1 iff Y is a 3 coloring of G Let V G (Y) be a circuit constructed for a graph G, that takes as input an assignment of colors to nodes Y, and verifies that Y is a valid 3 coloring of G. I.e., V G (Y) = 1 iff Y is a 3 coloring of G Y is expressed as a 2n bit sequence Given G, we can construct V G (Y) in time O(n)

V G (Y) Construction of V G (Y) AND OR G AND ≠ ≠ bogus color bit

Let G be an n-node graph GIVEN: SAT Oracle BUILD: 3-color Oracle G V G (Y)

Circuit-SAT / 3-Colorability Two problems that are cosmetically different, but substantially the same

Circuit-SAT / 3-Colorability Clique / Independent Set

Given an oracle for circuit SAT, how can you quickly solve k- clique?

Circuit-SAT / 3-Colorability Clique / Independent Set

Four problems that are cosmetically different, but substantially the same

FACT: No one knows a way to solve any of the 4 problems that is fast on all instances

Summary Many problems that appear different on the surface can be efficiently reduced to each other, revealing a deeper similarity