Data Structures and Algorithms

Similar documents
Data Structures in Java. Session 22 Instructor: Bert Huang

VIII. NP-completeness

Data Structures in Java

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

CSC 1700 Analysis of Algorithms: P and NP Problems

Design and Analysis of Algorithms

Analysis of Algorithms. Unit 5 - Intractable Problems

CMSC 441: Algorithms. NP Completeness

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

ECS122A Handout on NP-Completeness March 12, 2018

Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?

Data Structures and Algorithms

CS 350 Algorithms and Complexity

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

CS 350 Algorithms and Complexity

CS 583: Algorithms. NP Completeness Ch 34. Intractability

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

Graph Theory and Optimization Computational Complexity (in brief)

Topics in Complexity Theory

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

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

Instructor N.Sadagopan Scribe: P.Renjith. Lecture- Complexity Class- P and NP

Limitations of Algorithm Power

Algorithms Design & Analysis. Approximation Algorithm

Polynomial-time 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

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

Agenda. What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class

Hamiltonian Cycle. Zero Knowledge Proof

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

The Complexity Classes P and NP. Andreas Klappenecker [partially based on slides by Professor Welch]

SAT, Coloring, Hamiltonian Cycle, TSP

NP Complete Problems. COMP 215 Lecture 20

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

Algorithms and Data Structures Final Lesson

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

Circuits. CSE 373 Data Structures

NP Completeness and Approximation Algorithms

More on NP and Reductions

Tractable & Intractable Problems

ECS 120 Lesson 24 The Class N P, N P-complete Problems

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

Instructor N.Sadagopan Scribe: P.Renjith

Hamiltonian Graphs Graphs

Friday Four Square! Today at 4:15PM, Outside Gates

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

NP-Completeness. Subhash Suri. May 15, 2018

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

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

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

Complexity Theory Part II

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

CSC 421: Algorithm Design & Analysis. Spring 2018

CSE 326: Data Structures NP Completeness

Notes for Lecture 21

Lecture 24: How to become Famous with P and NP

Nondeterministic Polynomial Time

1. Introduction Recap

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

P, NP, NP-Complete. Ruth Anderson

Automata Theory CS Complexity Theory I: Polynomial Time

P,NP, NP-Hard and NP-Complete

Approximation Algorithms

CS/COE

P and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.

Combinatorial Optimization

Introduction to Computational Complexity

Graduate Algorithms CS F-21 NP & Approximation Algorithms

8.3 Hamiltonian Paths and Circuits

1.1 P, NP, and NP-complete

Lecture 4: NP and computational intractability

Quantum Complexity Theory. Wim van Dam HP Labs MSRI UC Berkeley SQUINT 3 June 16, 2003

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

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

Bounds on the Traveling Salesman Problem

Computational Complexity

Complexity - Introduction + Complexity classes

Problems, and How Computer Scientists Solve Them Manas Thakur

Spring Lecture 21 NP-Complete Problems

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

M is a TM with start state s defined over the alphabet {#,(,),0,1,a,q,,}:

Principles of Computing, Carnegie Mellon University. The Limits of Computing

CS S-23 NP-Completeness and Undecidablity 1

Algorithm Design Strategies V

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Introduction. Pvs.NPExample

Class Note #20. In today s class, the following four concepts were introduced: decision

P and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides

Lecture 27: Theory of Computation. Marvin Zhang 08/08/2016

NP-completeness. Chapter 34. Sergey Bereg

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

NP-Complete Problems and Approximation Algorithms

Lecture 15 - NP Completeness 1

Mathematical Thinking Exam 2 20 November 2017

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

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

Computational Complexity

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

Warm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once.

Transcription:

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 Course topic order changed. After today: Disjoint Sets, Sorting

Review Minimum Spanning Tree Prim s Algorithm Kruskal s Algorithm Depth first search Euler Paths Hamiltonian Path/Cycle

Today s Plan High Level Introduction to Complexity Classes P, NP, NP-Complete, NP-hard, Undecidable Famous NP-Complete problems

Hamiltonian Cycle Now that we know how to find Euler circuits efficiently, can we find Hamiltonian Cycles? Hamiltonian cycle - path that visits each node once, starts and ends on same node Can we return true/false if a Hamiltonian Cycle exists?

Hamiltonian Cycle One easy necessary condition: every node must have at least 2 edges. Anything more specific? We can t splice cycles together like Euler Circuits, since we can t revisit a node We can t use the edge-graph because edges connect to multiple nodes, but not vice versa

Complexity Classes P - solvable in polynomial time NP - solvable in polynomial time by a nondeterministic computer i.e., you can check a solution in polynomial time NP-complete - a problem in NP such that any problem in NP is polynomially reducible to it Undecidable - no algorithm can solve the problem

Probable Complexity Class Hierarchy P NP NP-Complete NP-Hard Undecidable

Polynomial Time P All the algorithms we cover in class are solvable in polynomial time An algorithm that runs in polynomial time is considered efficient A problem solvable in polynomial time is considered tractable

Nondeterministic Polynomial Time NP Consider a magical nondeterministic computer infinitely parallel computer Equivalently, to solve any problem, check every possible solution in parallel return one that passes the check

NP-Complete Special class of NP problems that can be used to solve any other NP problem Hamiltonian Path, Satisfiability, Graph Coloring etc. NP-Complete problems can be reduced to other NP-Complete problems: polynomial time algorithm to convert the input and output of algorithms

NP-Hard A problem is NP-Hard if it is at least as complex as all NP-Complete problems NP-hard problems may not even be NP

Undecidable No algorithm can solve undecidable problems halting problem - given a computer program, determine if the computer program will finish Sketch of undecidability proof: Assume we have an algorithm that detects infinite loops Write program LOOP(P) that runs P on itself If P(P) halts, infinite loop, otherwise output

Halting Problem LOOP(P): If P(P) will halt: infinite loop If P(P) runs forever: output What happens if we call LOOP(LOOP)? LOOP(LOOP): If LOOP(LOOP) will halt: infinite loop If LOOP(LOOP) runs forever: output

P versus NP So far, nobody has proven a super-polynomial lower bound on any NP-Complete problems, nor has anyone found a polynomial time algorithm for an NP-complete problem Therefore no problem is proven to be in one class but not the other; it is unknown if P and NP are the same

Probable Complexity Class Hierarchy P NP NP-Complete NP-Hard Undecidable

Unlikely Complexity Class Hierarchy P NP NP-Complete NP-Hard Undecidable...but theoretically still possible as far as we know

NP-Complete Problems Satisfiability Given Boolean expression of N variables, can we set variables to make expression true? First NP-Complete proof because Cook s Theorem gave polynomial time procedure to convert any NP problem to a Boolean expression I.e., if we have efficient algorithm for Satisfiability, we can efficiently solve any NP problem

NP-Complete Problems Graph Coloring Given a graph is it possible to color with k colors all nodes so no adjacent nodes are the same color? Coloring countries on a map Sudoku is a form of this problem. All squares in a row, column and blocks are connected. k = 9

NP-Complete Problems Hamiltonian Path Given a graph with N nodes, is there a path that visits each node exactly once?

NP-Hard Problems Traveling Salesman Closely related to Hamiltonian Path problem Given complete graph G, find a path that visits all nodes that costs less than some constant k If we are able to solve TSP, we can find a Hamiltonian Path; set connected edge weight to constant, disconnected to infinity TSP is NP-hard

http://www.tsp.gatech.edu/gallery/itours/usa13509.html

Reading Weiss 9.7 http://www.tsp.gatech.edu/ Weiss Chapter 8 Disjoint Set ADT (Next class)