NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

Size: px
Start display at page:

Download "NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20"

Transcription

1 NP-complete problems CSE 101: Design and Analysis of Algorithms Lecture 20

2 CSE 101: Design and analysis of algorithms NP-complete problems Reading: Chapter 8 Homework 7 is due today, 11:59 PM Tomorrow s discussion section is the final exam review No instructor, TA, or tutor office hours during finals week. Ask questions on Piazza. Final exam is Friday, Dec 14, 7:00 PM-9:59 PM Practice problems released tomorrow CSE 101, Fall

3 Optimization problems Find the best solution from among a large space of possibilities The format for an optimization problem is Instance: what does the input look like? Solution format: what does an output look like? Constraints: what properties must a solution have? Objective function: what makes a solution better or worse? Based on slides courtesy of Miles Jones CSE 101, Fall

4 Examples of optimization problems Shortest path: Dijkstra s algorithm (fast) Minimum spanning tree: Kruskal s algorithm (fast) Optimal event scheduling: greedy algorithm (fast) Maximum independent set: backtracking (slow) Longest increasing subsequence: dynamic programming (relatively fast) CSE 101, Fall

5 Search problems Find a solution from among a large space of possibilities that meets the constraints, or say none exists The format for a search problem is Instance: what does the input look like? (same as optimization) Solution format: what does an output look like? (same as optimization) Constraints: what properties must a solution have? (same as optimization) Objective: find any solution meeting constraints, or certify none exists Decision version: is there a solution meeting the constraints? Yes/No CSE 101, Fall

6 Examples of decision problems Is there a path? Depth-first search, breadth-first search (fast) Is there a topological sort (i.e., is a graph a directed acyclic graph (DAG))? Greedy-ish algorithm Is there a Hamiltonian path (a path in an undirected or directed graph that visits each vertex exactly once)? Backtracking (slow) Is there a negative cycle? Bellman-Ford algorithm, dynamic programming (somewhat fast) Does a bipartite graph have a perfect matching? (somewhat fast) CSE 101, Fall

7 Examples of other search/optimization problems Finding the minimum area arrangement for components in a chip Solving a Sudoku puzzle Packing your car trunk Decrypting a message Proving a theorem CSE 101, Fall

8 8 queens puzzle Put 8 queens on a chessboard such that no two are attacking Solution format: what does an output look like? Constraints: what properties must a solution have? CSE 101, Fall

9 8 queens puzzle Put 8 queens on a chessboard such that no two are attacking Solution format: arrangement of 8 queens on chessboard Constraints: no two queens are attacking CSE 101, Fall

10 Maximal independent set Given a graph with nodes representing people, and there is an edge between A in B if A and B are enemies, find the largest set of people such that no two are enemies. In other words, given an undirected graph, find the largest set of vertices such that no two are connected with an edge. Instance: what does the input look like? Solution format: what does an output look like? Constraints: what properties must a solution have? Objective function: what makes a solution better or worse? CSE 101, Fall

11 Maximal independent set Given a graph with nodes representing people, and there is an edge between A in B if A and B are enemies, find the largest set of people such that no two are enemies. In other words, given an undirected graph, find the largest set of vertices such that no two are connected with an edge. Instance: an undirected graph A Solution format: subset S of vertices V B C D Constraints: u, v S (u, v) E G H E Objective function: maximize S F CSE 101, Fall I Example K J L

12 n queens puzzle How can we view n queens as a special case of independent set? Break into groups of 4 or 5, and discuss approaches Do not worry about getting the answer right, just brainstorm ideas CSE 101, Fall

13 n queens puzzle How can we view n queens as a special case of independent set? Break into groups of 4 or 5, and discuss approaches Do not worry about getting the answer right, just brainstorm ideas CSE 101, Fall

14 n queens puzzle How can we view n queens as a special case of independent set? Graph G is? V = deg u = 4 n 1 E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

15 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = deg u = 4 n 1 E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

16 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V =? deg u = 4 n 1 E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

17 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u = 4 n 1 E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

18 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u ~? E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

19 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u ~4 n 1 E = 4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

20 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u ~4 n 1 E ~? If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

21 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u ~4 n 1 E ~4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

22 n queens puzzle How can we view n queens as a special case of independent set? Graph G is n n board V = n 2 deg u ~4 n 1 E ~4 n 1 n 2 If G has an independent set of size n, then there is a solution to the n queens problem CSE 101, Fall

23 How hard are these problems? We have a number of approaches that give fast algorithms for a wide variety of search and optimization problems But, other search and optimization problems seem to defeat our standard algorithmic methods (e.g., factoring, independent set, Hamiltonian path) Are all reasonable search and optimization problems easy? If not, what makes some hard? Can we identify the hard ones? CSE 101, Fall

24 Nondeterministic polynomial (NP) NP is a class of decision versions of reasonable search problems Instance: what does the input look like? x, n bits Solution format: what does an output look like? y, poly(n) bits to describe Constraints: what properties must a solution have? R(x,y) can be checked in polynomial time Objective: find any solution meeting constraints, or certify none exists Given x, does there exist a y so that R(x,y)? CSE 101, Fall

25 Nondeterministic polynomial (NP) NP is a class of decision versions of reasonable search problems Instance: what does the input look like? x, n bits Solution format: what does an output look like? y, poly(n) bits to describe Constraints: what properties must a solution have? R(x,y) can be checked in polynomial time Objective: find any solution meeting constraints, or certify none exists Given x, does there exist a y so that R(x,y)? Input Output Constraints are met CSE 101, Fall

26 Polynomial (P) P is a class of decision versions of reasonable search problems that have a polynomial time solution Examples of problems in P Shortest path in graphs Median Almost all algorithms covered in this course CSE 101, Fall

27 Polynomial (P) P is a class of decision versions of reasonable search problems that have a polynomial time solution Examples of problems in P Shortest path in graphs Median Almost all algorithms covered in this course CSE 101, Fall

28 P vs NP Any polynomial time decidable yes/no problem is in NP So P is a subset of NP Statement of P=NP: Every decision version of a reasonable search problem is solvable in polynomial time Implications: using binary search, can reduce search/optimization to decision. So, P=NP implies: Every reasonable search and optimization problem can be solved in polynomial time Totally open after many years, one of the Clay Mathematics Institute s list of most important open problems in mathematics CSE 101, Fall

29 Optimization vs decision Example: Traveling salesman (optimization) problem Given a (complete) graph with vertices v 0, v 1,, v n and positive edge weights, what is the cheapest route one can take starting from v 0, going through every node (exactly once), and ending back at v 0? Instance: what does the input look like? Solution format: what does an output look like? Constraints: what properties must a solution have? Objective function: what makes a solution better or worse? CSE 101, Fall

30 Optimization vs decision Example: Traveling salesman (optimization) problem Given a (complete) graph with vertices v 0, v 1,, v n and positive edge weights, what is the cheapest route one can take starting from v 0, going through every node (exactly once), and ending back at v 0? Instance: complete graph with positive edge weights Solution format: sequence of vertices Constraints: all vertices appear exactly once Objective function: minimize total sum of edges CSE 101, Fall

31 Optimization vs decision Example: Traveling salesman (decision) problem Given a (complete) graph with vertices v 0, v 1,, v n and positive edge weights and a budget B, is there a route one can take starting from v 0, going through every node (exactly once), and ending back at v 0 such that the total cost of all edges is less than B? Instance: what does the input look like? Solution format: what does an output look like? Constraints: what properties must a solution have? Objective (decision version): is there a solution meeting the constraints? Yes/No CSE 101, Fall

32 Optimization vs decision Example: Traveling salesman (decision) problem Given a (complete) graph with vertices v 0, v 1,, v n and positive edge weights and a budget B, is there a route one can take starting from v 0, going through every node (exactly once), and ending back at v 0 such that the total cost of all edges is less than B? Instance: complete graph with positive edge weights (same as optimization problem) Solution format: sequence of vertices (same as optimization problem) Constraints: all vertices appear exactly once (same as optimization problem) Objective (decision version): is there a sequence where the total sum of edges is B? CSE 101, Fall

33 Optimization vs decision If one could solve the traveling salesman decision problem in O n k time for some integer k, then could one use that to solve the optimization problem in polynomial time? A binary search on the range of possible distances (total sums of edges) can convert the decision version of the problem to the optimization version, by calling the decision version repeatedly (a polynomial number of times) CSE 101, Fall

34 Optimization vs decision If one could solve the traveling salesman decision problem in O n k time for some integer k, then could one use that to solve the optimization problem in polynomial time? A binary search on the range of possible distances (total sums of edges) can convert the decision version of the problem to the optimization version, by calling the decision version repeatedly (a polynomial number of times) CSE 101, Fall

35 Brief history The famous logician Kurt Godel asked the famous computer scientist, mathematician, and economist John von Neumann the P vs NP question in a private letter, written shortly before von Neumann s death (1957) CSE 101, Fall

36 Brief history In the Soviet Union, S.V. Yablonksi invents the term perebor or brute force search to describe the combinatorial explosion limiting algorithms, especially for circuit design problems (1959) CSE 101, Fall

37 Brief history Matching and P vs NP. In 1965, Jack Edmonds gives the first polynomial time algorithm for perfect matching on general graphs. To explain the significance to referees, he introduces a section defining P, NP, and posing the P vs NP question. CSE 101, Fall

38 Brief history NP-completeness. In 1971, Steve Cook defines NP-completeness and proves that several problems from logic and combinatorics are NPcomplete, meaning that P=NP if and only if any of these problems are polynomial time solvable. CSE 101, Fall

39 Brief history Plethora of NP-complete problems. Following Cook s work, Richard Karp showed that a large number of the most important optimization problems from all sub-areas (scheduling, graph theory, number theory, logic, puzzles and games, packing, coding, etc.) are NPcomplete. CSE 101, Fall

40 Brief history Garey and Johnson s classic textbook (1979) includes an appendix listing hundreds of NPcomplete problems CSE 101, Fall

41 Brief history NP-complete problems everywhere. Since then, thousands of NP-complete problems have been identified in pretty much any area with computational problems: physics, biology, chemistry, economics, sociology, linguistics, games, engineering, etc. CSE 101, Fall

42 Some of our favorite NP-complete problems Sudoku CSE 101, Fall

43 Some of our favorite NP-complete problems Tetris CSE 101, Fall

44 Some of our favorite NP-complete problems Candy Crush CSE 101, Fall

45 Some of our favorite NP-complete problems Minesweeper CSE 101, Fall

46 Reductions We can view decision problems as the set of all instances for which the answer is yes A reduction from decision problem A to decision problem B is a polynomial time computable function F so that x A F(x) B Then, if we have an algorithm Alg B solving B, we can get an Alg A solving A by using Alg A x Alg B F x If A reduces to B, we write A mp B, where mp is polynomial time map reduction CSE 101, Fall

47 Reductions We have used reductions many times to design algorithms For example Reducing max bandwidth path to reachability Reducing longest increasing subsequence to longest path in directed acyclic graphs Reducing arbitrage to the single-source shortest paths problem, checking for negative cycles (Bellman-Ford algorithm) CSE 101, Fall

48 Reductions and relative hardness If A mp B and B P, then A P So, if A reduces to B and B is easy, then A is easy Contrapositive: if A reduces to B and A is hard, then B is hard Caution: If A reduces to B and B is hard, then nothing happens If A reduces to B and A is easy, then nothing happens CSE 101, Fall

49 Graph coloring Originally came up in making maps: vertices = countries, colors must be distinct to show borders. Famous 4-color theorem said all planar graphs (including possible maps) can be colored with 4 colors. CSE 101, Fall

50 Graph coloring Example: can you color the vertices of this graph with 3 colors so that no two adjacent vertices are the same color? B E D C Possible Colors: R, G, B I G K H A F J L CSE 101, Fall

51 3-coloring Can you color the vertices of a given graph with 3 colors so that no two adjacent vertices are the same color? Instance: what does the input look like? Solution format: what does an output look like? Constraints: what properties must a solution have? Objective (decision version): is there a solution meeting the constraints? Yes/No CSE 101, Fall

52 3-coloring Can you color the vertices of a given graph with 3 colors so that no two adjacent vertices are the same color? Instance: undirected graph G Solution format: give each vertex v a color C v R, G, B Constraints: if u, v is an edge, C(v) C(u) Objective (decision version): is there any 3-coloring of G? CSE 101, Fall

53 3-coloring 3-coloring reduces to maximum independent set Given any undirected connected graph G, if one can solve maximum independent set in polynomial time, then one can use that to find a 3- coloring of G How? Given a graph G = (V, E), we make a new graph H = (V, E ), where H = F(G) For each u V, create three vertices in V, namely u G, u R, u B and connect these three in a triangle For each edge {u, v} E, add edges u G, v G, u R, v R, u B, v B in E CSE 101, Fall

54 3-coloring B E D C I G H J A F K L CSE 101, Fall

55 3-coloring Equivalence Claim: H has an independent set of size n if and only if G is 3-colorable If H has an independent set of size n, it must select exactly one of {u R, u G, u B } for each u in G. Color u in G by the color of the subscript in the independent set of H. This must be a valid coloring because two adjacent vertices in G cannot be both Red since u R, v R is an edge in H Conversely, if there is a coloring of G, use that coloring to pick the corresponding vertex in H CSE 101, Fall

56 Implication 3-coloring If we can solve independent set quickly, we can solve 3-coloring quickly Can we solve independent set quickly? CSE 101, Fall

57 Implication 3-coloring If we can solve independent set quickly, we can solve 3-coloring quickly Can we solve independent set quickly? No (not yet) CSE 101, Fall

58 Search problems (satisfiability) A very basic search problem is the problem of satisfiability (SAT) (SAT) Given a Boolean formula in conjunctive normal form, find an assignment of the variables that makes the formula true or state that none exists Example: x y z x y y z CSE 101, Fall

59 Search problems (satisfiability) A very basic search problem is the problem of satisfiability (SAT) (SAT) Given a Boolean formula in conjunctive normal form, find an assignment of the variables that makes the formula true or state that none exists Example: x y z x y y z x = T y = T z = F T or T or T and F or T and F or T CSE 101, Fall

60 Search problems (3-satisfiability) (3-SAT) Given a Boolean formula in conjunctive normal form such that each clause has at most 3 literals, find an assignment of the variables that makes the formula true or state that none exists If we relax the 2-SAT problem to at most 3 literals per clause, then there is no known polynomialtime algorithm to solve it CSE 101, Fall

61 P vs NP A decision problem is an algorithm that takes as input an instance I and a solution S and determines if S is a valid solution of I in polynomial time of I The set of all decision problems is called NP The set of all decision problems that have a polynomial time algorithm that can find a solution is called P CSE 101, Fall

62 Other Reductions Sometimes it is useful to reduce problem A to problem B (denoted A B) Given that you can get a solution to problem B, you can solve problem A in polynomial time Example: (2SAT) (3SAT) Clearly you can just consider (2SAT) as a subset of (3SAT) Example: (3SAT) (SAT) By simply considering that there could be more than 3 literals per clause Example: (SAT) (3SAT) This may seem surprising CSE 101, Fall

63 NP-complete A decision problem A in NP is said to be NP-complete if all other decision problems reduce to A Existence of Hamiltonian path TSP optimization TSP decision Factoring large numbers CSE 101, Fall

64 NP-complete A problem A is NP-complete if A NP and for every B NP, B reduces to A It follows that, if A is NP-complete, then A P P = NP So, each NP-complete problem determines the fate of all search and optimization problems. In particular, they are all equivalent to each other. CSE 101, Fall

65 (SAT) is NP-complete NP-complete There is a way to reduce any decision problem in NP to (SAT) CSE 101, Fall

66 (SAT) (3SAT) Any clause of the form a 1 a 2 a n can be written in the form a 1 a 2 y 1 y 1 a 3 y 2 y 2 a 4 y 3 (y n 2 a n 1 a n ) So, if we can solve (3SAT) then we can solve (SAT) because (SAT) can be reduced to (3SAT) CSE 101, Fall

67 Loopholes If A is an NP-complete problem, then there are no known polynomial time solutions that can completely solve it on every input. CSE 101, Fall

68 Loopholes Change problem Restrict instances. Are there some restrictions on the instances you have to solve that you did not include in the problem definition? Approximation algorithms: is coming close to optimal good enough? Multiparameter analysis: can you be exponential in a typically small value? Hope that an exponential time algorithm runs faster on your instance: SAT solvers, integer linear programming Average-case analysis Search heuristics CSE 101, Fall

69 NP-hard A problem H is called NP-hard if all problems in NP can be reduced to H The difference between NP-hard and NPcomplete NP-complete NP NP-hard NP CSE 101, Fall

70 P = NP? Does there exist a polynomial time algorithm for all problems in NP? This is not known CSE 101, Fall

71 Summary of CSE 101 Graph search Using data structures (mix between graph search and greedy algorithms) Greedy algorithms Divide and conquer Dynamic programming Reducing to a previously solved problem CSE 101, Fall

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 7 Define NP-completeness Give examples of NP-complete problems Use polynomial-time

More information

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the

More information

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter 2006 NP-Completeness (Chapter 8) Given positive integers a, b, c Question 1: does there exist a positive integer x such that

More information

VIII. NP-completeness

VIII. NP-completeness VIII. NP-completeness 1 / 15 NP-Completeness Overview 1. Introduction 2. P and NP 3. NP-complete (NPC): formal definition 4. How to prove a problem is NPC 5. How to solve a NPC problem: approximate algorithms

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURES 30-31 NP-completeness Definition NP-completeness proof for CIRCUIT-SAT Adam Smith 11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova,

More information

NP-completeness. Chapter 34. Sergey Bereg

NP-completeness. Chapter 34. Sergey Bereg NP-completeness Chapter 34 Sergey Bereg Oct 2017 Examples Some problems admit polynomial time algorithms, i.e. O(n k ) running time where n is the input size. We will study a class of NP-complete problems

More information

Lecture 4: NP and computational intractability

Lecture 4: NP and computational intractability Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples

More information

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

The P versus NP Problem. Ker-I Ko. Stony Brook, New York The P versus NP Problem Ker-I Ko Stony Brook, New York ? P = NP One of the seven Millenium Problems The youngest one A folklore question? Has hundreds of equivalent forms Informal Definitions P : Computational

More information

CS/COE

CS/COE CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct

More information

P vs. NP. Data Structures and Algorithms CSE AU 1

P vs. NP. Data Structures and Algorithms CSE AU 1 P vs. NP Data Structures and Algorithms CSE 373-18AU 1 Goals for today Define P, NP, and NP-complete Explain the P vs. NP problem -why it s the biggest open problem in CS. -And what to do when a problem

More information

Graph Theory and Optimization Computational Complexity (in brief)

Graph Theory and Optimization Computational Complexity (in brief) Graph Theory and Optimization Computational Complexity (in brief) Nicolas Nisse Inria, France Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, Sophia Antipolis, France September 2015 N. Nisse Graph Theory

More information

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness Harry Lewis November 19, 2013 Reading: Sipser 7.4, 7.5. For culture : Computers and Intractability: A Guide to the Theory

More information

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch] NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the

More information

COP 4531 Complexity & Analysis of Data Structures & Algorithms

COP 4531 Complexity & Analysis of Data Structures & Algorithms COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According

More information

Data Structures in Java

Data Structures in Java Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 31 P and NP Self-reducibility NP-completeness Adam Smith 12/1/2008 S. Raskhodnikova; based on slides by K. Wayne Central ideas we ll cover Poly-time as feasible most

More information

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity 1 CS 350 Algorithms and Complexity Fall 2015 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower

More information

ECS122A Handout on NP-Completeness March 12, 2018

ECS122A Handout on NP-Completeness March 12, 2018 ECS122A Handout on NP-Completeness March 12, 2018 Contents: I. Introduction II. P and NP III. NP-complete IV. How to prove a problem is NP-complete V. How to solve a NP-complete problem: approximate algorithms

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some

More information

Polynomial-time Reductions

Polynomial-time Reductions Polynomial-time Reductions Disclaimer: Many denitions in these slides should be taken as the intuitive meaning, as the precise meaning of some of the terms are hard to pin down without introducing the

More information

Polynomial-Time Reductions

Polynomial-Time Reductions Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:

More information

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas CSE 417 Introduction to Algorithms Winter 2007 Some Algebra Problems (Algorithmic) Given positive integers a, b, c Question 1: does there exist a positive integer x such that ax = c? NP-Completeness (Chapter

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes: Classes of Problems We can characterize many problems into three classes: CS 461, Lecture 23 Jared Saia University of New Mexico P is the set of yes/no problems that can be solved in polynomial time. Intuitively

More information

NP-Completeness Review

NP-Completeness Review CS124 NP-Completeness Review Where We Are Headed Up to this point, we have generally assumed that if we were given a problem, we could find a way to solve it. Unfortunately, as most of you know, there

More information

NP-Complete Reductions 1

NP-Complete Reductions 1 x x x 2 x 2 x 3 x 3 x 4 x 4 CS 4407 2 22 32 Algorithms 3 2 23 3 33 NP-Complete Reductions Prof. Gregory Provan Department of Computer Science University College Cork Lecture Outline x x x 2 x 2 x 3 x 3

More information

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM 8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin

More information

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 26 Computational Intractability Polynomial Time Reductions Sofya Raskhodnikova S. Raskhodnikova; based on slides by A. Smith and K. Wayne L26.1 What algorithms are

More information

Algorithms Design & Analysis. Approximation Algorithm

Algorithms Design & Analysis. Approximation Algorithm Algorithms Design & Analysis Approximation Algorithm Recap External memory model Merge sort Distribution sort 2 Today s Topics Hard problem Approximation algorithms Metric traveling salesman problem A

More information

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

More information

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9 1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives Classify problems as tractable or intractable Define decision problems Define the class P Define

More information

NP-Complete Problems and Approximation Algorithms

NP-Complete Problems and Approximation Algorithms NP-Complete Problems and Approximation Algorithms Efficiency of Algorithms Algorithms that have time efficiency of O(n k ), that is polynomial of the input size, are considered to be tractable or easy

More information

Lecture 15 - NP Completeness 1

Lecture 15 - NP Completeness 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 29, 2018 Lecture 15 - NP Completeness 1 In the last lecture we discussed how to provide

More information

Notes for Lecture 21

Notes for Lecture 21 U.C. Berkeley CS170: Intro to CS Theory Handout N21 Professor Luca Trevisan November 20, 2001 Notes for Lecture 21 1 Tractable and Intractable Problems So far, almost all of the problems that we have studied

More information

NP Completeness and Approximation Algorithms

NP Completeness and Approximation Algorithms Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic

More information

Chapter 34: NP-Completeness

Chapter 34: NP-Completeness Graph Algorithms - Spring 2011 Set 17. Lecturer: Huilan Chang Reference: Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. Chapter 34: NP-Completeness 2. Polynomial-time

More information

CS 583: Algorithms. NP Completeness Ch 34. Intractability

CS 583: Algorithms. NP Completeness Ch 34. Intractability CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working

More information

4/19/11. NP and NP completeness. Decision Problems. Definition of P. Certifiers and Certificates: COMPOSITES

4/19/11. NP and NP completeness. Decision Problems. Definition of P. Certifiers and Certificates: COMPOSITES Decision Problems NP and NP completeness Identify a decision problem with a set of binary strings X Instance: string s. Algorithm A solves problem X: As) = yes iff s X. Polynomial time. Algorithm A runs

More information

NP-Completeness. NP-Completeness 1

NP-Completeness. NP-Completeness 1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and

More information

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

10.3: Intractability. Overview. Exponential Growth. Properties of Algorithms. What is an algorithm? Turing machine.

10.3: Intractability. Overview. Exponential Growth. Properties of Algorithms. What is an algorithm? Turing machine. Overview 10.3: Intractability What is an algorithm? Turing machine. What problems can be solved on a computer? Computability. What ALGORITHMS will be useful in practice? Analysis of algorithms. Which PROBLEMS

More information

NP-Complete Problems. More reductions

NP-Complete Problems. More reductions NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM

More information

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1 CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY E. Amaldi Foundations of Operations Research Politecnico di Milano 1 Goal: Evaluate the computational requirements (this course s focus: time) to solve

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms Session 21. April 13, 2009 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/3137 Announcements Homework 5 due next Monday I m out of town Wed to Sun for conference

More information

1. Introduction Recap

1. Introduction Recap 1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization

More information

4/22/12. NP and NP completeness. Efficient Certification. Decision Problems. Definition of P

4/22/12. NP and NP completeness. Efficient Certification. Decision Problems. Definition of P Efficient Certification and completeness There is a big difference between FINDING a solution and CHECKING a solution Independent set problem: in graph G, is there an independent set S of size at least

More information

Computational Intractability 2010/4/15. Lecture 2

Computational Intractability 2010/4/15. Lecture 2 Computational Intractability 2010/4/15 Professor: David Avis Lecture 2 Scribe:Naoki Hatta 1 P and NP 1.1 Definition of P and NP Decision problem it requires yes/no answer. Example: X is a set of strings.

More information

Lecture 14 - P v.s. NP 1

Lecture 14 - P v.s. NP 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 27, 2018 Lecture 14 - P v.s. NP 1 In this lecture we start Unit 3 on NP-hardness and approximation

More information

CSI 4105 MIDTERM SOLUTION

CSI 4105 MIDTERM SOLUTION University of Ottawa CSI 4105 MIDTERM SOLUTION Instructor: Lucia Moura Feb 6, 2010 10:00 am Duration: 1:50 hs Closed book Last name: First name: Student number: There are 4 questions and 100 marks total.

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds

More information

1 Primals and Duals: Zero Sum Games

1 Primals and Duals: Zero Sum Games CS 124 Section #11 Zero Sum Games; NP Completeness 4/15/17 1 Primals and Duals: Zero Sum Games We can represent various situations of conflict in life in terms of matrix games. For example, the game shown

More information

8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability. Classify Problems

8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability. Classify Problems Chapter 8 8.1 Polynomial-Time Reductions NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Classify Problems According to Computational

More information

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015 CS 374: Algorithms & Models of Computation, Spring 2015 NP Completeness Lecture 23 November 19, 2015 Chandra & Lenny (UIUC) CS374 1 Spring 2015 1 / 37 Part I NP-Completeness Chandra & Lenny (UIUC) CS374

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Homework 5 due on March 29 th at 11:59 PM (on Blackboard) Recap Polynomial Time Reductions (X P Y ) P Decision problems

More information

3/22/2018. CS 580: Algorithm Design and Analysis. Circuit Satisfiability. Recap. The "First" NP-Complete Problem. Example.

3/22/2018. CS 580: Algorithm Design and Analysis. Circuit Satisfiability. Recap. The First NP-Complete Problem. Example. Circuit Satisfiability CS 580: Algorithm Design and Analysis CIRCUIT-SAT. Given a combinational circuit built out of AND, OR, and NOT gates, is there a way to set the circuit inputs so that the output

More information

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle Directed Hamiltonian Cycle Chapter 8 NP and Computational Intractability Claim. G has a Hamiltonian cycle iff G' does. Pf. Suppose G has a directed Hamiltonian cycle Γ. Then G' has an undirected Hamiltonian

More information

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA. Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA NP Completeness Susmita Sur-Kolay Advanced Computing and Microelectronics Unit

More information

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2) Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set

More information

Problem Complexity Classes

Problem Complexity Classes Problem Complexity Classes P, NP, NP-Completeness and Complexity of Approximation Joshua Knowles School of Computer Science The University of Manchester COMP60342 - Week 2 2.15, March 20th 2015 In This

More information

Analysis of Algorithms. Unit 5 - Intractable Problems

Analysis of Algorithms. Unit 5 - Intractable Problems Analysis of Algorithms Unit 5 - Intractable Problems 1 Intractable Problems Tractable Problems vs. Intractable Problems Polynomial Problems NP Problems NP Complete and NP Hard Problems 2 In this unit we

More information

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem? Admin Two more assignments No office hours on tomorrow NP-COMPLETE PROBLEMS Run-time analysis Tractable vs. intractable problems We ve spent a lot of time in this class putting algorithms into specific

More information

A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi 1 Why computational complexity? What is computational complexity theory? It s a branch of mathematics

More information

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal? CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal? The conjecture that P is different from NP made its way on to several lists of the most important unsolved problems in Mathematics (never

More information

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) The final exam will be on Thursday, May 12, from 8:00 10:00 am, at our regular class location (CSI 2117). It will be closed-book and closed-notes, except

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 20.1 Introduction Definition 20.1.1 We say that an algorithm runs in polynomial time if its running

More information

More on NP and Reductions

More on NP and Reductions Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information

Nondeterministic Polynomial Time

Nondeterministic Polynomial Time Nondeterministic Polynomial Time 11/1/2016 Discrete Structures (CS 173) Fall 2016 Gul Agha Slides based on Derek Hoiem, University of Illinois 1 2016 CS Alumni Awards Sohaib Abbasi (BS 78, MS 80), Chairman

More information

Lecture 18: P & NP. Revised, May 1, CLRS, pp

Lecture 18: P & NP. Revised, May 1, CLRS, pp Lecture 18: P & NP Revised, May 1, 2003 CLRS, pp.966-982 The course so far: techniques for designing efficient algorithms, e.g., divide-and-conquer, dynamic-programming, greedy-algorithms. What happens

More information

Correctness of Dijkstra s algorithm

Correctness of Dijkstra s algorithm Correctness of Dijkstra s algorithm Invariant: When vertex u is deleted from the priority queue, d[u] is the correct length of the shortest path from the source s to vertex u. Additionally, the value d[u]

More information

NP Complete Problems. COMP 215 Lecture 20

NP Complete Problems. COMP 215 Lecture 20 NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst

More information

Reductions. Reduction. Linear Time Reduction: Examples. Linear Time Reductions

Reductions. Reduction. Linear Time Reduction: Examples. Linear Time Reductions Reduction Reductions Problem X reduces to problem Y if given a subroutine for Y, can solve X. Cost of solving X = cost of solving Y + cost of reduction. May call subroutine for Y more than once. Ex: X

More information

NP and NP Completeness

NP and NP Completeness CS 374: Algorithms & Models of Computation, Spring 2017 NP and NP Completeness Lecture 23 April 20, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 44 Part I NP Chandra Chekuri (UIUC) CS374 2 Spring

More information

NP-Completeness. Until now we have been designing algorithms for specific problems

NP-Completeness. Until now we have been designing algorithms for specific problems NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

P, NP, NP-Complete. Ruth Anderson

P, NP, NP-Complete. Ruth Anderson P, NP, NP-Complete Ruth Anderson A Few Problems: Euler Circuits Hamiltonian Circuits Intractability: P and NP NP-Complete What now? Today s Agenda 2 Try it! Which of these can you draw (trace all edges)

More information

Computational Complexity

Computational Complexity Computational Complexity Algorithm performance and difficulty of problems So far we have seen problems admitting fast algorithms flow problems, shortest path, spanning tree... and other problems for which

More information

8.5 Sequencing Problems

8.5 Sequencing Problems 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Computational Complexity CLRS 34.1-34.4 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures 1 / 50 Polynomial

More information

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems COSE215: Theory of Computation Lecture 20 P, NP, and NP-Complete Problems Hakjoo Oh 2018 Spring Hakjoo Oh COSE215 2018 Spring, Lecture 20 June 6, 2018 1 / 14 Contents 1 P and N P Polynomial-time reductions

More information

Lecture 24: How to become Famous with P and NP

Lecture 24: How to become Famous with P and NP Lecture 4: How to become Famous with P and NP Agenda for today s class: The complexity class P The complexity class NP NP-completeness The P =? NP problem Major extra-credit problem (due: whenever) Fun

More information

} } } Lecture 23: Computational Complexity. Lecture Overview. Definitions: EXP R. uncomputable/ undecidable P C EXP C R = = Examples

} } } Lecture 23: Computational Complexity. Lecture Overview. Definitions: EXP R. uncomputable/ undecidable P C EXP C R = = Examples Lecture 23 Computational Complexity 6.006 Fall 2011 Lecture 23: Computational Complexity Lecture Overview P, EXP, R Most problems are uncomputable NP Hardness & completeness Reductions Definitions: P =

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 25 Last time Class NP Today Polynomial-time reductions Adam Smith; Sofya Raskhodnikova 4/18/2016 L25.1 The classes P and NP P is the class of languages decidable

More information

CSCI3390-Lecture 17: A sampler of NP-complete problems

CSCI3390-Lecture 17: A sampler of NP-complete problems CSCI3390-Lecture 17: A sampler of NP-complete problems 1 List of Problems We now know that if L is any problem in NP, that L P SAT, and thus SAT is NP-hard. Since SAT is also in NP we find that SAT is

More information

1.1 P, NP, and NP-complete

1.1 P, NP, and NP-complete CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Introduction to NP-complete Problems Date: 11/01/2008 Lecturer: Lap Chi Lau Scribe: Jerry Jilin Le This lecture gives a general introduction

More information

Chapter 8. NP and Computational Intractability

Chapter 8. NP and Computational Intractability Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Acknowledgement: This lecture slide is revised and authorized from Prof.

More information

CS 561, Lecture 12. Jared Saia University of New Mexico

CS 561, Lecture 12. Jared Saia University of New Mexico CS 561, Lecture 12 Jared Saia University of New Mexico Today s Outline P, NP and NP-Hardness Reductions Approximation Algorithms 1 Efficient Algorithms Q: What is a minimum requirement for an algorithm

More information

Geometric Steiner Trees

Geometric Steiner Trees Geometric Steiner Trees From the book: Optimal Interconnection Trees in the Plane By Marcus Brazil and Martin Zachariasen Part 3: Computational Complexity and the Steiner Tree Problem Marcus Brazil 2015

More information

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

CS Fall 2011 P and NP Carola Wenk

CS Fall 2011 P and NP Carola Wenk CS3343 -- Fall 2011 P and NP Carola Wenk Slides courtesy of Piotr Indyk with small changes by Carola Wenk 11/29/11 CS 3343 Analysis of Algorithms 1 We have seen so far Algorithms for various problems Running

More information

Polynomial-time reductions. We have seen several reductions:

Polynomial-time reductions. We have seen several reductions: Polynomial-time reductions We have seen several reductions: Polynomial-time reductions Informal explanation of reductions: We have two problems, X and Y. Suppose we have a black-box solving problem X in

More information

Data Structures in Java. Session 22 Instructor: Bert Huang

Data Structures in Java. Session 22 Instructor: Bert Huang Data Structures in Java Session 22 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/33 Announcements Homework 5 solutions posted Homework 6 to be posted this weekend Final exam Thursday,

More information

Algorithms. Sudoku. Rubik s cube. Evaluating how good (how efficient) an algorithm is 3/4/17. Algorithms, complexity and P vs NP SURVEY

Algorithms. Sudoku. Rubik s cube. Evaluating how good (how efficient) an algorithm is 3/4/17. Algorithms, complexity and P vs NP SURVEY Algorithms, complexity and P vs NP SURVEY Can creativity be automated? Slides by Avi Wigderson + Bernard Chazelle (with some extras) Finding an efficient method to solve SuDoku puzzles is: 1: A waste of

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems

More information

Problems and Solutions. Decidability and Complexity

Problems and Solutions. Decidability and Complexity Problems and Solutions Decidability and Complexity Algorithm Muhammad bin-musa Al Khwarismi (780-850) 825 AD System of numbers Algorithm or Algorizm On Calculations with Hindu (sci Arabic) Numbers (Latin

More information