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)

Slides:



Advertisements
Similar presentations
Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Advertisements

Great Theoretical Ideas in Computer Science
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.
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
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Great Theoretical Ideas in Computer Science.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Vertex Cover, Dominating set, Clique, Independent set
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
Drawing of G. Planar Embedding of G Proposition Proof. 1. Consider a drawing of K 5 or K 3,3 in the plane. Let C be a spanning cycle. 2. If the.
An introduction to Approximation Algorithms Presented By Iman Sadeghi.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
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= 
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
The Traveling Salesman Problem Approximation
NP-Completeness: 3D Matching
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Design Techniques for Approximation Algorithms and Approximation Classes.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Approximation Algorithms
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
Chapter 2 Greedy Strategy I. Independent System Ding-Zhu Du.
Data Structures & Algorithms Graphs
1/24 Introduction to Graphs. 2/24 Graph Definition Graph : consists of vertices and edges. Each edge must start and end at a vertex. Graph G = (V, E)
Projects Network Theory VLSI PSM 1. Network 1. Steiner trees
Lecture.6. Table of Contents Lp –rounding Dual Fitting LP-Duality.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Steiner Tree Problem Given: A set S of points in the plane = terminals
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
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.
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
Matching in bipartite graphs Given: non-weighted bipartite graph not covered node extending alternating path initial matching Algorithm: so-called “extending.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Trees.
Approximation algorithms
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
The Theory of NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
An introduction to Approximation Algorithms Presented By Iman Sadeghi
Approximation Algorithms
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Graph theory Definitions Trees, cycles, directed graphs.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Great Theoretical Ideas in Computer Science
Vertex Cover, Dominating set, Clique, Independent set
Approximation Algorithms
Computability and Complexity
Approximation Algorithms for TSP
Discrete Mathematics for Computer Science
Linear Programming and Approximation
Approximation Algorithms
Linear Programming Duality, Reductions, and Bipartite Matching
Problem Solving 4.
Exercices series 6 Approximation : constant ratio
5.4 T-joins and Postman Problems
CS154, Lecture 16: More NP-Complete Problems; PCPs
Dominating Set By Eric Wengert.
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

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) = 2, =|E| Let S=S1+S0 , where S1= v odd deg(v) S0= v even deg(v) S is even, S0 is even (sum of even numbers)  S1 is even. Since S1 is a sum of odd numbers, it has to be an even numbers of odd degree vertices in G.

Homework solution Problem 1. Graph G is Eulerian  D(G) is bipartite. Solution: definitions: Face of a planar graph = cycle without “diagonals” Given: graph G=(V,E) with the set of faces F. G’ is dual to G if G’=(F’,E’) s.t. for any face fF there is a vertex f’F’ of graph G’, for any edge eE there is an edge e’E’ (1-1 correspondence) such that if ef1, f2, then e’=(f1’,f2’). 1st face (cycle goes counterclockwise) 2nd face (cycle goes clockwise)

Homework solution Problem 1. F2 F1 Each face is even in D(G) Each node is even in G  then each cycle is even F1+F2=F1F2 \ F1 F2 make a “characteristic vector”: e1 e2 ... ei ... e10 (0 0 1 0) C1 (01100100) C2 (01001000)

Homework solution Problem 1. F1 (0001110001) F2 (1111000000) C=(1110110001) if our face is even  then every cycle is even Bipartite graph Theorem: Graph G is bipartite iff G does not have odd cycles.  Graph will not have odd cycles because the dual is Eulerian.

Planar bipartite graph Theorem: Graph G is bipartite  G does not have odd cycles. Problem (The T-join problem): Given a planar, not bipartite, graph G = (V,E). Find the set H with the minimum number of edges such that G’= (V, E \ H) is bipartite. Solution: Construct the dual graph D(G). G not bipartite  D(G) is not Eulerian  D(G) has at least 2 odd-degree vertices. Take 1 edge from the odd degree vertex, then delete the corresponding edge in the original graph.

Planar bipartite graph Solution: we are deleting edges in D(G) to get Eulerian graph. D(G) Eulerin  G bipartite. Any solution consists of paths in G matching odd-degree vertices. We need to find minimum size such paths that match odd-degree vertices. All solutions=paths matching odd nodes

The T-join Problem How to delete minimum-cost set of edges from graph G to eliminate odd cycles? Construct geometric dual graph D=dual(G) Find odd-degree vertices T in D Solve the T-join problem in D: find min-weight edge set J in D such that all T-vertices have odd degree all other vertices have even degree Solution J corresponds to desired min-cost edge set in graph G

Optimal Odd Cycle Elimination conflict graph G dual graph D T-join odd degree nodes in D

T-join Problem in Sparse Graphs Reduction to matching construct a complete graph T(G) vertices = T-vertices edge costs = shortest-path cost find minimum-cost perfect matching Typical example = sparse (not always planar) graph note that conflict graphs are sparse #vertices = 1,000,000 #edges  5  #vertices # T-vertices  10% of #vertices = 100,000 Drawback: finding all shortest paths too slow and memory-consuming #vertices = 100,000 ® #edges = 5,000,000,000

Planar graphs-Eulerian formula Given: G planar V- number of nodes E- number of edges F- number of faces Then: Eulerian formula V-E+F=2 4-6+4=2

Planar graphs Given: G planar Then: E  3V-6 (# of edges is of the same order as # of vertices, E=O(V) ) Proof: Eulerian formula  V-E+F=2 In maximal planar graph each face is a triangle (triangulation) -each edge incident with 2 faces, we count each edge twice  3/2 F = E 3F=2E  F=2/3 E V-E+2/3 E=2  1/3 E = V-2 (for max. graph)  in any graph: E  3V-6

The Set Cover Problem Sets Ai cover a set X if X is a union of Ai Weighted Set Cover Problem Given: A finite set X (the ground set X) A family F of subsets of X, with weights w: F  + Find: sets S  F, such that S covers X, X = {s | s  S} and S has the minimum total weight  {w(s) | s  S} If w(s) =1 (unweighted), then minimum # of sets

Greedy Algorithm for SCP 1 2 6 3 4 5 Greedy Algorithm: While X is not empty find s  F minimizing w(s) / |s  X| X = X - s C = C + s Return C

Analysis of Greedy Algorithm for SCP Theorem: APR of the Greedy Algorithm is at most 1+ln k Proof:

Analysis of Greedy Algorithm for SCP Theorem: SCP cannot be approximated in polynomial time for any c<1 up to cln k, k=|X|  [ NP-hard to approx. SCP with approx. ratio (1-) ln K for any  >0 ]  Greedy algorithm is the best for this problem. We will prove: Theorem: Greedy Opt Let Si=| Si  X| 1/ S1 Opt/|X| X1=|X| X2=|X\S1| X3=|X\S1\S2|  1+ ln |X|

Analysis of Greedy Algorithm for SCP 1/ S2 Opt/|X2|  1/ Si  Opt/|Xi| (1) Xi=Xi-1-Si-1 (1)  Si  Xi/Opt  Xi  Xi-1- Xi-1/Opt= Xi-1(1-1/Opt) Xi  Xi-1(1-1/Opt) Xlast  Xlast-1 (1-1/Opt)  Xi-1/ Xi  (1-1/Opt)-1 X1 / X2  (1-1/Opt)-1 X2 / X3  (1-1/Opt)-1  Xlast-1 / Xlast  (1-1/Opt)-1

Analysis of Greedy Algorithm for SCP By multiplying all these terms, we get: X1 / Xlast  (1-1/Opt)-(last-1) / take a logarithm ln X1 / Xlast  (-last+1) ln ((1-1/Opt) Now we use the inequality: ln(1+x)  x  ln X1 / Xlast  (-last+1)(-1/Opt)=1/Opt(last-1) y=x y=ln(1+x) y=ln x 1

Analysis of Greedy Algorithm for SCP We got: ln X / Xlast  1/Opt (last-1) last=|Greedy| Greedy-1 Opt   ln X/Xlast Xlast is at least 1