






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







4. The length of a shortest path is 5. No uniqueness. 6. The length of the unique shortest path is 4. 8. n 1. If it had more, a vertex would appear more than once and the corresponding cycle could be omitted. One edge. 10. This is true for l 0 since then v s. Let it be true for an l 1. Then ( vl 1 ) l 1 for the predecessor vl 1 of v on a shortest path s * v. We claim that when vl 1 gets labeled, v is still unlabeled (so that we shall have ( v ) l as wanted). Indeed, if v were labeled, it would have a label less than l , hence distance less than l by Prob. 9, contradicting that v has distance l. 14. Delete the edge (2, 4). 16. 1 2 3 4 5 3 1, 1 3 4 5 3 2 1, and these two trails traversed in the opposite sense 18. Let T : s * s be a shortest postman trail and v any vertex. Since T includes each edge, T visits v. Let T 1 : s * v be the portion of T from s to the first visit of v and T 2 : v * s the other portion of T. Then the trail v * v consisting of T 2 followed by T 1 has the same length as T and solves the postman problem.
SECTION 23.3. Bellman’s Principle. Dijkstra’s Algorithm, page 963
Purpose. This section extends the previous one to graphs whose edges have any (positive) length and explains a popular corresponding algorithm (by Dijkstra).
Main Content, Important Concepts
Bellman’s optimality principle, Bellman’s equations Dijkstra’s algorithm (Table 23.2)
Comment on Content
Throughout this chapter, one should emphasize that algorithms are needed because most practical problems are so large that solution by inspection would fail, even if one were satisfied with approximately optimal solutions.
SOLUTIONS TO PROBLEM SET 23.3, page 966
2. Dijkstra’s algorithm gives 1. L 1 0, L 2 4, L 3 12, L 4 16, L 5 2. L 2 4, k 2 3. L 3 min {12, 4 l 23 } 10 L 4 min {16, 4 l 24 } 16 L 5 min {, 4 } 2. L 3 10, k 3 3. L 4 min {16, 10 l 34 } 16 L 5 min {, 10 }
Instructor’s Manual 365
2. L 4 16, k 4 3. L 5 min {, 16 l 45 } 56 2. L 5 56, k 5, so that the answer is (1, 2), (1, 4), (2, 3), (4, 5); L 2 4, L 3 10, L 4 16, L 5 56. 4. Dijkstra’s algorithm gives 1. L 1 0, L 2 8, L 3 10, L 4 , L 5 5, L 6 2. L 5 5 3. L 2 min {8, 5 l 52 } 7 L 3 min {10, 5 l 53 } 10 L 4 min {, 5 l 54 } 10 L 6 min {, 5 l 56 } 7 2. L 2 7 3. L 3 min {10, 7 l 23 } 9 L 4 min {10, 7 l 24 } 10 L 6 min {7, 7 l 26 } 7 2. L 6 7 3. L 3 min {9, 7 l 63 } min {9, 7 } 9 L 4 min {10, 7 l 64 } 8 2. L 4 8 3. L 3 min {9, 8 l 43 } min {9, 8 } 9 2. L 3 9. The answer is (1, 5), (2, 3), (2, 5), (4, 6), (5, 6); L 2 7, L 3 9, L 4 8, L 5 5, L 6 7. 6. Dijkstra’s algorithm gives 1. L 1 0, L 2 15, L 3 2, L 4 10, L 5 6 2. L 3 2 3. L 2 min {15, 2 l 32 } 15 L 4 min {10, 2 l 34 } 10 L 5 min {6, 2 l 35 } 5 2. L 5 5 3. L 2 min {15, 5 l 52 } min {15, 5 } 15 L 4 min {10, 5 l 54 } 9 2. L 4 9 3. L 2 min {15, 9 l 42 } 14 2. L 2 14. The answer is (1, 3), (2, 4), (3, 5), (4, 5); L 2 14, L 3 2, L 4 9, L 5 5. 8. Let j be the vertex that gave k its present label Lk , namely, Lj ljk. After this label was assigned, j did not change its label, since it was then removed from . Next, find the vertex which gave j its permanent label, etc. This backward search traces a path from 1 to k , whose length is exactly Lk.
366 Instructor’s Manual
20. If G is a tree, it has no cycles, and has n 1 edges by Prob. 18. Conversely, let G have no cycles and n 1 edges. Then G has 2 vertices of degree 1 by Prob. 16. Now prove connectedness by induction. True when n 2. Assume true for n k 1. Let G with k vertices have no cycles and k 1 edges. Omit a vertex v and its incident edge e , apply the induction hypothesis and add e and v back on.
SECTION 23.5. Shortest Spanning Trees: Prim’s Algorithm, page 970 Purpose. To explain another algorithm (by Prim) for constructing a shortest spanning tree in a given graph whose edges have arbitrary (positive) lengths. Comments on Content In contrast to Kruskal’s greedy algorithm (Sec. 23.4), Prim’s algorithm gives a tree at each intermediate step. The problem set illustrates a few concepts that can be included into the present cycle of ideas.
SOLUTIONS TO PROBLEM SET 23.5, page 972
2. The algorithm proceeds as follows:
Vertex Initial^ Relabeling Label (^) (I) (II) (III) (IV)
2 l 12 20 l 12 20 l 32 4 l 32 4 3 l 53 6 4 l 54 12 l 34 2 5 l 15 8 6 l 16 30 l 16 30 l 16 30 l 16 30 l 26 10
Hence we got successively
(1, 5), (3, 5), (3, 4), (2, 3), (2, 6), and L 30.
In Prob. 1 of Sec. 23.4 we got the same edges, but in the order
(3, 4), (2, 3), (3, 5), (1, 5), (2, 6).
4. The algorithm gives
Vertex Initial^ Relabeling Label (^) (I) (II) (III) (IV) (V) (VI)
2 l 12 3 3 l 23 4 4 l 34 3 l 64 1 5 l 35 5 l 35 5 l 35 5 6 l 26 10 l 36 2 7 l 27 7 l 37 6 l 37 6 l 37 6 l 37 6 8 l 18 8 l 28 7 l 28 7 l 28 7 l 28 7 l 28 7 l 28 7
368 Instructor’s Manual
We see that we got
(1, 2), (2, 3), (3, 6), (4, 6), (3, 5), (3, 7) (2, 8).
The length is L 28.
6. The algorithm gives
Vertex Initial^ Relabeling Label (^) (I) (II) (III)
2 l 12 6 l 32 3 3 l 13 1 4 l 34 10 l 34 10 l 54 2 5 l 15 15 l 15 15 l 25 9
We see that we got (1, 3), (2, 3), (2, 5), (4, 5). The tree has the length L 15.
8. In Step 2 we first select a smallest l 1 j for the n 1 vertices outside U ; these are n 2 comparisons. Step 3 then requires n 2 updatings (pairwise comparisons). In the next round we have n 3 comparisons in Step 2 and n 3 updatings in Step 3, and so on, until we finally end up with 1 comparison and 1 updating. The sum of all these numbers is ( n 2)( n 1) O ( n^2 ). 10. An algorithm for minimum spanning trees must examine each entry of the distance matrix at least once, because an entry not looked upon might have been one that should have been included in a shortest spanning tree. Hence, examining the relevant given information is already O ( n^2 ) work. 12. Team Project. (a) (1) 16, (2) 22, (3) 12.
(b) d ( G ) 24, r ( G ) 12 (3), center {3}. (c) 20, 14, center {3, 4} (e) Let T * be obtained from T by deleting all endpoints ( vertices of degree 1) together with the edges to which they belong. Since for fixed u , max d ( u , v ) occurs only when v is an endpoint, ( u ) is one less in T * than it is in T. Hence the vertices of minimum eccentricity in T are the same as those in T *. Thus T has the same center as T *. Delete the endpoints of T * to get a tree T ** whose center is the same as that of T , etc. The process terminates when only one vertex or two adjacent vertices are left. (f) Choose a vertex u and find a farthest v 1. From v 1 find a farthest v 2. Find w such that d ( w , v 1 ) is as close as possible to being equal to 1 _ 2 d ( v 1 , v 2 ).
SECTION 23.6. Flows in Networks, page 973
Purpose. After shortest paths and spanning trees we discuss in this section a third class of practically important problems, the optimization of flows in networks.
Main Content, Important Concepts
Network, source, target (sink) Edge condition, vertex condition Path in a digraph, forward edge, backward edge Flow augmenting path
Instructor’s Manual 369
Comment on Content
Note that this is the first section in which we are dealing with digraphs.
SOLUTIONS TO PROBLEM SET 23.7, page 982
2. Not more work than in Example 1. Steps 1–7 are similar to those in the example and give the flow augmenting path P 1 : 1 2 3 6, which augments the flow from 0 to 11. In determining a second flow augmenting path we scan 1, labeling 2 and 4 and getting 2 9, 4 10. In scanning 2, that is, trying to label 3 and 5, we cannot label 3 because ci j c 23 ƒ i j ƒ 23 11, and we cannot label 5 because ƒ 52 0. In scanning 4 (i.e., labeling 5) we get 5 7. In scanning 5 we cannot label 3 because ƒ 35 0, and we further get 6 3. Hence a flow augmenting path is P 2 : 1 4 5 6 and t 3. Together we get the maximum flow 11 3 14 because no further flow augmenting paths can be found. The result agrees with that in Example 1. 4. Scanning the vertices in the order of their numbers, we get a flow augmenting path P 1 : 1 2 4 6 with t 1 and then P 2 : 1 3 4 6 with t 1, but no further flow augmenting path. Since the initial flow was 2, this gives the total flow ƒ 4. 6. The given flow equals 9. We first get the flow augmenting path P 1 : 1 2 5 with t 2, then the flow augmenting path P 2 : 1 3 5 with t 5, and finally the flow augmenting path P 3 : 1 2 3 5 with t 1. The maximum flow is 9 2 5 1 17. 8. At each vertex, the inflow and the outflow are increased by the same amount. 12. Start from the zero flow. If it is not maximum, there is an augmenting path by which we can augment the flow by an amount that is an integer, since the capacities are integers, etc. 14. The forward edges of the set are used to capacity; otherwise one would have been able to label their other ends. Similarly for the backward edges of the set, which carry no flow. 16. ƒ 7 18. Let G have k edge-disjoint paths s * t , and let ƒ^ be a maximum flow in G. Define on those paths a flow ƒ by ƒ( e ) 1 on each of their edges. Then ƒ k ƒ^ since ƒ is maximum. Now let G * be obtained from G by deleting edges that carry no portion of ƒ. Then, since each edge has capacity 1, there exist ƒ^ edge-disjoint paths in G *, hence also in G , and ƒ^ k. Together, ƒ^ k.
Instructor’s Manual 371
20. Since ( S , T ) is a cut set, there is no directed path s * t in G with the edges of ( S , T ) deleted. Since all edges have capacity 1, we thus obtain cap ( S , T ) q. Now let E 0 be a set of q edges whose deletion destroys all directed paths s * t , and let G 0 denote G without these q edges. Let V 0 be the set of all those vertices v in G 0 for which there is a directed path s * v. Let V 1 be the set of the other vertices in G. Then ( V 0 , V 1 ) is a cut set since s V 0 and t V 1. This cut set contains none of the edges of G 0 , by the definition of V 0. Hence all the edges of ( V 0 , V 1 ) are in E 0 , which has q edges. Now ( S , T ) is a minimum cut set, and all the edges have capacity 1. Thus, cap ( S , T ) cap ( V 0 , V 1 ) q. Together, cap ( S , T ) q.
SECTION 23.8. Bipartite Graphs. Assignment Problems, page 982 Purpose. As the last class of problems, in this section we explain assignment problems (of workers to jobs, goods to storage spaces, etc.), so that the vertex set V of the graph consists of two subsets S and T and vertices in S are assigned (related by edges) to vertices in T. Main Content, Important Concepts Bipartite graph G ( V , E ) ( S , T ; E ) Matching, maximum cardinality matching Exposed vertex Alternating path, augmenting path Matching algorithm (Table 23.9) Comment on Content A few additional problems on graphs, related to the present circle of ideas as well as of a more general nature, are contained in the problem set.
SOLUTIONS TO PROBLEM SET 23.8, page 986
2. Yes, S {1, 4}, T {2, 3} 4. Yes, S {1, 3, 5}, T {2, 4, 6} 6. Yes, S {1, 3, 4}, T {2, 5}
12. (1, 2), (3, 4), (5, 6), (7, 8), by inspection or by the use of the path in the answer to Prob 8. 14. Period 1 2 3 4 x 1 y 4 y 3 y 1 — x 2 y 1 y 4 y 3 y 2 x 3 — y 2 y 4 y 3
372 Instructor’s Manual
SECTION 24.1. Data Representation. Average. Spread, page 993 Purpose. To discuss standard graphical representations of data in statistics. To introduce concepts that characterize the average size of the data values and their spread (their variability). Main Content, Important Concepts Stem-and-leaf plot Histogram Boxplot Absolute frequency, relative frequency Cumulative relative frequency Outliers Mean Variance, standard deviation Median, quartiles, interquartile range Comment on Content The graphical representations of data to be discussed in this section have become standard in connection with statistical methods. Average size and variability give the two most important general characterizations of data. Relative frequency will motivate probability as its theoretical counterpart. This is a main reason for presenting this material here before the beginning of our discussion of probability in this chapter. Randomness is not mentioned in this section because the introduction of samples (random samples) as a concept can wait until Chap. 25 when we shall need them in connection with statistical methods. The connection with this section will then be immediate and will provide no difficulty or duplication.
SOLUTIONS TO PROBLEM SET 24.1, page 996
2. qL 2, qM 5, qU 6 4. qL 10.0, qM 11.6, qU 12. 6. qL 0.52, qM 0.19, qU 0. 8. qL 85, qM 87, qU 89 10. qL qM 14, qU 14. 12. x 4.3, s 2.541, IQR 4 14. x 0.064, s 0.542, IQR 0. 16. x 12.6 but qM 7. The data are not sufficiently symmetric. s 9.07, IQR 17 18. x min xj x max. Now sum over j from 1 to n. Then divide by n to get x min x x max. 20. Points to consider are the amounts of calculation, the size of the data (in using quartiles we lose information—the larger the number of data points, the more more information we lose), and the symmetry and asymmetry of the data. In the case of symmetry we 374