130 likes | 280 Views
Discrete Maths. Chapter 5: Route Inspection Lesson 1: Chinese Postman. A. F. B. D. E. C. Can you remember what Traversability means?. Traverasbility.
E N D
Discrete Maths Chapter 5: Route Inspection Lesson 1: Chinese Postman
A F B D E C Can you remember what Traversability means?...
Traverasbility • 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. • In order to start and end at the same node the network must be Eularian (all nodes must be even). • If exactly two modes have odd order, the network is still traversable, but you start and end at different nodes (and the network is Semi-Eularian)
The Notes… • The Chinese Postman algorithm was invented in 1962 and takes its name from the Chinese mathematician Kuan Mei-Ko who considered the problem of a postman who has to deliver mail to houses along each of the streets in a particular housing estate and wants to minimise the distance he has to walk. • This is known as a route inspection problem and can be summarised as follows: ‘find a closed trail of minimum weight containing every arc’. • If the graph in question is Eulerian then such a trail is easy to find. However, many graphs are not Eulerian and this is where the problem becomes more interesting. It is important to remember that if a graph is relatively small, trial and error may be able to be used. However, when a large graph is involved, an algorithm is needed and this is where the Chinese Postman algorithm is useful. • Each arc in a network adds 1 to the orders of 2 nodes. Therefore, the total of the orders of all the nodes is twice the number of arcs. This means that in any network there is always an even number of odd nodes. (If there was an odd number of odd nodes, the total of the orders of all the nodes would be odd which is not possible) • Such a network can be made traversable by linking together pairs of odd nodes with additional arcs. The effect of adding these extra arcs is to make all nodes even and thus the network is now Eulerian and traversable. The Chinese Postman algorithm considers all possible pairings of nodes of odd order and finds the connecting paths of minimum weight. The grouping with the minimum weight is then selected and these arcs are then duplicated. Finally, a trail is found containing every arc for the new Eulerian graph.
B E 1 2 3 5 14 6 12 A G C 9 2 8 3 5 D F Eulerian trail starting and ending at A not possible. Why not?
B E 1 2 3 5 14 6 12 A G C 9 2 8 3 5 D F Solution?
B E 1 1 2 3 5 14 6 12 A G C 9 2 8 3 3 9 5 D F Best Solution?
B E 1 1 6 2 3 5 14 6 12 A G 2 C 9 2 8 3 3 5 D F
B E 1 1 6 2 3 5 14 6 12 A G 2 C 9 2 8 3 3 5 D F Still not the best solution
2 B E 1 1 3 2 3 5 14 6 12 A G 2 C 9 2 8 3 3 5 D F Best solution!
2 B E 1 1 3 2 3 5 14 6 12 A G 2 C 9 2 8 3 3 5 D F Now find an Eulerian trail, starting and ending at A.
Chinese Postman Algorithm Aim: To find the least-weight closed trail containing every arc • Step 1: Find all the nodes of odd order. • Step 2: For each pair of odd nodes find the connecting path of minimum weight. • Step 3: Pair up all the odd nodes so that the sum of the weights of the connecting paths from Step 2 is minimised. • Step 4: In the original graph, duplicate the minimum weight paths found in Step 3. • Step 5: Find a trail containing every arc for the new (Eulerian) Graph.
EXAMPLE: Calculate the Minimum Route, starting and ending at A