Saint Louis University |
Computer Science 314
|
Dept. of Math & Computer Science |
Topics: Amortization, Graph Algorithms
Related Reading: Chapters 17, 22, 23 of CLRS
Due:
10:00am, Monday, 3 November, 2014
Please make sure to strictly adhere to the stated course procedures regarding the format of your submitted homework. In particular, your name should not appear on anything other than the cover page, and your solution for each problem must be in a separate packet, labeled appropriately with your assigned codename.
You must also adhere to the policies on academic integrity, paying particular attention to the limits on collaboration.
Problem 17.2, parts (a) and (b) only from CLRS
Problem B-2 ("Friendly Graphs") on page 1181 of Appendix B of CLRS
Please note that on part (d), when they say that "everyone in a group is the friend of at least half the people in the group" that is to be interpretted to mean half the total number of people in the group (not just half of those people other than him- or herself). In particular, if n is an odd number, and thus equal to 2z+1 for some integer z, then everyone must have at least z+1 friends to satisfy this hypothesis. Note that if you only required each person to be friends with half of those other than themself, the conclusion is not true. Consider, for example a group of three people (A,B,C) such that A is friends with B and C, but B and C are not friends with each other. Everyone is friends with at least 1 of the 2 other people, yet there is no way to sit those three around a circular table with everyone being surrounded by friends, since B and C will have to be neighbors of each other.
Additional Hint: Upon further consideration, I think problem (d) is more challenging than I originally thought. (OK, I'll admit it; I got stuck trying to come up with my own constructive proof.) So let me give you the starting point of a proof by contradition. Assume there is a graph G that satisifies the condition about minimum degrees, yet which does not have an appropriate solution. In fact, of all such (hypothetical) graphs that satisfy the degree condition yet don't have a solution, assume that G is one that has the maximum number of edges (thus adding any single additional edge to G would cause there to be a solution). At this point, the question is why there is a contradiction to such a graph existing.
Exercise 22.3-1 on page 610 of CLRS, however you are only to do the table for the case of a directed graph. Along with the required table, please give a very brief explanation for each entry.
For intution, look at Figure 22.4 on page 605, and
focus specifically on the edge (w,y) that becomes a cross edge
by the end of the process. Note that at various times during the
execution of DFS we find the following: steps (a-b) this edge is
colored
Problem 22-1 on page 621 of CLRS
Problem 23-3 on page 640 of CLRS. As an additional hint to part (c), note that the linear-time selection algorithm from Chapter 9 can be used as a black-box to find the median edge weight of a graph in O(E) time.
Exercise 22.3-8 on page 611 of CLRS