Discrete Optimization Lecture 6 – Part 1 M. Pawan Kumar

Slides:



Advertisements
Similar presentations
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
Advertisements

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.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
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.
Lecture 21 Nondeterministic Polynomial time, and the class NP FIT2014 Theory of Computation Monash University Faculty of Information Technology Slides.
Discrete Structures & Algorithms The P vs. NP Question EECE 320.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
Example: HP ≤ p HC Hamiltonian Path –Input: Undirected Graph G = (V,E) –Y/N Question: Does G contain a Hamiltonian Path? Hamiltonian Cycle –Input: Undirected.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Computability and Complexity 17-1 Computability and Complexity Andrei Bulatov Strong NP-Completeness.
MCS312: NP-completeness and Approximation Algorithms
Polyhedral Optimization Lecture 1 – Part 2 M. Pawan Kumar Slides available online
1 CSC 421: Algorithm Design & Analysis Spring 2013 Complexity & Computability  lower bounds on problems brute force, decision trees, adversary arguments,
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
CSCE350 Algorithms and Data Structure
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 11 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Lecture 4. RAM Model, Space and Time Complexity
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
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.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
The Class NP Lecture 39 Section 7.3 Mon, Nov 26, 2007.
COMPSCI 102 Introduction to Discrete Mathematics.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
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-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
Discrete Optimization Lecture 6 – Part 2 M. Pawan Kumar
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
Week 13 - Monday.  What did we talk about last time?  B-trees  Hamiltonian tour  Traveling Salesman Problem.
LIMITATIONS OF ALGORITHM POWER
Discrete Optimization Lecture 4 M. Pawan Kumar
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
Discrete Optimization Lecture 4 – Part 1 M. Pawan Kumar
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
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.
Computational Complexity Shirley Moore CS4390/5390 Fall 2013 August 27, 2013.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from M. Pawan Kumar, E. Demaine.
Discrete Optimization
Prabhas Chongstitvatana
CSE 589 Applied Algorithms Spring 1999
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Lecture 23 NP-Hard Problems
Presentation transcript:

Discrete Optimization Lecture 6 – Part 1 M. Pawan Kumar

Outline Preliminaries –Random Access Machine (RAM) –Polynomial-time Algorithm –Decision Problems P, NP, and NP-Complete Problems

Given an array f with elements = 0,1 strings RAM executes a set of instructions Each instruction can –Read entries from prescribed positions –Perform arithmetic operation on read entries –Write answers to prescribed positions Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Instructions numbered 0, 1, …, t Variable z 0 stores the instruction to execute Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Instructions numbered 0, 1, …, t Stop if z 0 > t Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Read instruction –z i := f(z j ) Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Write instruction –f(z i ) := z j Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Add instruction –z i := z j + z k Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Subtract instruction –z i := z j - z k Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Multiply instruction –z i := z j z k Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Divide instruction –z i := z j / z k Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Increment instruction –z i := z i + 1 Random Access Machine

Given an array f with elements = 0,1 strings Finite set of variables z 0, z 1, …, z k Initially, z i = 0 and f contains input Binarize instruction –z i := 1, if z i > 0 –z i := 0, otherwise Random Access Machine

z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 0 z 2 = 0 z 3 = 0 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 0 z 2 = 10 z 3 = 0 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 0 z 2 = 10 z 3 = 0 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 0 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 0 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 3 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 3 z 4 = 0

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 3 z 4 = 13

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 1 z 2 = 10 z 3 = 3 z 4 = 13

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 2 z 2 = 10 z 3 = 3 z 4 = 13

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 2 z 2 = 10 z 3 = 3 z 4 = 13

Random Access Machine z 2 := f(z 1 ) z 1 := z 1 +1 z 3 := f(z 1 ) z 4 := z 2 + z 3 z 1 := z 1 +1 f(z 1 ) := z Array f z 1 = 2 z 2 = 10 z 3 = 3 z 4 = 13

Outline Preliminaries –Random Access Machine (RAM) –Polynomial-time Algorithm –Decision Problems P, NP, and NP-Complete Problems

Input size = Number of bits b Polynomial time algorithm –Number of instructions = t –t is bounded by a polynomial in b –Good algorithm –Efficient algorithm Polynomial Time Algorithm

Preliminaries –Random Access Machine (RAM) –Polynomial-time Algorithm –Decision Problems (Answered by ‘yes’ or ‘no’) P, NP, and NP-Complete Problems Reduction Outline

Finite set Σ called alphabet of size ≥ 2 –{0,1} –{a,b,c,d,e,…,x,y,z} Set Σ* of all finite length strings (called words) –0, 1, 00, 01, 10, 11, 000,…. –discrete, optimization Size of word size(w) = number of letters –size(00) = 2 –size(discrete) = 8 Decision Problem

Problem Π is a subset of Σ* –All words with the answer “yes” Informal problem –Given input word x  Σ*, does x  Π ? Polynomial-time solvable problem Π –There exists a polynomial-time algorithm for the informal problem –Polynomial in size(x) Decision Problem

Shortest Path v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 1 },{v 0,v 3 },{v 1,v 2 },{v 2,v 3 },{v 2,v 4 },{v 3,v 4 }}, {3,5,5,4,6,1}, v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 3,v 4,v 2 }  Σ*

Shortest Path v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 1 },{v 0,v 3 },{v 1,v 2 },{v 2,v 3 },{v 2,v 4 },{v 3,v 4 }}, {3,5,5,4,6,1}, v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 3,v 2 }  Σ*

Shortest Path v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 1 },{v 0,v 3 },{v 1,v 2 },{v 2,v 3 },{v 2,v 4 },{v 3,v 4 }}, {3,5,5,4,6,1}, v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 1,v 2 }  Σ*

Shortest Path v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 1 },{v 0,v 3 },{v 1,v 2 },{v 2,v 3 },{v 2,v 4 },{v 3,v 4 }}, {3,5,5,4,6,1}, v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 1,v 2 }  Π

Shortest Path v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 1 },{v 0,v 3 },{v 1,v 2 },{v 2,v 3 },{v 2,v 4 },{v 3,v 4 }}, {3,5,5,4,6,1}, v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 3,v 4 }  Π Given graph G and path P, is P a shortest path in G?

Hamiltonian Circuit v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v Circuit consisting of all vertices

Hamiltonian Graph v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v Has a Hamiltonian Circuit ✔

Hamiltonian Graph v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v Has a Hamiltonian Circuit ✖ Given graph G, is the graph Hamiltonian?

Hamiltonian Graph v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 3 },{v 1,v 3 },{v 2,v 1 },{v 3,v 0 },{v 3,v 4 },{v 4,v 2 }},  Σ*

Hamiltonian Graph v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 3 },{v 1,v 0 },{v 2,v 1 },{v 3,v 0 },{v 3,v 4 },{v 4,v 2 }},  Σ* v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v

Hamiltonian Graph v 0,v 1,v 2 … v n  Σ {  Σ 0,1,2, … N  Σ }  Σ,  Σ {v 0,v 1,v 2,v 3,v 4,v 5 }, {{v 0,v 3 },{v 1,v 0 },{v 2,v 1 },{v 3,v 0 },{v 3,v 4 },{v 4,v 2 }},  Π v1v1 v1v1 v0v0 v0v0 v2v2 v2v2 v3v3 v3v3 v4v4 v4v

Preliminaries P, NP, and NP-Complete Problems Outline

P Polynomial-time solvable problem Π –There exists a polynomial-time algorithm that decides whether x  Σ* belongs to Π or not. –Polynomial in size(x) P = {all Π, Π is polynomial time solvable} For example –Shortest path with +ve lengths  P –Shortest path with no –ve length circuit  P

NP Π  NP –There exists a problem Π’  P –There exists a polynomial p –There exists an x, size(x) ≤ p(size(w)) such that –w  Π if and only if wx  Π’ Polynomial-time checkable ‘certificate’ For example –Hamiltonian graph problem  NP

NP Relationship between P and NP? P is a subset of NP –“P = NP or not” is an open problem –One of Clay Institute’s Millennium Prize problems For example –Shortest path with +ve lengths  NP –Shortest path with no –ve length circuit  NP

NP-Complete Hardest problems in NP –All problems in NP can be reduced to an NP- complete problem Π is reducible to Λ –There exists a polynomial time algorithm –Given w, returns x –w  Π if and only if x  Λ If Λ  P then Π  P

NP-Complete Hardest problems in NP –All problems in NP can be reduced to an NP- complete problem Π is reducible to Λ –There exists a polynomial time algorithm –Given w, returns x –w  Π if and only if x  Λ If Λ  NP then Π  NP

NP-Complete Hardest problems in NP –All problems in NP can be reduced to an NP- complete problem Π is reducible to Λ –There exists a polynomial time algorithm –Given w, returns x –w  Π if and only if x  Λ If Λ  NP-complete and Λ  P, then P = NP