Weighted Matching-Algorithms, Hamiltonian Cycles and TSP

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Great Theoretical Ideas in Computer Science
Lectures on NP-hard problems and Approximation algorithms
Min-Max Relations, Hall’s Theorem, and Matching-Algorithms Graphs & Algorithms Lecture 5 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Connectivity - Menger’s Theorem Graphs & Algorithms Lecture 3.
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
Planar Graphs: Coloring and Drawing
C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Approximation Algorithms
Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Bipartite Matching, Extremal Problems, Matrix Tree Theorem.
Great Theoretical Ideas in Computer Science for Some.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
Combinatorial Algorithms
Lecture 21 Approximation Algorithms Introduction.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
Approximation Algorithms
1 Vertex Cover Problem Given a graph G=(V, E), find V' ⊆ V such that for each edge (u, v) ∈ E at least one of u and v belongs to V’ and |V’| is minimized.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Approximation Algorithms
Outline Introduction The hardness result The approximation algorithm.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
C&O 355 Mathematical Programming Fall 2010 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Approximation Algorithms
Approximation Algorithms
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.
1 Approximation algorithms Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij TexPoint fonts used in EMF. Read the TexPoint manual.
Algorithms for hard problems Introduction Juris Viksna, 2015.
CSC 413/513: Intro to Algorithms
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Kernel Bounds for Path and Cycle Problems Bart M. P. Jansen Joint work with Hans L. Bodlaender & Stefan Kratsch September 8 th 2011, Saarbrucken.
Approximation Algorithms Greedy Strategies. I hear, I forget. I learn, I remember. I do, I understand! 2 Max and Min  min f is equivalent to max –f.
Approximation algorithms
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Design and Analysis of Approximation Algorithms
More NP-complete problems
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Lecture 2-2 NP Class.
An introduction to Approximation Algorithms Presented By Iman Sadeghi
Richard Anderson Lecture 26 NP-Completeness
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Great Theoretical Ideas in Computer Science
Chapter 5. Optimal Matchings
Computability and Complexity
Parameterised Complexity
Homework solution Problem 2. The number of odd degree vertices in a graph is even. (recom. book: G. Harary: Graph Theory) Solution: Let G=(V,E,w) S=vVdeg(v)
Analysis of Algorithms
Richard Anderson Lecture 28 Coping with NP-Completeness
Approximation Algorithms
Problem Solving 4.
No Guarantee Unless P equals NP
The Complexity of Approximation
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

Weighted Matching-Algorithms, Hamiltonian Cycles and TSP Graphs & Algorithms Lecture 6 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAAAA

Weighted bipartite matching Given: Kn, n (complete bipartite graph on 2n vertices) n £ n weight matrix with entries wi, j ¸ 0 Want: perfect matching M maximizing the total weight Weighted cover (u, v): choice of vertex labels u = u1,…,un and v = v1,…,vn , u, v 2 Rn such that, for all 1 · i, j · n, we have ui + vj ¸ wi, j . Cost c(u, v) := i ui + vi .

Duality: max. weighted matching and min. weighted vertex cover For any matching M and weighted cover (u, v) of a weighted bipartite graph, we have w(M) · c(u, v) . Also, w(M) = c(u, v) if and only if M consists of edges {i, j} such that ui + vj = wi, j. In this case, M and (u, v) are optimal. Equality subgraph Gu, v of a fixed cover (u, v): spanning subgraph of Kn, n , {i, j} 2 E(Gu, v) , ui + vj = wi, j . Idea: a perfect matching of Gu, v corresponds to a maximum weighted matching of Kn, n.

Hungarian Algorithm Kuhn (1955), Munkres (1957)

Correctness of the Hungarian Method Theorem The Hungarian Algorithm finds a maximum weight matching and a minimum cost cover. Proof The statement is true if the algorithm terminates. Loop invariant: consider (u, v) before and (u', v') after the while loop (u, v) is cover of G ) (u', v') is a cover of G c(u, v) ¸ c(u', v') +  ¸ w(M) For rational weights,  is bounded from below by an absolute constant. In the presence of irrational weights, a more careful selection of the minimum vertex cover is necessary.

Hamiltonian Cycles A graph on n vertices is Hamiltonian if it contains a simple cycle of length n. The Hamiltonian-cycle problem is NP-complete (reduction to the vertex-cover problem). The naïve algorithm has running time (n!) = (2n). What are sufficient conditions for Hamiltonian graphs? Theorem (Dirac 1952) Every graph with n ¸ 3 vertices and minimum degree at least n/2 has a Hamiltonian cycle.

Proof of Dirac’s Theorem (Pósa) Suppose G is a graph with (G)  n/2 that contains no Hamiltonian cycle. Insert as many edges into G as possible  Embedding of G into a saturated graph G’ that contains a Hamilton path Neighbourhood (x1) yields n/2 forbidden neighbours for xn in {x1, …, xn – 2}. Since xn cannot connect to itself, there is not enough space for all of its n/2 neighbours. x1 x2 xn xi-1 xi x3 Theorem of Chvatal?

Weaker degree conditions Let G be a graph on n vertices with degrees d1 · … · dn. (d1, …, dn) is called the degree sequence An integer sequence (a1, …, an) is Hamiltonian if every graph on n vertices with a pointwise greater degree sequence (d1, …, dn) is Hamiltonian. Theorem (Chvátal 1972) An integer sequence (a1, …, an) such that 0 · a1 · … · an < n and n ¸ 3 is Hamiltonian iff, for all i < n/2, we have: ai · i ) an – i ¸ n – i.

Traveling Salesman Problem (TSP) Given n cities and costs c(i, j) ¸ 0 for going from city i to city j (and vice versa). Find a Hamiltonian cycle H*of minimum cost c(H*) = e 2 E(H*) c(e) . Existence of a Hamiltonian cycle is a special case. Brute force: n! = (nn + 1/2 e-n) time complexity Better solutions: polynomial time approximation algorithm for TSP with triangle inequality approximation ratio 2 optimal solution with running time O(n22n)

Approximation algorithms Consider a minimization problem. An algorithm ALG achieves approximation ratio (n) ¸ 1 if, for every problem instance P of size n, we have ALG(P) / OPT(P) · (n) , where OPT(P) is the optimal value of P. An approximation scheme takes one additional parameter  and achieves approximation ratio (1 + ) on every problem instance. A polynomial time approximation (PTAS) scheme runs in polynomial time for every fixed  ¸ 0. The running time of a fully polynomial time approximation scheme (FPTAS) is also polynomial in -1.

2-approximation algorithm for TSP Running time Prim's algorithm with Fibonacci heaps: O(E + V logV) Kruskal's algorithm: O(E logV)

An optimal TSP algorithm For each S µ {2,…,n} and k 2 S, define P(S, k) ´ "minimum cost of a Hamiltonian path on S starting in 1 and ending in k" Let V = {1,…,n} and positive costs c(i, j) be given. TSP = min{P(Vn{1}, k) + c(k, 1) : k 2 Vn{1}} Recursive computation of P(S, k) : P({k}, k) = c(1, k) P(S, k) = min{P(Sn{k}, j) + c(j, k) : j 2 Sn{k}} Compute P(S, k) buttom-up (dynamic programming) Number of distinct P(S, k) values is (n – 1)2n – 2 . Each time at most n operations are necessary.

Example Put on an extra slide

More positive and negative results on TSP Slight modifications yield a 1.5-approximation algorithm for TSP with -inequality. (Exercise) Arora (1996) gave a PTAS for Euclidean TSP with running time nO(1/) . For general TSP, there exists no polynomial time approximation algorithm with any constant approximation ratio  ¸ 1, unless P = NP. (Exercise)