

| ORDER OF PERMANENT LABEL |
LEAST WEIGHT FROM SOURCE |
|||||||||||||
| SPACE FOR WORKING VALUES | ||||||||||||||

This problem is to find the shortest (by weight) route around a network so as to start and finish at the same node and to traverse each arc at least once. This is known as the CHINESE POSTMAN PROBLEM.
If the network is Eulerian (traversable) there is no real problem. As any network MUST have an even number of odd nodes, consider first the case with exactly two odd nodes. It is possible to traverse the route without retracing steps by starting at one of these nodes and finishing at the other. It is therefore only necessary to find the path of least weight between these two odd nodes, as this will need to be retraced in order to complete the whole journey. This can be found by Dijkstra's algorithm (or inspection in very simple cases), and so this is added to the sum of all the weights to give the required shortest route.
If there are four (or more) odd nodes, it is necessary to consider each possible pairings of odd nodes, and to find the paths of least weight for each. For example if there are 4 odd nodes A, B, C and D, then there are 3 possible sets of pairings: AB CD, AC BD, and AD BC. These three pairings require the use of Dijkstra's algorithm 6 times, and the smallest total from these three pairings is again added to the sum of the weights to give the solution to the problem.
With 6 odd nodes there are 15 possible combinations of pairings (each of these has 3 pairs so Dijkstra's algorithm is needed 45 times). It is therefore clear that even with as few as 6 odd nodes, finding a solution to this problem can become very time-consuming and tedious. As with all of the previously mentioned algorithms, it may be necessary to program a computer to solve the problem, although if the number of odd nodes becomes too large the problem will even be beyond the capability of a computer.