CSCI 256

Only turn in problems from the second section.
Problem 27.21 on page 599 of the text.
You head a major political party in the 2004 presidential election. Once again there are problems in Florida. You desperately need to get as many lawyers from New York to Tallahassee as you can by the end of the day. You have a schedule F of n flights available to you today. An entry F_{i} in this schedule is described by five values F_{i} = (s_{i}, t_{i}, d_{i}, a_{i}, c_{i}):
Give an efficient algorithm that will find a way to get the most lawyers as possible from new York to Tallahassee via airplane. You may assume that all flights run precisely on time (hah!), and that transfers between flights are instant (i.e., if a_{i} ¾ d_{i} then it is possible for one lawyer to take flight i and then flight j). Be sure to argue correctness and analyze the running time of your algorithm.
Hint: Transform the schedule into a maxflow instance, then solve the maxflow instance. Let the nodes be pairs of cities and times. Flights give some of the edges, but others arise from nodes representing the same cities, but different times. In your solution, be sure to describe the flow network carefully and illustrate it with an example. You may use any maxflow algorithm as a black box.
In the midterm you learned how to set up a roundrobin tournament. Now we'd like to rank the players. Assume that a roundrobin tournament is played among n players. That is, each player plays once against all n1 other players. There are no draws, and the results of all games are given in a matrix. It is not possible in general to sort the players, since A may beat B, B may beat C, and C may beat A (in other words, the results are not necessarily transitive). We are interested in a "weak" sorting as follows. Design an algorithm to arrange the players in an order P_{1}, P_{2}, ..., P_{n} such that P_{1} beat P_{2}, P_{2} beat P_{3}, and so on (concluding with P_{n1} beating P_{n}) given the matrix of results. The worstcase running time of the algorithm should be O(n lg n). (You may assume that any entry in the matrix can be accessed in constant time.) Hint: Think divide and conquer. Also note that the solution to this problem does not depend on anything covered recently in class. (I assigned it as a warmup for the next problem!)
Consider the preceding problem in this assignment (ranking the players in a roundrobin tournament).
Show that any algorithm for the ranking players problem can be used to sort n numbers. Thus sorting reduces to the ranking players problem. Hint: Interpret the ordering of the numbers as giving the results of playing a "match" between the two numbers.
Use the results of part (a) to show that Omega(n lg n) is a lower bound for the time of any algorithm to solve the ranking players problem on a set of n players. Hint: Suppose you could solve the ranking players problem in time less than n lg n, what would that tell you about a lower bound for sorting.
Back to:
kim@cs.williams.edu