Chinese Postman Problem
Chinese Postman Problem
In 1962, Chinese mathematician M K Kwan (meigu Guan) posted work on a type of problem that came to be called the Chinese postman problem. If a circuit does not have an Euler circuit, it asks for the shortest circuit that covers each path, even if some edges have to be traversed more than once. At this page from the NIST site I found that Kwan's "article referred to optimizing a postman's route, was written by a Chinese author and appeared in a Chinese math journal. Based on this Alan Goldman suggested the name "Chinese Postman problem" to Jack Edmonds when Edmonds was in Goldman's Operations Research group at the U.S. National Bureau of Standards (now NIST). Edmonds appreciated its "catchiness" and adopted it. Goldman was also indirectly influenced by recalling an Ellery Queen mystery called "The Chinese Orange Mystery". (Alan Goldman, personal communication, 14 December 2003) " The term node is from the Latin nodus and is closely related to our words for knot and knob. The word circuit is from circumire, "to go around", which shares the common Latin root for circle, and led to the common English word circuitous. From http://www.pballew.net/graphs.html
Postmen deliver letters down roads. The Chinese Postman Problem is to find the shortest route in a network that uses every arc (directed edge) and gets back to where they started (closed problem) or doesn't go back (open problem). There are many further variations on the problem, but we are concerned with weighted directed graphs with (possible) parallel arcs, so-called weighted multidigraphs -- what the world wide web is made out of from its HTML links, which are directed and may be repeated. We allow weights because we might, for example, be interested in how long a user takes to explore a web site, so the weights could be measured in seconds. From http://www.uclic.ucl.ac.uk/harold/cpp/
page 2
The solution to find the shortest distance for the Knigsberg bridge problem is as follows:
Step 1 Step 2
Find all nodes with odd numbers of edges emerging from them All are odd These nodes should be listed in all the possible pairings AB and CD, AC and BD, AD and BC
page 3
Step 4
Find the shortest distance between each node of the pair, then add up the total for each set of pairs (ie AC and BD, not AD and AC!) Find whichever pairing is shortest Choose the set of pairs with the minimum total distance. This is added on to the sum of all the edges to give the shortest distance to traverse the network and return to the original point of entry. Add this value to the total value of the network
The Algorithm is easy to use, and is generally used when delivering to a large number of places in a particular area.
Previous Page - Euler and Knigsberg (a history of graph theory) Next Page - Travelling Salesperson
From http://people.bath.ac.uk/db230/CP.htm
The Chinese Postman Problem (CPP) is a close cousin to TSP. In this routing problem the traveler must traverse every arc (i.e. road link) in the network. The name comes from the fact that a Chinese mathematician, Mei-Ko Kwan (1962), developed the first algorithm to solve this problem for a rural postman. It is an extension to one of the earliest graph theory questions, the Knigsberg Bridge Problem, which was studied by Euler (1736). The Pregel River runs through the city of Knigsberg in Germany. In a city park seven bridges cross branches of the river and connect two islands with each other and with opposite banks of the river. For many years the citizens of Knigsberg tried to take walks that took them over each bridge once without retracing any part of their path. Euler was able to prove that such a walk is impossible. In general, graph theorists are interested in understanding whether or not a circuit exists that does not require traversing the same arc twice. Operations researchers are interested in finding the shortest route in any type of network. The Chinese Postman class of problems is relevant to a number of other services. Garbage collection, street sweeping, salting or gritting of icy roads, and snow plowing are some of the other services for which vehicle routing algorithms have been applied. Meter readers also must travel up and down every street. Checking roads for potholes or serious deterioration or checking pipelines for weak spots also fall into this class of problems. In the ever complex real-world additional constraints can arise that complicate the search for efficient routes. Labor contracts may require that the routes of different drivers must be approximately of equal length. There may be significant time restrictions or time windows on when a vehicle must visit a specific location to make a delivery or pick-up. The vehicle making pick-ups may also have capacity limitations such as a garbage truck which would restrict the maximum length of a route. Uncertainty can also complicate route planning. Trucks that deliver gasoline or oil, can't be sure when they set out as to how much they will have to pump into each of the tanks on their route.
From http://www.hsor.org/what_is_or.cfm?name=network_routing
page 4
Following the steps of the route inspection algorithm: STEP 1 Odd Vertices A D E F 3 5 3 5 Degree
page 5
STEP 2 & 3 Possible pairings of odd vertices Distance AD and EF AE and DF AF and DE STEP 4 From the above calculations it is clear that to create a Eulerian graph that is the shortest possible edges AF and DE must be repeated. A possible route starting and finishing at A is: Shortest Route 12 + 6 = 18 3 + 6 + 8 = 17 3+4=7
AFEDCBADE
CFDBFA
The total length of this route is: 4 + 7 + 5 + 6 + 7 + 12 + 10 + 8 + 9 + 6 + 4 + 3 + Repeated edges (4 + 3) = 78 For useful definitions and links relating to algorithms and examples found on this site click here. of go: Back to home page
From http://people.bath.ac.uk/ma3mb/example.htm
page 6
Scheduling Problems
Instead of interpreting the edge weights as distances, they may represent costs or times. The algorithm we have used can then be applied to find schedules of minimum cost or minimum time. In these situations the network is often called a PERT (Project Evaluation and Review Technique) network or a CPM (Critical Path Method) network.
page 7
page 8
matching of the nodes in An is then a matching such that the total length of the shortest paths between the paired nodes is minimum. Example 7: Application of Algorithm 6.5 Consider the graph of Figure 6.15a. The numbers on the edges indicate the lengths of the edges. The graph contains four nodes of odd degree (a, b, d, and e). Thus, there are three possible matchings of the odd-degree nodes: a-b and d-e; a-d and b-e; and a-e and bad. Th e augmented networks that would result from the addition of the artificial edges corresponding to each of these three matchings are-shown in Figure 6.15b-d, respectively. Of the three matchings, the optimal is obviously the one shown in Figure 6.15c. It adds only 12 units of length to the tour as opposed to 16 for Figure 6.15b and 20 for 6.15c. Thus, the graph shown on Figure 6.15c should be the result of the procedure outlined in Steps 2 and 3 of Algorithm 6.5. Supposing that the required tour must begin at node a, a solution to the Chinese postman,s problem for the graph of Figure 6.15a is the tour {a, d, a, c, d, e, c, b, e, b, a}. Its total length is 60 units, of which 48 is the total length of the graph 6.1 5a, while 12 units are due to the artificial edges. In other words, edges (a, d) and (b, e) will be traversed twice.
page 9
In Algorithm 6.5, we have concentrated exclusively on the shortest paths between pairs of odd-degree nodes. That this should be so can be seen as follows. Were a supposedly optimal pairwise matching between odd-degree nodes to contain a path, P1, between any given pair of nodes that is not the shortest path, P. between these two nodes, the solution could be improved by simply substituting P for P1 in the drawing of the artificial edges, since the length of P is, by definition, smaller than the length of P1.
page 10
In reviewing Algorithm 6.5, we can see that its only difficulty lies in Step 2, since Steps 1, 3, and 4 are all very simple. For Step 2, however, the number of possible pairwise matching combinations increases very quickly with the number of odd-degree nodes. Some thought will show that with m odd degree nodes in G (remember that m is always even), there are
possible distinct pairwise matching combinations. Thus, for m = 4, there are I 3 = 3 possible combinations (as we have already seen in our last example), for m = 10,945 combinations, and for m = 20, about 655 million combinations. Fortunately, an efficient, but quite complicated algorithm for minimum length matchings on undirected graphs is now available. This algorithm is based on the theory of matching on graphs that has been developed in recent years primarily by J. Edmonds. The interested reader is referred to [EDMO 73] or to [CHRI 753 for its details. Here we only note that the algorithm is an exact one (i.e., finds the optimum matchings) and efficient computer-implemented versions solve the problem in time proportional to n3, where n is the number of nodes in the graph under consideration. The algorithm not only finds the minimum-length matchings but also identifies the shortest path associated with each pair. It follows that in the worst case Algorithm 6.5 is also O(n3). Manual approach to matching. When Edmonds' minimum-length matching algorithm is used in Step 2 of Algorithm 6.5, an optimum solution to the Chinese postman,s problem is obtained. Experience has shown, however, that whenever the Chinese postman problem is posed in a geographical context (and this of course is the case in urban service systems applications), then excellent--in the sense of being very close to the optimum-manual solutions can be obtained practically by inspection with the aid of a good map. The map can be used to perform all four steps of Algorithm 6.5, and the only step where one risks deviating from the optimum solution is in finding the minimum-length matching in Step 2. The manual search for an approximately minimum-length matching of odd-degree nodes in Step 2 is greatly aided by the following key observation: In a minimum-length matching of the odd-degree nodes, no two shortest paths in the matching can have any edges in common. To see this, consider Figure 6.16, assuming that nodes a, b, c, and d are all of odd degree and that the shortest paths between, say, the pairs of nodes a-c and Kd have edge (p, q) in common. Then it is impossible that the minimum-length pairwise matching contain the pairs a-c and Fd, since it would then be possible to obtain a better (shorter) matching by coupling
page 11
together nodes a and b into one pair and nodes c and d into another. This latter matching will reduce the sum of the shortest path lengths by at least 2 (p, q) units. From the practical point of view, this observation has two effects: 1. It eliminates from consideration a very large percentage of the possible sets of matchings that might be considered. (This percentage might be expected to increase as the number of odd-degree nodes increases.) 2. It indicates that in a minimum-length matching odd-degree nodes will be matched to other odd-degree nodes in their immediate neighborhood. Other observations (of a somewhat more complicated nature) have also been made (see [STRI 70]) with regard to finding good approximate solutions to minimum-length matching problems without using a matching algorithm. It has been the authors' experience that, whenever good maps of urban areas are available, it takes only a limited amount of practice with some examples before one develops the ability to find virtually by inspection excellent solutions to matching problems (by taking advantage of the foregoing observations). Example 8 Consider again our initial Chinese Postman problem shown in Figure 6.12. The odddegree nodes on Figure 6.12 are C, D, F, G, I, J, K, and L. They are shown on Figure 6.17, with that part of the network model of the district that contains all the shortest paths between the odd-degree nodes. Inspection of Figure 6.17 leads to the conclusion that (although theoretically there are 7 5 3 1 = 105 possible sets of matchings among the eight odd-degree nodes) very few sets of matchings would even qualify for consideration. In fact, a couple of trials should be sufficient to convince the reader that the minimum-cost matching can only be the matching I-J, K-L, C-D, and F-G for a total cost (i.e., duplicated street length) of 490 units of length. The final result for the Chinese postman,s problem in this case is then
page 12
shown on Figure 6.18, where edges to be traversed twice have been substituted by two edges (or pseudo-edges) each of equal length to the original one. The graph of Figure 6.18 now contains no nodes of odd degree, and thus an Euler tour can be drawn on it, beginning at any desired node and ending at the same node. The length of all Euler tours on this graph will be equal to the total length of the original graph G (3,340 units) plus the distance to be traversed twice (490 units), for a total length of 3,830 units, or about 15 percent more than the total street length of the district that the mailman is responsible for. (This turns out to be the optimum solution.)
from http://web.mit.edu/urban_or_book/www/book/chapter6/6.4.4.html
page 13
a refuse collection truck can carry or, very often, other limits on some measures of workload that have been agreed on in a labor contract. The CCPP has not been investigated extensively to date, but practical approaches to it--in the context of the delivery of urban services--have been suggested for both undirected [STRI 70] and directed [BELT 74] networks. Because of the relative ease with which the single-tour Chinese postman problem can be solved, the "route first, cluster second" strategy seems to be the favored one in this case: a giant tour is first found and then divided into m subtours, where m is the number of available vehicles. However, with no "best way" available for breaking up the giant tour into shorter subtours, this approach depends to a large extent on the ability and experience of the analyst. In fact, the approach described below for an undirected network [STRI 70] is most effective when carried out manually with the assistance of a good map. The key to the success of the approach is to subdivide the graph G', on which the large, single tour is drawn (see Section 6.4.4) in such a way as not to create odddegree nodes on the boundaries between subtours. Since G' has been derived by applying a CP algorithm to the original graph G. G' has no odd-degree nodes. Therefore, all the nodes in the interior of subtours will be even-degree nodes and the partitioning process can create odd-degree nodes only on the boundaries between subtours. To avoid this, it is important to draw continuous boundaries for each subtour, so that an even number of edges is incident on each node. The following describes informally a possible heuristic approach: Constrained Chinese Postman "Algorithm" (Algorithm G.9) Using a CP algorithm, create an Eulerian graph from the given network whose edges are to be covered. Sketch out roughly the boundaries of the m subtours in accordance with STEP 2: the given constraints on tour lengths, vehicle capacities, and so on. Carefully draw a continuous boundary for each subtour so that an even STEP 3: number of edges is incident to every node. STEP 1: It is clear that the procedure above does not really describe an algorithm in the strict sense but rather outlines a procedure for obtaining a good solution to the CCPP. Example 14: Tour of the Mailman, Revisited Consider again the mailman,s problem that we used in an earlier example (Figure 6.12). The modified graph G' which was found by applying our CP algorithm for the solution of the single tour was shown in Figure 6.18 and is copied in Figure 6.34. It is a network with no nodes of odd degree and with total edge length equal to
page 14
Suppose now that an upper limit of 1,500 distance units is placed on the length of a mailman's tour. We then attempt to subdivide the single 3,830-unit tour into three approximately equal tours, each of which satisfies the 1,500-unit limit. (Alternatively, it might have been specified that the district in question must be covered by three mailmen.) On Figure 6.34 the rough outlines of three approximately equal-length tours are sketched in accordance with Step 2 of the CCPP algorithm. Note that these outlines may overlap since they serve only as an aid in defining the approximate physical boundaries of the subtours. In Step 3 the three subtours are designed in detail with continuous boundaries to ensure both the existence of an Eulerian tour and an increase in the total distance covered, which is as small as possible. The three
page 15
subtours shown in Figure 6.35 are 1,210, 1,300, and 1,320 units long. Their total length in this particular case turns out to be exactly equal to the length of the single tour from which they were derived. Two disadvantages of the approach that we just illustrated are readily apparent. First, some trial-and-error work may be required before a set of feasible tours is obtained. This is due to the fact that the subdivision of the tour is initially made by inspection alone. Second, the algorithm above does
not take into consideration the distances involved in getting to each district from the central station (post office, depot, etc.) and back. These distances--or, better, the time required in practice to cover them--are considered to be second-order-effect quantities. From http://web.mit.edu/urban_or_book/www/book/chapter6/6.4.14.html