17
Chinese postman problem BY LAKSHMA REDDY KUSAM

Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline : Real world problem Graph construction Graph problem Graph traversability Solution

Embed Size (px)

Citation preview

Page 1: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Chinese postman problem BY LAKSHMA REDDY KUSAM

Page 2: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Outline :Real world problem

Graph construction

Graph problem

Graph traversability

Solution

Page 3: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Real world problem The Chinese postman problem is a general real world problem for the postman’s delivering the letter’s as they jobs major role. The Chinese Postman algorithm was invented in 1962 and takes its name from the Chinese mathematician Kuan Mei-Ko .

oIn this postman have to travel along all the streets in a town or city without missing even a single street.

oNow, the problem is that to find the minimum route possible and walking in a street only once.

oThere is no graph problem if there are even vertices in the map network. The problem rasies when there are odd edges

Page 4: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Graph construction

A

B

C

D

E

F G

H I

9

44

5 6

4

6

7148

2 6

4

2

2 2

Page 5: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Graph construction (cont..

A

B

C

D

E

F G

H I

13

6

10

2 2

6 4

14 78

102 2

Page 6: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Graph traversability A network is said to be Traversable if you can draw it without removing your pen from the paper and without retracing the same arc twice. A graph is said to be closed if it is started and end at the same end. Are these Graphs Traversable and closed?

Traversable? Yes Yes Yes

Closed ? No Yes Yes

Page 7: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Euler’s path Euler found that the order of the vertices determines whether or not a graph is traversable.

If it is possible to traverse a graph starting and finishing at the same point then the graph has an Eulerian trail.

If it is possible to traverse a graph starting at one point and finishing at a different point then the graph has a semi-Eulerian trail.

Page 8: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Cont..

Even vertices

order 1 order 3

order 5

order 2order 4

order 6

Odd vertices

Page 9: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

We need to pair the vertices together by adding an extra edge to make the order of each vertex four. We can join AB and CD, or AC and BD, or AD and BC.

In each case the graph is now closed.

[You only need to add one arc to be traversable]

Page 10: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Algorithm for Chinese postman problem

Step 1: Sum all the vertices of the arcs in the graph.

Step 2: Write down the degree of all the vertices to identify the odd vertices among them.

Step 3: Pair all the nodes among themselves to make them even degree in such a way that the weight among them is minimum(matching up minimum possible distance).

Step 4: Identify the odd vertices to be paired

Step 5: Duplicate the vertices that are obtained from step4 .weight of the duplicated arc is same as the original arc. Add the weight of the duplicated arc to the original weight.

Step 6: Now find the euler’s path of the obtained network.

Page 11: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Solution

A

B

C

D

E

F G

H I

13

6

10

2 2

6 4

14 78

102 2

Odd vertices

Page 12: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Solution (cont..) Step 1: Total distance of the graph =7+10+10+2+4+2+14+8+13+2+2+6+2+6=88 Step 2: Degree of all the vertices A:2 ,B:3,C:3,D:3,E:3,F:3,G:4,H:3,I:2. From this the odd edges are B,C,D,E,F,H. Step 3: Possible combinations are BC, EF, DH BE,CF,DH. Those are the possible combinations now we calculate the distance between them. BC+EF+DH = 2+2+14=18 BE+CF+DH=6+6+14=26

Page 13: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Step 4: Now, from the above distance calculation we can see that 18<26 So we choose an extra duplicate path’s between BC,EF,DH.

Step 5: Duplicate the edges between the BC,EF,DH. Now the total weight of the graph will be

88+18=106.

Page 14: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Now, we find out the euler’s route in the graph.

Page 15: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Now we have the shortest path between those vertices

HDHIGFECDABCBEGH and thus gives the solution to the Chinese postman problem with minimum distance of 106 for the above network.

.

Page 16: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

ANY QUEIRES?

Page 17: Chinese postman problem BY LAKSHMA REDDY KUSAM. Outline :  Real world problem  Graph construction  Graph problem  Graph traversability  Solution

Thank you