Computational Complexity CSC 172 SPRING 2002 LECTURE 27.

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
Advertisements

Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Department of Computer Science & Engineering
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Clique Cover Cook’s Theorem 3SAT and Independent Set
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
CSC 413/513: Intro to Algorithms NP Completeness.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
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.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
NP-Complete Problems Algorithm : Design & Analysis [23]
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CSE 326: Data Structures: Graphs Lecture 24: Friday, March 7 th, 2003.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CSC 413/513: Intro to Algorithms
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
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.
CSC 172 P, NP, Etc.
The Theory of NP-Completeness
Chapter 10 NP-Complete Problems.
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
NP-completeness The Chinese University of Hong Kong Fall 2008
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Our old list of problems
RAIK 283 Data Structures & Algorithms
Presentation transcript:

Computational Complexity CSC 172 SPRING 2002 LECTURE 27

Why computational complexity? It’s intellectually stimulating (internal) I get paid (external)... but just how do I get paid?

The process of abstraction You can solve problems by wiring up special purpose hardware Turing showed that you could abstract hardware configurations Von Neumann showed that you could abstract away from the hardware (machine languages) High level languages are an abstraction of low level languages (JAVA/C++ rather than SML) Data structures are an abstractions in high level languages (“mystack.push(myobject)”) So, now we can talk about solutions to whole problems “Similar” problems with “similar” solutions constitute the next level of abstraction

The class of problems “P” “P” stands for “Polynomial” The class “P” is the set of problems that have polynomial time solutions Some problems have solutions than run in O(n c ) time - testing for cycles, MWST, CCs, shortest path On the other hand, some problems seem to take time that is exponential O(2 n ) or worse TSP, tautology, tripartiteness

Guessing Consider the “satisfiability” problem: Given a boolean expression in n varriables, is there are truth assignment that satisfies it (makes the expression true)? (b1 || b2) && (!b1) b1  false, b2  true (!b1 && b2) && (b1 && !b2) What if the number of variables got really high?

A “class/set” of problems Satisfiability is one problem The tautology is another problem Given a boolean expression in n variables, is the expression true for all possible assignments? (b1 || !b2) || (!b1 || b2) Or are they the same problem?

Same problem? Assume I have public static boolean satisfiable(String expression) How do I write public static boolean tautology(String expression) { return !satisfiable(“!(“ + expression + “)”); }

Same problem? Assume I have public static boolean tautology(String expression) How do I write public static boolean satisfiable(String expression) { return !tautology(“!(“ + expression + “)”); }

So, When we talk about “classes of problems” we are reasoning based on the understanding that there exist similar problems which have similar solutions If we solve one, we solve ‘em all

The class NP “NP” stands for “Nondeterministic Polynomial” “Nondeterministic” a.k.a “guess” A problem can be solved in dondetermistic polynomial time if: given a guess at a solution for some instance of size n we can check that the guess is correct in polynomial time (i.e. the check runs O(n c ))

P NP NPP P  NP

NPC NPC stands for “NP-complete” Some problems in NP are also in P -they can be solved as well as checked in O(n c ) time Others, appear not to be solvable in polynomial time There is no proof that they cannot be solved in polynomial time But, we have the next best thing to such proof A theory that says many of these problems are as hard as any in NP We call these “NP-complete problems”

Not sure? We work to prove equivalence of NPC problems If we cold solve one of them in O(n c ) time then all would be solvable in polynomial time (P == NP) What do we have? Since the NP-complete problems include many that have been worked on for centuries, there is strong evidence that all NP-complete problems really require exponential time to solve.

P NP NPC NPP P  NP NPC NPC  NP

Reductions The way a problem is proved NP-complete is to “reduce” a known NP-complete problem to it We reduce a problem A to a problem B by devising a solution that uses only a polynomial amount of time (to convert the data?) plus a call to a method that solves B

Back to Graphs By way of example of a class of problems consider Cliques & Independent Sets in graphs

Cliques A complete sub-graph of an undirected graph A set of nodes of some graph that has every possible edge The clique problem: Given a graph G and an integer k, is there a clique of at least k nodes?

Example

AB CD EFHG

AB CD EFHG

AB CD EFHG K == 4 ABEF CGHD

Independent Set Subset S of the nodes of an undirected graph such that there is no edge between any two members of S The independent set problem given a graph G and an integer k, is there an independent set with at least k nodes (Application: scheduling final exams) nodes == courses, edges mean that courses have one student in common. Any guesses on how large the graph would be for UR?

Example independent set AB CD EFHG K == 2 AC AD AG AH B(D,G,H) Etc..

Colorability An undirected graph is k-colorable if we can assign one of k colors to each node so tht no edge has both ends colored the same Chromatic number of a graph = the least number k such that it is k-colorable Coloring problem: given a graph G and an integer k, is G k-colorable?

Example: Chromatic number AB CD EFHG

AB CD EFHG

Checking Solutions Clique, IS, colorability are examples of hard to find solutions “find a clique of n nodes” But, it’s easy (polynomial time) to check a proposed solution.

Checking Check a propose clique by checking for the existence of the edges between the k nodes Check for an IS by checking for the non-existence of an edge between any two nodes in the proposed set Check a proposed coloring by examining the ends of all the edges in the graph

Same Problem Reductions Clique to IS Given a graph G and an integer k we want to know if there is a clique of size k in G 1. Construct a graph H with the same set of nodes as G and edge wherever G does not have edges 2. An independent set in H is a clique in G 3. Use the “IS” method on H and return it’s answer

Same Problem Reductions IS to Clique Given a graph G and an integer k we want to know if there is an IS of size k in G 1. Construct a graph H with the same set of nodes as G and edge wherever G does not have edges 2. An independent set in H is a clique in G 3. Use the “clique” method on H and return it’s answer

Example AB CD EG

AB CD EG

AB CD EG

AB C D EG

A BC D EG

A BC D EG

A BC D EG AB CD EG