Bonus Homework Assignment 11


Due: Apr. 27 by 5pm


Assignment

This is a no penalty assignment which will replace your lowest homework grade.

  1. (50 points) Show how to modify the pseudocode for Dijkstra's algorithm for the case when the graph is directed and we want to compute shortest directed paths from the source vertex to all other vertices.
    1. Provide and explain pseudocode
    2. Statement and proof of time complexity
    3. Statement and proof of memory complexity
  2. (50 points) Consider the following greedy strategy for finding a shortest path from vertex start to vertex goal in a given connected graph.
    1. Initialize path to start.
    2. Initialize VisitedVertices to {start}.
    3. If start=goal, return path and exit. Otherwise, continue.
    4. Find the edge (start,v) of minimum weight such that v is adjacent to start and v is not in VisitedVertices.
    5. Add v to path.
    6. Add v to VisitedVertices.
    7. Set start equal to v and go to step 3.
    Does this greedy strategy always find a shortest path from start to goal? Provide a statement and proof of correctness (or counter proof by example).
  3. Bonus. (10 points) Tamarindo University and many other schools worldwide are doing a joint project on multimedia. A computer network is built to connect these schools using communication links that form a free tree. The schools decide to install a file server at one of the schools to share data among all the schools. Since the transmission time on a link is dominated by the link setup and synchronization, the cost of a data transfer is proportional to the number of links used. Hence, it is desirable to choose a "central" location for the file server. Given a free tree T and a node v of T, the eccentricity of v is the length of a longest path from v to any other node of T. A node of T with minimum eccentricity is called a center of T .
    1. Design an efficient algorithm that, given an n-node free tree T, computes a center of T.
      1. Provide and explain pseudocode
      2. Statement and proof of time complexity
      3. Statement and proof of memory complexity
    2. Is the center unique? If not, how many distinct centers can a free tree have? Provide a statement and proof.


General Instructions, Turning in assignments, and Grading

General Instructions

Turn in Instructions

Each assignment will be turned in in class (hard copy). Assignments are due BEFORE, let me repeat, before class starts. This does not mean five minutes after class starts. Details:

Points