Advanced Data Structures & Algorithms: Partition, Fibonacci Heaps, Dual-Key Trees, Max Flo, Exams of Data Structures and Algorithms

Exam questions from a university course on advanced data structures and algorithms. The questions cover topics such as partition data structures, fibonacci heaps, dual-key search trees, and max flows. Students are asked to find numerical bounds, identify dominant nodes, analyze heap structures, and determine the validity of labels in the context of min-cost, max-flow problems.

Typology: Exams

2012/2013

Uploaded on 03/23/2013

saruy
saruy 🇮🇳

4.5

(120)

130 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
- 1 -
a
30
b
29
c
27
d
26
e
20
f
16
g
3
1. (10 points) In the analysis that establishes an O(log log n) bound on the amortized time per
operation for the partition data structure, a node x is defined to be dominant if Δ(x)>2Δ(y)
for all ancestors y of x. Define Δ(x).
The diagram at right shows one tree in a partition data structure; the
numbers represent ranks. Give a numerical lower bound on the
number of nodes in the tree.
List the dominant nodes in the tree.
Suppose a find operation is done at node g. For each non-root node u on the find path that is
not dominant before the find, give the ratio of the new value of Δ(u) to the old value.
CS 542 – Advanced Data Structures and Algorithms
Final Exam
J
onathan Turne
r
5/12/2010
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Advanced Data Structures & Algorithms: Partition, Fibonacci Heaps, Dual-Key Trees, Max Flo and more Exams Data Structures and Algorithms in PDF only on Docsity!

30 a

(^29) b

(^27) c

(^26) d

(^20) e

(^16) f

(^3) g

  1. (10 points) In the analysis that establishes an O (log log n ) bound on the amortized time per operation for the partition data structure, a node x is defined to be dominant if Δ( x )>2Δ( y ) for all ancestors y of x. Define Δ( x ).

The diagram at right shows one tree in a partition data structure; the numbers represent ranks. Give a numerical lower bound on the number of nodes in the tree.

List the dominant nodes in the tree.

Suppose a find operation is done at node g. For each non-root node u on the find path that is not dominant before the find, give the ratio of the new value of Δ( u ) to the old value.

CS 542 – Advanced Data Structures and Algorithms

Final Exam

Jonathan Turner 5/12/

  1. (10 points) In the Fibonacci heap shown below, the numbers are the key values.

How many credits are needed to ensure that the credit invariant used in the amortized analysis is satisfied?

Show the heap that results from performing a deletemin on the heap.

How many credits are needed to maintain the invariant following the deletemin?

a

(^3) b

c 4

d

e

f 7

g

h

i

k j

l

m o p

n 5

q 1

  1. (10 points) The picture below shows an implementation of a dynamic tree, using linked paths represented by binary search trees. Draw the actual tree that this represents (with vertex costs). Assuming the actual tree is being used in a maximum flow computation, what is the residual capacity of the path from s to t in the actual tree. Which edges become saturated if the maximum possible amount of flow is added to this path?

Δ min , Δ cost

b d

e t

a

n

m (^) 3,0 g

i

s f h

k

c

Δ min , Δ cost

b d

e t

a

n

m (^) 3,0 g

i

s f h

k

c

  1. (15 points) In the analysis of the general preflow-push method for max flows, a potential function is used to account for the number of steps in which flow is added to an edge, but the edge is not saturated. The potential function is defined to be the sum of the distance labels of the unbalanced vertices (that is, the vertices that have positive excess flow). Suppose we have a graph with 100 vertices and 1000 edges. Give a numerical upper bound on the value of the potential function and explain your answer.

Explain why every step that adds flow to an edge ( u , v ) without saturating it, causes the potential function to decrease.

How is the potential function affected by a step that adds flow to edge ( u , v ) and saturates it?

Give a big- O bound on the sum of the increases in the potential that could result from all such steps, assuming a graph with n vertices and m edges

How is the potential function affected by a step that changes the label of a vertex u.

Give a big- O bound on the sum of the increases in the potential that could result from all such steps.

  1. (15 points) Suppose we wanted to add the following operation to the dynamic trees data structure. ancestor ( x , y ) returns true if y is an ancestor of x , else false Describe how you could implement this operation using the path set operations and the expose operation.

In the breadth-first scanning algorithm for finding shortest paths, cycles are detected using a pass-counting method. Suppose that we want to detect a negative cycle in the parent pointers at the time the cycle is about to be created? This can be done by checking to see if a vertex x is an ancestor of y in the shortest path tree, whenever we’re about to make x the parent of y. The main loop of the basic version of the breadth-first-scanning algorithm is shown below. Show how you would modify it to use a dynamic tree data structure in place of the parent pointers, and use the ancestor operation to detect a negative cycle.

do queue ≠ [ ] ⇒

v := queue (1); queue := queue [2..];

for [ v , w ] ∈ out ( v ) ⇒

if dist ( v )+ length ( v , w )< dist ( w ) ⇒

p ( w ) := v ;

dist ( w ) := dist ( v )+ length ( v , w );

if w ∉ queue ⇒ queue := queue & [ w ]; fi ;

fi ;

rof ;

od ;

What is the asymptotic running time for this version of the algorithm?

  1. (15 points) Define a k -matching of a bipartite graph to be a subset of its edges that defines a subgraph with maximum degree ≤ k (so, we can view an ordinary matching as a k -matching for k =1). Describe ( in words) an algorithm that can find a maximum size k -matching of any connected, bipartite graph, for any integer k≥ 1 and explain briefly why it works. What is the running time of your algorithm?