Hard Problems Some problems are hard to solve. No polynomial time algorithm is known Most combinatorial optimization problems are hard Popular NP-hard.

Slides:



Advertisements
Similar presentations
Applications of Inclusion-Exclusion: Selected Exercises.
Advertisements

Limitation of Computation Power – P, NP, and NP-complete
Section 3.4 The Traveling Salesperson Problem Tucker Applied Combinatorics By Aaron Desrochers and Ben Epstein.
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
CS6800 Advanced Theory of Computation
Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Shortest Paths Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 9.6 Based on slides from Chuck Allison, Michael T.
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.
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
9.2 The Traveling Salesman Problem. Let us return to the question of finding a cheapest possible cycle through all the given towns: We have n towns (points)
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Approximation Algorithms Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
Transitivity of  poly Theorem: Let ,  ’, and  ’’ be three decision problems such that   poly  ’ and  ’  poly  ’’. Then  poly  ’’. Proof:
The Theory of NP-Completeness
Ch 13 – Backtracking + Branch-and-Bound
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
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
CS 312: Algorithm Design & Analysis Lecture #34: Branch and Bound Design Options for Solving the TSP: Tight Bounds This work is licensed under a Creative.
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.
IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems.
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.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
DP TSP Have some numbering of the vertices We will think of all our tours as beginning and ending at 1 C(S, j) = length of shortest path visiting each.
1 Combinatorial Problem. 2 Graph Partition Undirected graph G=(V,E) V=V1  V2, V1  V2=  minimize the number of edges connect V1 and V2.
The Traveling Salesman Problem Over Seventy Years of Research, and a Million in Cash Presented by Vladimir Coxall.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 13 Backtracking Introduction The 3-coloring problem
Evolutionary Computing Chapter 1. / 20 Chapter 1: Problems to be solved Problems can be classified in different ways: Black box model Search problems.
Algorithms for hard problems Introduction Juris Viksna, 2015.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Genetic Algorithms and TSP Thomas Jefferson Computer Research Project by Karl Leswing.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Ch3 /Lecture #4 Brute Force and Exhaustive Search 1.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Approximation Algorithms
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
More NP-Complete and NP-hard Problems
Genetic Algorithms.
Weighted Graphs and traveling Salesperson problem
Hard Problems Some problems are hard to solve.
SAT problem SAT – Boolean satisfiability problem
EMIS 8373: Integer Programming
Lecture 2-2 NP Class.
Hard Problems Introduction to NP
Design and Analysis of Algorithm
Week 11 - Monday CS221.
Richard Anderson Lecture 28 Coping with NP-Completeness
Neural Networks Chapter 4
Approximation Algorithms
Applied Combinatorics, 4th Ed. Alan Tucker
3. Brute Force Selection sort Brute-Force string matching
3. Brute Force Selection sort Brute-Force string matching
Backtracking and Branch-and-Bound
The Theory of NP-Completeness
Hard Problems Some problems are hard to solve.
Approximation Algorithms
Lecture 24 Vertex Cover and Hamiltonian Cycle
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

Hard Problems Some problems are hard to solve. No polynomial time algorithm is known Most combinatorial optimization problems are hard Popular NP-hard problems: Traveling Salesman N-Queens Bin packing 0/1 knapsack Graph partitioning and many more ….

Traveling Salesperson Problem (TSP) Let G be a weighted directed graph. A tour in G is a cycle that includes every vertex of the graph. TSP => Find a tour of shortest length. Problem is NP-hard.

Applications Of TSP Home city Visit city

Applications Of TSP Each vertex represents a city that is in Joe’s sales district. The weight on edge (u,v) is the time it takes Joe to travel from city u to city v. Once a month, Joe leaves his home city, visits all cities in his district, and returns home. The total time he spends on this tour of his district is the travel time plus the time spent at the cities. To minimize total time, Joe must use a shortest- length tour.

Applications Of TSP Tennis practice. Start with a basket of approximately 200 tennis balls. When balls are depleted, we have 200 balls lying on and around the court. The balls are to be picked up by a robot (more realistically, the tennis player). The robot starts from its station visits each ball exactly once (i.e., picks up each ball) and returns to its station.

Applications Of TSP Robot Station

Applications Of TSP 201 vertex TSP. 200 tennis balls and robot station are the vertices. Complete directed graph. Length of an edge (u,v) is the distance between the two objects represented by vertices u and v. Shortest-length tour minimizes ball pick up time. Actually, we may want to minimize the sum of the time needed to compute a tour and the time spent picking up balls using the computed tour.

Applications Of TSP Manufacturing. A robot arm is used to drill n holes in a metal sheet. n+1 vertex TSP. Robot Station

n-Queens Problem A queen that is placed on an n x n chessboard, may attack any piece placed in the same column, row, or diagonal. 8x8 Chessboard

8 Queens Problem Place 8 queens on a 8x8 chessboard in such a way that the queens cannot check each other.

4-Queens Problem Can 4 queens be placed on an 4 x 4 chessboard so that no queen may attack another queen? 4x4

One possible solution for 8-Queens Problem 8x8

8 Queens - Representation Phenotype: a configuration Genotype: a permutation of the numbers 1 through 8

Difficult Problems Many require you to find either a subset or permutation that satisfies some constraints and (possibly also) optimizes some objective function. May be solved by organizing the solution space into a tree and systematically searching this tree for the answer.

Permutation Problems Solution requires you to find a permutation of n elements. The permutation must satisfy some constraints and possibly optimize some objective function. Examples. TSP. n-queens. Each queen must be placed in a different row and different column. Let queen i be the queen that is going to be placed in row i. Let c i be the column in which queen i is placed. c 1, c 2, c 3, …, c n is a permutation of [1,2,3, …, n] such that no two queens attack.

Solution Space Permutation problem. n = 2, {12, 21} n = 3, {123, 132, 213, 231, 312, 321} Solution space for a permutation problem has n! members. Nonsystematic search of the space for the answer takes O(pn!) time, where p is the time needed to evaluate a member of the solution space.

8 Queens - Operators Mutation: exchanging two numbers Crossover: combining two parents

8 Queens - Fitness & Selection Fitness: penalty of one queen is equal to the number of queens she can check. The fitness of the configuration is equals the sum of the penalties of all queens. Selection: using a roulette wheel fitness(C 1 ) = 1 fitness(C 2 ) = 2 fitness(C 3 ) = 3 C1C1 C2C2 C3C3 1/6 = 17 % 3/6 = 50 % 2/6 = 33 %