Homework Assignment 10
Due: Apr. 20 before class starts
Assignment
-
(40 points) A graph
G
is bipartite if its vertices can be partitioned into two setsX
andY
such that every edge inG
has one end vertex inX
and the other inY
. Design and analyze an efficient algorithm for determining if an undirected graphG
is bipartite (without knowing the setsX
andY
in advance).- Provide and explain pseudocode
- Statement and proof of time complexity
- Statement and proof of memory complexity
-
(30 points) Show that if all the weights in a connected weighted graph
G
are distinct, then there is exactly one minimum spanning tree forG
. Provide a statement and proof. Hint: Use proof by contradiction. -
(30 points) NASA wants to link
n
stations spread over the country using communication channels. Each pair of stations has a different bandwidth available, which is known a priori. NASA wants to selectn - 1
channels (the minimum possible) in such a way that all the stations are linked by the channels and the total bandwidth (defined as the sum of the individual bandwidths of the channels) is maximum. Give an efficient algorithm for this problem and analyze its worse-case performance. Consider the weighted graphG = (V, E)
, whereV
is the set of stations andE
is the set of channels between the stations. Define the weightw(e)
of an edgee
inE
as the bandwidth of the corresponding channel.- Provide and explain pseudocode
- Statement and proof of time complexity
- Statement and proof of memory complexity
-
Bonus.
(10 points) An old MST method, called
Barůvka's algorithm, works as follows on a
graph
G
havingn
vertices andm
edges with distinct weights:
LetT
be a subgraph ofG
initially containing just the vertices inV
.
whileT
has fewer thann - 1
edges do
for each connected componentCi
ofT
do
Find the lowest-weight edge(v, u)
inE
withv
inCi
andu
not inCi
.
Add(v, u)
toT
(unless it is already inT
).
returnT
Argue why this algorithm is correct and why it runs inO(m log n)
time.
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).