# Approximation Algorithms - PowerPoint PPT Presentation

PPT – Approximation Algorithms PowerPoint presentation | free to download - id: 66d3b2-ZjE1N

The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
Title:

## Approximation Algorithms

Description:

### 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 the language ... – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 22
Provided by: Isabelle128
Category:
Tags:
Transcript and Presenter's Notes

Title: Approximation Algorithms

1
Approximation Algorithms
• Lecture for CS 302

2
What is a NP problem?
• Given an instance of the problem, V, and a
certificate, C, we can verify V is in the
language in polynomial time
• All problems in P are NP problems
• Why?

3
VERTEX-COVER
• Given a graph, G, return the smallest set of
vertices such that all edges have an end point in
the set

4
HAMILTONIAN PATH
• Given a graph, G, find a path that visits every
vertex exactly once
• Alt version Find the path with the minimum weight

5
What is NP-Complete?
• A problem is NP-Complete if
• It is in NP
• Every other NP problem has a polynomial time
reduction to this problem
• NP-Complete problems
• 3-SAT
• VERTEX-COVER
• CLIQUE
• HAMILTONIAN-PATH (HAMPATH)

6
Applications
7
Applications
• SAT is used to verify circuit design
• NEED MORE EXAMPLES. WANT PICTURES

8
Dilemma
• NP problems need solutions in real-life
• We only know exponential algorithms
• What do we do?

9
Accuracy
• NP problems are often optimization problems
• Its hard to find the EXACT answer
• Maybe we just want to know our answer is close to

10
Approximation Algorithms
• Can be created for optimization problems
• The exact answer for an instance is OPT
• The approximate answer will never be far from OPT
• We CANNOT approximate decision problems

11
k-approximation
• S is the approx. answer, OPT is optimal
• Maximization
• kOPT S OPT
• Minimization
• OPT S kOPT

12
Approximate Vertex-Cover
• Let S be the cover
• Pick an edge (u,v) in the graph
• Add its end-points u and v to S
• Remove any edge that neighbors u or v
• Repeat until there are no edges left

13
Approximate Vertex-Cover
• OPT must cover every edge so either u or v must
be in the cover gt OPT gt ½S
• gt 2OPT S
• We have a 2-approximation

14
Traveling Salesperson Problem
• Given a graph, find a minimum weight hamiltonian
path
• There is a 2-approximation based on MINIMUM
SPANNING TREES

15
Minimum Spanning Tree
• Given a graph, G, a Spanning Tree of G is a
subgraph with no cycles that connects every
vertex together
• A MST is a Spanning Tree with minimal weight

16
Finding a MST
• Finding a MST can be done in polynomial time
using PRIMS ALGORITHM or KRUSKALS ALGORITHM
• Both are greedy algorithms
• Details can be found on Wikipedia

17
MST vs HAMPATH
• Any HAMPATH becomes a Spanning Tree by removing
an edge
• cost(MST) cost(min-HAMPATH)

18
Approximate TSP
• Given a complete graph G
• Compute Gs MST, M
• The tour is the pre-order traversal of M
• This is a 2-approximation

19
Approximating 3-SAT
• f is a Boolean formula in 3-CNF form if
• Whats the optimization version of 3-SAT?
• Satisfy as many clauses as you can

20
Approximating 3-SAT
• Algorithm
• For each variable xi assign True with probability
½, False with probability ½
• This satisfies 7/8ths of the clauses in
expectation

21
Approximating 3-SAT
x1 x2 x3
T T T T
T T T F
T T F T
T T F F
T F T T
T F T F
T F F T
F F F F
The only way we dont satisfy the clause is if we
select the last assignment. This happens only
1/8th of the time.