Question: 1 . ( a ) For a graph G , consider two edge - weight functions w 1 and w 2 such that w 1
a For a graph G consider two edgeweight functions w and w such that
we we
we we
for all edges e e E Show that T is an MST wrt w iff it is an MST wrt wIn other words, only the
sorted order of the edges matters for the MST
b Suppose graph G has integer weights in the range W where W Let Gi be the edges of weight
at most i and i be the number of components in Gi
Then show that the MST in G has weight exactly
n W
PW
i i
c Show that if the edge weights are all distinct, there is a unique MST
a Show how to implement the contract subroutine in Om time. This algorithm takes as input a graph
G V E with some edges colored blue, and outputs a new graph G V
E
in which vertices vC V
correspond to blue connected components C in G there are no selfloops, and there is a single edge
eC vC vC if there exists some edge between the corresponding components C C
in G and the weight
of edge vC vC is given by min
xyE:xCyC
wxy
b We proved in class that Boruvka reduces the number of nodes by a constant factor in each round, but what
about the number of edges? Show an example of a graph with n nodes and m edges where the number of
edges in Gi remains m for log n rounds, even after cleaning up
c Design an Om log log ntime algorithm to find MST using algorithmsdatastructures you have seen in the
lectures.
We will design yet another Om log log ntime MST algorithm, but without using any fancy datastructures: in
Boruvkas algorithm we scan all the edges in the graph in each pass, and we should avoid this repetition. Assume
that G is a connected simple graph, and edge weights are distinct.
a Suppose for each vertex, the edges adjacent to that vertex are stored in increasing order of weights. Show
a slight variant of Boruvkas algorithm with runtime Om n log n
bkpartial sorting Given a parameter k and a list of N numbers, give an ON log ktime algorithm that
partitions this list into k groups g g gk each of size at most Nk so that all elements in gi are
smaller than those in gi for each i
c Adapt your algorithm from part a to handle the case where the edges adjacent to each vertex are not
completely sorted but only kpartiallysorted. Ideally, your runtime should be Om
m
k
log n n log n
d Use the two parts above setting k log n preceded by some additional rounds of Boruvka, to give an
Om log log ntime MST algorithm.
Recall that Dijkstras algorithm computes the singlesource shortestpath SSSP correctly for directed graphs
with nonnegative edgelengths. For graphs with negativelength edges, we use typically the BellmanFord or
FloydWarshall algorithms. Let us explore what happens if we use Dijkstras algorithm instead. Assume that
the graph does not have negativelength cycles.
a Show an example of a graph with negative edgelengths where Dijkstras algorithm returns the wrong
shortestpath distance from the source s For your reference, we give Dijkstras algorithm in algorithm
Algorithm : Dijkstras Algorithm
Ds Dv for all v s
run DijkstraIteration
Algorithm : DijkstraIteration
unmark all nodes
while not all vertices marked do
u unmarked vertex with least label Du
mark u
for all outedges uv of u do
Du minDv Du lu v
end
end
b Now suppose we iterate through Dijkstras algorithm K times shown formally as under Consider any
node v such that the shortestpath from s to node v contains at most K negativelength edges. Show
that the final value of the label Dv equals the length of this shortest sv path.
Algorithm : KFold Dijkstras Algorithm
Ds Dv for all v s
for i K do
run DijkstraIteration
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
