<<

Lecture 9. Basic Problems of .

1 / 28 Problem of the Seven Bridges of Königsberg

Denition An Eulerian in a G is a path which contains each edge of G exactly once. If the Eulerian path is closed, then it is called an Euler . If a multigraph contains an Euler cycle, then is called a Eulerian graph.

Example Consider graphs

z z z y y y

w w

w t t x x t x a) b) c)

in case a the multigraph has an Eulerian cycle, in case b the multigraph has an Eulerian trail, in case c the multigraph hasn't an Eulerian cycle or an Eulerian trail.

2 / 28 Problem of the Seven Bridges of Königsberg

In Königsberg, there are two islands A and B on the river Pregola. They are connected each other and with shores C and D by seven bridges. You must set o from any part of the city land: A, B, C or D, go through each of the bridges exactly once and return to the starting point. In 1736 this problem had been solved by the Swiss mathematician (1707-1783). He built a graph representing this problem.

Shore C

River Island A Island B

Shore D

Leonard Euler answered the important question for citizens "has the resulting graph a closed walk, which contains all edges only once?" Of course the answer was negative.

3 / 28 Problem of the Seven Bridges of Königsberg

Theorem Let G be a connected multigraph. G is Eulerian if and only if each vertex of G has even .

Theorem Let G be a connected multigraph. G has an Eulerian trail if and only if there are exactly two vertices of odd degree in G.

4 / 28 Chinese Postman Problem

The problem was originally formulated by the Chinese mathematician Mei Ku Kuan in 1962. The postman is leaving the post oce and has to visit all buildings near the streets in his area delivering letters and naly returning to the post oce. In the language of graph theory, in the connected, weight graph you have to nd a closed path with a minimum number of edges and minimal weight.

5 / 28 Chinese Postman Problem

6 / 28 Chinese Postman Problem

7 / 28 Chinese Postman Problem

8 / 28 Chinese Postman Problem

9 / 28 Chinese Postman Problem

10 / 28 Chinese Postman Problem

11 / 28 Chinese Postman Problem

12 / 28 Chinese Postman Problem

13 / 28 Chinese Postman Problem

14 / 28 Chinese Postman Problem

15 / 28 Chinese Postman Problem

16 / 28 Chinese Postman Problem

17 / 28 Chinese Postman Problem

18 / 28 Chinese Postman Problem

19 / 28 Chinese Postman Problem

20 / 28 Chinese Postman Problem

If the graph is an Eulerian graph, the solution of the problem is unique and it is an Euler cycle. If the graph has an Eulerian path, then solution to the problem is the Euler path and the shortest return path to the starting point. In the other cases, solving the problem of mail delivery involves to designate certain edges that need to be moved several times. In other words, we complement the picture of the graph by multiple edges, making it the Euler graph.

21 / 28 http://logistyka.math.uni.lodz.pl/EuleX.exe

22 / 28 Hamiltonian Cycles

Denition A in a graph is the path that visits each vertex exactly once. A Hamiltonian cycle is a closed Hamiltonian path. If a graph contains a Hamiltonian cycle, then is called a Hamiltonian graph.

Example Consider graphs

w w v

w u z z u z

x y x y x y a) b) c)

in case a the graph has a Hamilton cycle, in case b the graph has an Hamilton path, in case c the graph hasn't a Hamilton cycle or a Hamilton path. 23 / 28 Hamiltonian cycles

Theorem

Every Kn has a Hamilton cycle.

24 / 28 Travelling Salesman Problem (TSP)

Given a list of cities the salesman has to visit all cities (each exactly once) and return to the origin city. However his journey should be the shortest, or the cheapest, or the fastest. The distance (cost or time) of routing between each pair of cities is given. The problem can be formulated as the problem of nding optimal (shortest, cheapest or fastest) Hamiltonian cycle in a given graph.

25 / 28 Travelling Salesman Problem (TSP)

Example Consider a graph

cycle a, b, c, d, e, a weight 230 cycle a, b, e, c, d, a weight 110 Theoretically, TSP can be solved by setting (n−1)! Hamiltonian cycles and choosing 2 the cycle with the smallest total weight. However, for n = 20 cities we have to check 19 ! 60 822 550 204 416 000 2 = cycles. This means that for a computer which is able to check 1 milion cycles per second, checking all cycles will last approximately 1928.7 years!

26 / 28 Travelling Salesman Problem (TSP)

Therefore we can use the direct method that generates an the exact solution, but only for small n, the approximate method, which generates solution close to the optimal, but working quickly. http://www.math.uwaterloo.ca/tsp/index.html

27 / 28 Thank you for your attention!

28 / 28