More Computational Complexity Shirley Moore CS4390/5390 Fall 2013 August 29, 2013 1.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Hardness Results for Problems
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
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.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Modular Arithmetic Shirley Moore CS4390/5390 Fall September 3, 2013.
Approximation Algorithms
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.
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.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
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.
Lecture 38 CSE 331 Dec 2, Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
Lecture 38 CSE 331 Dec 5, OHs today (only online 9:30-11)
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Computational Complexity Shirley Moore CS4390/5390 Fall 2013 August 27, 2013.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Construction We constructed the following graph: This graph has several nice properties: Diameter Two Graph Pebbling Tim Lewis 1, Dan Simpson 1, Sam Taggart.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
CSC 172 P, NP, Etc.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
More NP-Complete and NP-hard Problems
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
ICS 353: Design and Analysis of Algorithms
Chapter 34: NP-Completeness
Hamiltonian Circuit (HC) problem
Presentation transcript:

More Computational Complexity Shirley Moore CS4390/5390 Fall August 29,

Agenda Announcements (3 min) Recap previous class (6 min) Discuss Fortnow article (6 min) Reducibility (20 min) Proving NP-completeness (20 min) Average-case complexity (20 min) Wrap-up and homework assignment (5 min) 2

Announcements Change in class location Pre-course survey now available 3

Recap from Tuesday Explain in your own words – what it means for a problem to be NP-complete – how one can show that a problem is NP-complete 4

Discussion of Status of P vs NP 1.Much of cryptography depends on integer factorization being hard. a.true b.false 2.If P = NP, then integer factorization is in P. a.true b.false 3.If integer factorization is in P, then P = NP. a.true b.false c.We don’t know, but unlikely 4.If SAT3 is in P, then integer factorization is in P. a.true b.false c.We don’t know 5

Status of P vs. NP (cont.) 5.Do you think P = NP? (no wrong answer!) a.Yes b.No 6.Do you think the P vs. NP problem will a.never be solved? b.be solved soon (i.e., in a few years)? c.be solved in your lifetime? d.be solved 100 years or more from now? 7.What else did you find of interest in the Fortnow article? 6

Learning Outcomes from August 27 After completing this lesson, you should be able to – Define the complexity classes P and NP – Define NP-complete – Discuss implications of computational complexity for cryptography – Apply logical proof techniques in the context of computational complexity

Learning Outcomes After completing today’s lesson successfully, you will be able to – Define reducibility – Devise polynomial time reductions from one problem to another – Explain how to use polynomial reduction as a strategy to prove a problem is NP-complete – Explain the difference between worst-case and average- case time complexity – Explain and give an example of a randomized algorithm – Discuss the relevance of average-case complexity analysis to cryptography 8

Reducibility A reduction is a way of converting one problem to a second problem, so that the solution to the second problem can be used to solve the first. If problem A is reducible to problem B, then solving problem A cannot be “harder” than solving problem B. A is polynomial time reducible to B if A can be converted to B in polynomial time. If B is in NP and an NP-complete problem A is polynomial time reducible to B, then B is NP- complete. 9

Class Exercise 1 Show that the Hamilton cycle problem and the Hamiltonian path problem for an undirected graph are polynomial time reducible to each other. 10

SAT Problem Satisfiability Problem (SAT): Given a set of clauses, is there an assignment of truth values to the variable such that the set is satisfiable? – (v1, v2’, v3), (v2), (v1’, v3) Yes – (v1, v2’, v3), (v2), (v2’, v3’), (v1’, v3) No Recall definition of NP-complete: A problem L is NP- complete if and only if 1) L is in NP, and 2) every other problem in NP can be reduced to L in polynomial time. How can you show that SAT is NP-complete by working from the definition of NP-complete? After proving SAT is NP-complete, how can you show that another problem B is NP-complete? Then how can you show another problem C is NP-complete (Hint: you have a choice of two ways)? 11

NP-Completeness of Hamiltonian Cycle 1.Show that Hamiltonian Cycle is in NP. 2.Reduce a known NP-complete problem to Hamiltonian Cycle in polynomial time. 12

Class Exercise 2: NP-Completeness of Traveling Salesman Problem (TSP) Traveling Salesman Problem (TSP): Given n cities and distances d(i,j) between each pair of cities, does there exist a tour of length ≤ k that visits each city and returns to the starting point? Given that Hamiltonian Cycle is NP-complete, show that TSP is NP-complete. See for more about TSP if you’re interested. 13

Does guessing help? Can “guessing” a solution to a “hard” problem be a good strategy for finding a solution in a reasonable amount of time? Consider the following randomized algorithm for solving the Hamiltonian path problem: – Start from a random vertex and continue to pick the next vertex randomly if there is a neighbor not yet visited. If there are no more unvisited neighbors, and then path isn’t Hamiltonian, pick a neighbor of the current vertex at random and rotate using that neighbor as a pivot (i.e., add an edge to that neighbor to the path and remove one of the existing path edges from the neighbor so as not for form a loop). Continue from the new end of the path. Example: Graph with nodes ABCDE and edges AD, DC, DE, CE, BC. 14

Average-case Runtime for Randomized Hamiltonian Path Algorithm Gurevich and Shelah, “Expected computation time for Hamiltonian path problem”, SIAM J. Computing 16(3), June – For fixed p, the expected runtime of the algorithm on a graph with n vertices and edge probability p is O(n). 15

Average-case Complexity Average-case polynomial time: Algorithm for solving problem L on input distribution μ is always correct but may take superpolynomial time on some inputs. Heuristic polynomial time: Algorithm for solving problem L on input distribution μ always runs in polynomial time but may give incorrect answers on some inputs. Which of the above two types is the randomized Hamiltonian Cycle algorithm? All of cryptography is predicated on the existence of average-case intractable problems in NP. Need an average-case analog of the theory of NP- completeness. 16

An Easy-to-Break NP-complete Cipher Abraham Lempel, “Crytology in Transition”, ACM Computing Surveys 11(4), Dec Demonstrated a cipher for which the problem of breaking its key is NP-complete even under chosen plaintext attack. However, given enough plaintext, the problem of breaking the key reduces, with probably approaching unity, to that of solving a linear system of n equations in n unknowns, where n is the number of key bits. 17

Homework 1.Prove: If B is NP-complete, C is in NP, and B is polynomial time reducible to C, then C is NP- complete. 2.Consider the 3SAT problem, where the input size is the number of variables. a.Devise an algorithm that solves the 3SAT problem correctly for all inputs. What is the complexity class of your algorithm? b.Devise a randomized algorithm with polynomial runtime for the 3SAT problem. Your algorithm may produce incorrect results for some inputs. (Extra credit challenge: Can you bound the error for your algorithm?) 18

Reflective Writing 1.Summarize in one to two sentences the main learning objectives we attempted to accomplish this week. 2.What did you learn this week that surprised you? 3.What was your muddiest point – i.e., what did you least understand? 19