Download presentation
Presentation is loading. Please wait.
1
Approximation Algorithms
2
Knapsack Problem Instance: Given a set of n items, each with a weight wi and a value vi and a capacity W, for the knapsack. Question: Determine the count of each item to include in a collection so that the total weight is less than or equal to a given capacity of he knapsack. Computational Complexity: NP-Hard (meaning, there is no known polynomial time algorithm that can solve this and there is know algorithm that can solve this Non- deterministically in polynomial time.)
3
Approximation Algorithm for Knapsack
Sort all items in value/weight order While sack has room Load as many of the most value/weight in Guarantee to fill up at lease W/2
4
Clique, Independent Set, Vertex Cover
Problem: Vertex Cover Instance: Given a graph G=(V,E) and a number k V. Question: Does the graph have a vertex cover of size k or less? That is, is there a subset of vertices in V such that for all (u,v) in E, at least 1 of the endpoints u or v will be in the vertex cover set of vertices. Problem: Clique Instance: A graph G=(V,E) and a positive integer k |V| Question: Does G contain a subset V’ V such that every 2 vertices in V’ are joined by an edge in E and |V’| > k Problem: Independent Set Question: Does G contain a subset V’ V such that for all (u,v) V’, the edge (u,v) does not exist in E.
5
VC, IS and Clique Equivalence
For any graph G=(V,E) and subset V’ V, the following statements are equivalent V’ is a vertex cover of G V – V’ is an independent set of G V – V’ is a clique in the compliment graph Gc of G. Consequently, inputs of the three problems, Vertex Cover, Independent Set and Clique can all be converted to each other in polynomial time. Since answers to each can be checked in poly-time, these problems are all NP-complete.
6
Approximation Algorithm for VC
APPROX-VERTEX-COVER C E’ E[G] While E’ Let (u,v) be an arbitrary edge of E’ C C {u,v} Remove from E’ every edge incident on either u or v Return C This algorithm runs O(E) using an appropriate data structure for E APPROX-VC has a ratio bond of 2
7
Approximation Algorithm for Clique
Approx-max-clique(G) Compute Gc (compliment of G) V’ = approx-min-vertex-cover(Gc) V-V’ is the max clique
8
Traveling Salesman Problem
Problem: Traveling Salesman Instance: Given a list of cities and their pairwise distances. Question: Find a shortest possible tour that visits each city exactly once? Computational Complexity: NP-Hard (meaning, there is no known polynomial time algorithm that can solve this and there is know algorithm that can solve this Non- deterministically in polynomial time.)
9
Approximation Algorithm for TSP
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.