Академический Документы
Профессиональный Документы
Культура Документы
Lekshmi Krishna M.R 100609|Mtech-Technology Management Department of Futures Studies University of Kerala
Contents
2
Introduction Euler Graphs Theorems, Proof & Algorithms Hamiltonian Graphs Traveling Sales Man problems Conclusion
Department of Futures Studies
Introduction
3
Configurations of nodes & connections occur in great diversity of applications Such configurations are modeled by combinatorial structures called Graphs Consist of edges ,vertices & incidence relation between them E.g. : Electrical circuits, road ways, organic molecules etc
Department of Futures Studies
Euler Graphs
4
An Eulerian trail in a graph is a trail that contains every edge of that graph An Eulerian tour is a closed Eulerian trail A graph that has an Euler tour (Circuit) is called an Eulerian graph
Euler's Theorem 1
5
A graph G contains an Eulerian circuit if and only if the degree of each vertex is even.
Proof
6
Suppose G contains an Eulerian circuit C. Then, for any choice of vertex v, C contains all the edges that are adjacent to v. Furthermore, as we traverse along C, we must enter and leave v the same number of times, and it follows that deg(v) must be even.
Example
7
1 1 2 5
3 3 4
Here all nodes are of degree 2(even degree) 1-2-3-1 Forms Euler graph
Proof of Sufficiency
8
We prove by induction on the number of edges. For graphs with all vertices of even degree, the smallest possible number of edges is 3 (i.e. a triangle) in the case of simple graphs. In both cases, the graph trivially contains an Eulerian circuit. The Induction hypothesis then says: Let H be a connected graph with k edges. If every vertex of H has even degree, H contains an Eulerian circuit
Department of Futures Studies
1) Handshaking Lemma - Every graph has even number of odd degree vertices.
Proof
10
deg (u)
In this sum, every edge (a,b) in the graph gets counted twice: Once for a & once for b . Therefore S = 2m is an even number. Now let Vodd (Veven) denote the subset of V that consists only of odd(even respectively) degree vertices. Since S = u v deg (u) = u v even deg (v) + u v odd deg (w); the number w v odd deg (w) must be even Thus we can say that |Vodd| must be even
11
2) Theorem 2. A graph contains an Eulerian path if and only if there are 0 or 2 odd degree vertices
Proof
12
Suppose a graph G contains an Eulerian path P. Then, for every vertex v, P must enter and leave v the same number of times, except when it is either the starting vertex or the final vertex of P. When the starting and final vertices are distinct, there are precisely 2 odd degree vertices. When these two vertices coincide, there is no odd degree vertex.
Let D = (V;A) be a directed graph. Then D contains an Eulerian circuit if and only if, for every vertex u 2 V , indeg(u) = outdeg(v). Furthermore, D contains an Eulerian path if and only if, there exists two vertices s and t such that: outdeg(s) = indeg(s) + 1 indeg(t) = outdeg(t) + 1 indeg(v) = outdeg(v)
Department of Futures Studies
Example:
14
B S T C
B S T C
Some facts.
15
Euler's Theorems are examples of Existence theorems Existence theorems tell whether or not something exists (e.g. Euler circuit) But doesn't tell us how to create it! We want a constructive method for finding Euler paths and circuits Methods (well-defined procedures, recipes) for construction are called algorithms An algorithm for constructing an Euler circuit: Fleury's algorithm
Department of Futures Studies
Fleury's algorithm
16
1. Check if the graph is connected, and every vertex is of even degree. Reject otherwise. 2. Pick any vertex v(start) to start. 3. While the graph contains at least one edge: (a) Pick an edge that is not a bridge. (b) Traverse that edge, and remove it from G.
Example:
17
Marked Graph
Reduced graph
Cont.
19
The rest of the trip is obvious, and the complete Euler circuit is: (F, C, D, A, C, E, A, B, D, F)
Department of Futures Studies
Hamiltonian Graph
20
A Hamiltonian path is a path in an undirected graph that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a cycle in an undirected graph which visits each vertex exactly once and also returns to the starting vertex. A graph that contains a Hamiltonian circuit is called a Hamiltonian graph.
Department of Futures Studies
Example:
21
1 1
2 1-2-3
Hamiltonian graph
22
Eulerian Trails & Tours Each edge be traversed at least once Postman problems Hamiltonian paths and Cycles Each vertex be traversed at least once Traveling Salesman problems
Involve vertex based conditions No simple characterization is known Problems are notoriously time consuming (NP hard)
As Graph Problem
26
Traveling salesman must travel to every city along the cheapest route But he cannot visit a city more than once and he must come back where he started
Modeled as undirected weighted graph Cities Vertices Path- Edges Path distance/cost = Edge length
Salesman wanted to travel 5 cities Want to reach back to the starting city Assumption : Possible to travel from one city to all the other cities Forms complete graph Cost of travel from one city to another is denoted by C Problem :To minimize the cost of travel ????
Department of Futures Studies
28
29
1-3-5-4-2-1 5-4-2-1-3-5
3
5-1-4-3-2-5 3-2-5-1-4-3
3
1
Department of Futures Studies
Cost of Travel
30
Z =
10 8 9 7
10 8 9 7 10 5 6 10 8 9 5 8 6 6 9 6
Cost of travel from a node to itself = 0 But for solving this we put as -
Department of Futures Studies
Graphical Representation
31
3
10 n nodes 8 8 6 5 9 9 6 (n 1)! feasible solution
2
10
5
Department of Futures Studies
Sub Tours
32
5
Department of Futures Studies
Formulation of TSP
33
X ij = 1
Objective To minimize total cost/distance of travel Objective function : Min Cij Xij
=1 i
From every city i person need to go j,and is going only one out of the remaining nodes
=1 j
Xij = 0,1
X15 X51
=1 =1
n city TSP can have n 1 length sub tours Need to eliminate these sub tours Xij +Xji 1 If X15 is in solution then X51 is not in solution
36
Eliminate sub tour of length 1 Xjj = 0 - Diagonal assignments Sub tours of length 1 ;hence we can say that Cjj = infinity Eliminate sub tour of length 2 Xij+Xji 1 nC2
nC2
Eliminate sub tour of length 3 Xij + Xjk + Xki 2 nC3 To eliminate sub tours of length k we need to do up to k terms k-1
Department of Futures Studies
37
38
Need to eliminate sub tours of length 1,2,3 & 4 If there is a sub tour of length 3,then automatically it should be included in sub tours of 2 & 1 hence by eliminating 1 & 2 Sub tour of length 3 also get eliminated Likewise sub tour of length 4 too Hence for 5 city problem we need to eliminate sub tours of length 1 & 2
40
If n is even , number of constrains is given by Still the number of constrains in TSP is large.....
Another method
41
Ui - Uj + n Xij n-1
i = 1,2..n-1 j = 2,3...n-1
42
43
Ui - Uj + n Xij n-1
i = 1,2..n-1 j = 2,3...n-1
1-2-3-1
4-5-4
Solution
44
Applications of TSP
45
46
Thank you!!!!
Department of Futures Studies
Reference
47
Graph Theory & Its Applications : Jonathan Gross & Jay Yellan Basic Graph Theory : K.R Parthasarathy Discrete structures & Graph theory :G.S.S Bhishma Rao http://www.austincc.edu/powens/+Topics/HTML/05-6/05-6.html http://train-srv.manipalu.com/wpress/?p=138948