Bonus Homework Assignment 11
Due: Apr. 27 by 5pm
Assignment
This is a no penalty assignment which will replace your lowest homework grade.
-
(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.
- Provide and explain pseudocode
- Statement and proof of time complexity
- Statement and proof of memory complexity
-
(50 points) Consider the following greedy strategy for finding a shortest
path from vertex
start
to vertexgoal
in a given connected graph.- Initialize
path
tostart
. - Initialize
VisitedVertices
to {start
}. - If
start
=goal
, returnpath
and exit. Otherwise, continue. - Find the edge (
start
,v
) of minimum weight such thatv
is adjacent tostart
andv
is not inVisitedVertices
. - Add
v
topath
. - Add
v
toVisitedVertices
. - Set
start
equal tov
and go to step 3.
start
togoal
? Provide a statement and proof of correctness (or counter proof by example). - Initialize
-
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 nodev
ofT
, the eccentricity ofv
is the length of a longest path fromv
to any other node ofT
. A node ofT
with minimum eccentricity is called a center ofT
.- Design an efficient algorithm that, given an
n
-node free treeT
, computes a center ofT
.- Provide and explain pseudocode
- Statement and proof of time complexity
- Statement and proof of memory complexity
- Is the center unique? If not, how many distinct centers can a free tree have? Provide a statement and proof.
- Design an efficient algorithm that, given an
General Instructions, Turning in assignments, and Grading
General Instructions
- All homework assignments must be typeset using LaTex. Using another program (e.g., Microsoft Word) or handwriting assignments will result in grade of 0. Here is an example homework problem worked out to see the expected format and the tex file that generated it to help you start.
- If you are unfamiliar with LaTex, here is a short tutorial and the tex file that generated it. This tutorial shows how to write common mathematics, how to write pseudocode, how to cite sources, how to include images, and how to include tables.
- Use pseudocode and good mathematical style to describe algorithms and data structures. Do not specify Java code unless otherwise stated. Described more in example homework document above.
- Complete every part of every problem!
- Follow turn-in instructions precisely.
- Failure to complete any of these steps will result in a significant loss of points.
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:
- The first page of your hard copy must be a signed coverpage.
- Next put the problems in order as described in the description. This may seem silly but you would be surprised sometimes.
- If you do not know how to print you may have to consult University of Richmond webpages to learn how to use campus printers. If possible, please print 2-sided.
- Staple all pages together.
- Turn in packet before class begins.
- I reserve the right to assign a 0 to any assignment failing to comply with these instructions. Even for something as small as a missing staple.
Points
- Each assignment is graded out of 100 points (not including bonus).
- Criteria and point distribution (This distribution is a general guideline
that may change depending on the specific problem - exceptions for example
include but are not limited to proof-only problems.)
- Approximately 50% on a problem is devoted to the algorithm. This includes items like describing a correct and efficient algorithm, using proper and clear pseudocode, and describing your algorithm clearly.
- Approximately 25% on a problem is devoted to time complexity. This includes stating a lemma or theorem of your result and providing a proof and justification of the result.
- Approximately 25% on a problem is devoted to memory complexity. This includes stating a lemma or theorem of your result and providing a proof and justification of the result.
- If the problem is simply a proof, 100% is split between a proper statement (lemma or theorem) of the result and proving a clear and concise proof of the result.
- You can receive points off for not following formatting guidelines.
- If there are any discrepencies in grades please see the instructor during his office hours or by appointment (do not discuss with the lab assistants or graders).