Professional Documents
Culture Documents
Design and Analysis of Algorithms
Design and Analysis of Algorithms
Design and Analysis of Algorithms
Algorithms
6.046
Lecture 18
Approximation Algorithms II
Prof. Piotr Indyk
Approximation algorithms
• Compute MST T
– An edge between any pair of points
– Weight = distance between endpoints
• Compute a tree-walk W of T
– Each edge visited twice
• Convert W into a cycle C using
shortcuts
2-approximation: Proof
• Notation:
– COPT = optimal cycle
– T = MST
– W = tree walk of T
• Observe that:
– Cost(T) ≤ Cost(COPT )
• Removing an edge from COPT gives a spanning tree; T is a
spanning tree of minimum cost
– Cost(W) = 2 Cost(T)
• Each edge visited twice
– Cost(C) ≤ Cost(W)
• Triangle inequality
Þ Cost(C) ≤ 2 Cost(COPT )
Better approximation?
• Compute MST T
• Let O be the set of odd
degrees in T
• Compute min-cost
matching M of vertices in O
– O has even size, details next slide
• Compute the Euler tour W
of T+ M
• Convert W into a cycle C
using shortcuts, as before
Matching
• Claim: The size of O is even
• Proof:
– The sum of vertex degrees in any graph
is even (hand-shaking lemma)
– If |O| was odd, then the sum of the
degrees in T would be odd –
contradiction
• Thus, vertices in O can be matched
• Minimum matching can be found in
polynomial time (Edmonds’65)
Approximation factor
• Notation:
– COPT = optimal cycle
– T = MST
– O = odd vertices in T
– M = min cost matching of O
– W = Euler tour of T+M
• Claim: Cost(M) ≤ Cost(COPT )/2
• Proof:
– Let Codd be the min cost tour on the odd vertices O
only. We have cost(Codd) ≤ cost(COPT)
– Odd edges on Codd form a matching and even edges
on Codd form a matching
– One of them has cost ≤ Cost(COPT )/2
• Thus Cost(W) ≤ Cost(T)+Cost(M)
≤ 3/2 Cost(COPT )
• Shortcutting can only decrease the cost
Maximum Cardinality
Matching
On input G=(V,E)
• Set E ’ = E
• Set M=f
• While E ’ ¹ f (some edges not covered yet)
– Pick any edge (u,v) of E’
– Add (u,v) to M
– Remove from E’ every edge incident to either u or v
• Return M