1 TSP in line graphs 2-optimal Euler path problem.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Advanced Topics in Algorithms and Data Structures
Chapter 8 Topics in Graph Theory
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
O(N 1.5 ) divide-and-conquer technique for Minimum Spanning Tree problem Step 1: Divide the graph into  N sub-graph by clustering. Step 2: Solve each.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Graph-02.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Combinatorial Algorithms
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
1 Minimum Spanning Trees Definition of MST Generic MST algorithm Kruskal's algorithm Prim's algorithm.
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.
A traveling salesman has customers in 5 cities which we will call A, B, C, D, and E. The salesman needs to travel to all 5 cities with his trip starting.
NP-Complete Problems (Fun part)
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
Two Discrete Optimization Problems Problem #2: The Minimum Cost Spanning Tree Problem.
Steiner trees Algorithms and Networks. Steiner Trees2 Today Steiner trees: what and why? NP-completeness Approximation algorithms Preprocessing.
Graphs Chapter 20 Data Structures and Problem Solving with C++: Walls and Mirrors, Frank Carrano, © 2012.
Packing Element-Disjoint Steiner Trees Mohammad R. Salavatipour Department of Computing Science University of Alberta Joint with Joseph Cheriyan Department.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
The Traveling Salesman Problem Approximation
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Chapter 2 Graph Algorithms.
Graph Theory Topics to be covered:
There is a Postman who delivers mail to a certain neighborhood of streets. The postman is unwilling to walk far so he wants to find the shortest route.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
6.1 Hamilton Circuits and Paths: Hamilton Circuits and Paths: Hamilton Path: Travels to each vertex once and only once… Hamilton Path: Travels to each.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
1 CS104 : Discrete Structures Chapter V Graph Theory.
CS 200 Algorithms and Data Structures
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Data Structures & Algorithms Graphs
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
1.5 Graph Theory. Graph Theory The Branch of mathematics in which graphs and networks are used to solve problems.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
Lecture 10: Graph-Path-Circuit
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Graphs and MSTs Sections 1.4 and 9.1. Partial-Order Relations Everybody is not related to everybody. Examples? Direct road connections between locations.
Homework #5 Due: October 31, 2000 Christine Kang Graph Concepts and Algorithms.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
1) Find and label the degree of each vertex in the graph.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Spanning Tree Definition:A tree T is a spanning tree of a graph G if T is a subgraph of G that contains all of the vertices of G. A graph may have more.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Challenging Problem 2: Challenging problem 2 will be given on the website (week 4) at 9:30 am on Saturday (Oct 1, 2005). 2. The due time is Sunday (Oct.
CS120 Graphs.
Discrete Math: Hamilton Circuits
Graph Algorithm.
Minimum Spanning Trees
Connected Components Minimum Spanning Tree
2-optimal Euler path problem Euler circuit in a directed graph:
5.4 T-joins and Postman Problems
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
2-optimal Euler path problem
Presentation transcript:

1 TSP in line graphs 2-optimal Euler path problem

2 Euler circuit in a directed graph: An Euler circuit in a directed graph is a directed circuit that visits every edge in G exactly once. v1 v2 v3 v6 v5 v4 Figure 1 a b c d e f g

3 Theorem 2: If all the vertices of a connected graph have equal in- degrees and out-degrees, then the graph has an Euler circuit.

4 2-path: A 2-path is a directed subgraph consisting of two consecutive edges. For example: v is called the midpoint. Every 2-path is given a cost (positive number) A Euler circuit of m edges contains m 2-paths,and the cost of the Euler circuit is the total weight of the m 2-paths. uvw

5 2-optimal Euler circuit problem: Instance: A directed graph, each of its vertices has in- degree 2 and out-degree 2 and 2-path has a cost. Question:Find an Euler circuit with the smallest cost among all possible Euler circuits.

6 Line graph: If we view each edge in the above graph G(Figure 1) as a vertex,and each 2-path in the above graph as an edge,we get another graph L(G), called line graph. a c b g d f e Figure 2

7 Continue: Observation: An Euler circuit in graph G corresponds to a Hamilton circuit in graph L(G). 2-optimal Euler path problem becomes a TSP problem in line graph.

8 Theorem 3: TSP in line graph with in-degree 2 and out-degree 2 can be solved in polynomial time. (TSP in general is NP-complete)

9 Facts: For each node in G,there are four 2-paths that form 2 pairs of 2-paths. In an Euler circuit,one of the pairs is used. A pair of 2-path for v is good if the total cost of this pair of 2-paths is not less than that of the other pair.

10 Algorithm: For each node v in G, fixed the good pair of 2-path for v. (This leads to a set of edge disjoint circles H.) Contract each circle C i in H into a single node n i.There is an edge(undirected) between n i and n j if C i and C j have a common vertex,say,v. The weight on edge (n i,n j ) is w(e1)+w(e2)-w(e3)-w(e4) where e1 and e2 forms a bad pair for v,and e3 and e4 forms a good pair for v.Call H’ be the resulting undirected graph. Construct a minimum spanning tree H’ Construct an Euler circuit for G by merging circles based on the minimum spanning tree obtained in Step3.

11 Example: Suppose that the directed Euler graph G is Given in Figure 3(next page).There are 5 cycles.The 2-paths in circles have cost 1 and the costs on other 2-paths are listed below: w(a,e)=2,w(h,b)=2; w(f,i)=3,w(l,g)=3; w(g,t)=2,w(s,h)=11; w(k,m)=1,w(p,l)=2; w(t,o)=2,w(n,q)=3.

12 Figure 3 a c d bh g e f l k j i p o m n t q r s

13 Step1: we get 5 circles shown below: a c d b h g e f l k j i p o m n t q r s

14 Step2: the undirected graph constructed is: a,b,c,d e,f,g,h i,j,k,l m,n,o,p q,r,s,t

15 Step3: the minimum spanning tree for the above tree is as follows:

16 Step4: The 2-optimal Euler path is shown below: a c d b h g e f l k j i p o m n t q r s

17 Theorem 4: The above algorithm is correct. Proof: The total cost of the 2-paths obtained in Step1 is not greater than that of the optimal solution. To obtain an Euler circuit, we have to merge the k circles obtained in Step1.(needs (k-1) merge operations) These (k-1) merge operations correspond to (k-1) edges in the undirected graph.(In fact, a spanning tree) The final cost is the cost of all the 2-paths obtained in Step1 + the cost of the (minimum) spanning tree. Since we use a minimum spanning tree, the cost of our solution is the smallest.

18