Kruskal Algorithm - Advanced Data Structures and Algorithms - Exam, Exams of Data Structures and Algorithms

Main points of this exam paper are: Advanced Data Structures, Algorithms, Kruskal's Algorithm, Intermediate Point, Partition Data Structure, Kruskal's Algorithm, Alternate Version, Partition Data Structure, Executed, Intermediate State

Typology: Exams

2012/2013

Uploaded on 03/23/2013

saruy
saruy 🇮🇳

4.5

(120)

130 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
- 1 -
1. (10 points) The diagram below shows a graph and the partition data structure from some
intermediate point in the execution of Kruskal’s algorithm.
Which edges in the graph are in the partial MST solution computed so far?
In the partition data structure, what is the rank(a)?
What is the rank(e)?
Consider an alternate version of Kruskal’s algorithm that does not use the partition data
structure. Instead, when considering an edge {u,v} it does a tree traversal in the current
“blue tree” containing vertex u and checks to see if v is in the tree. Give a big-O bound on
the running time of this version of Kruskal’s algorithm and explain why the running time
can be as bad as your bound.
f
a
c
b
d
e
g
1
7
4
3
4
14
3
624
5
h
i
5
1
3
2
f
a
c
b
d
e
g
h i
CS 542 – Advanced Data Structures and Algorithms
Exam 2
J
onathan Turne
r
4/1/2010
pf3
pf4
pf5

Partial preview of the text

Download Kruskal Algorithm - Advanced Data Structures and Algorithms - Exam and more Exams Data Structures and Algorithms in PDF only on Docsity!

  1. (10 points) The diagram below shows a graph and the partition data structure from some intermediate point in the execution of Kruskal’s algorithm.

Which edges in the graph are in the partial MST solution computed so far?

In the partition data structure, what is the rank ( a )?

What is the rank ( e )?

Consider an alternate version of Kruskal’s algorithm that does not use the partition data structure. Instead, when considering an edge { u , v } it does a tree traversal in the current “blue tree” containing vertex u and checks to see if v is in the tree. Give a big- O bound on the running time of this version of Kruskal’s algorithm and explain why the running time can be as bad as your bound.

f

a

c

b

d

e

g

h

i

f

a

c

b

d

g e

h i

CS 542 – Advanced Data Structures and Algorithms

Exam 2

Jonathan Turner 4/1/

  1. (12 points) In the final analysis of the partition data structure, suppose that x is a non- singular node on level 2 and that rank ( p ( x ))=11. What is the largest value that rank ( x ) can have? Explain.

Now suppose that a find operation is executed and that x is one of the vertices on the “find path”. Give a lower bound on the value of rank ( p ( x )) after the find operation completes (your lower bound should be as large as possible and still be valid). Explain your answer.

Is x still on level 2 after the find operation completes? Explain your answer.

  1. (10 points) The diagram below shows an intermediate state in the execution of the round- robin algorithm. The partition data structure P is just shown as a collection of subsets. The leftist heaps are shown as sets of edges. The tree edges are not shown explicitly.

Which edges are in the partial MST that has been found so far?

In the heap h ( d ), which edges would be considered “deleted” by the round-robin algorithm?

Suppose that h ( d ) is the first item on the list used by the round-robin algorithm. What is the next edge added to the tree?

P : { a , f } { b , c } { e , h , j } { d , g , i , k , m }

h ( a ) = { af,fc,ab,ad }

h ( c ) = { cf,bc,ch,ab,bd,be }

h ( e ) = { eh,ej,be,eg,ej,ch,jh,ij }

h ( d ) = { ad,bd,dg,dk,eg,gi,gk,ij,im,km }

f

a

c

b

d

e

g

h

i

j

m

k 2 5

  1. (10 points) State the credit invariant used in the analysis Fibonacci heaps.

Consider the node x and its children y 1 ,..., y 5 in the portion of the Fibonacci heap shown below.

Assume that x has never lost any children and that y 1 was the first to become a child of x , followed by y 2 , y 3 and so forth. Which children of x must have a mark bit that is set? Explain your answer.

y 3

x

y 1 y 2 y 3 y 4 y 5

x

y 1 y 2 y 3 y 4 y 5

x

y 1 y 2 y 4 y 5

  1. (8 points) Suppose you are given a unit network and that you run both the “original” version of Dinic’s algorithm and the version that uses dynamic trees. Which do you expect would run faster? Explain your answer.