Docsity

Fibonacci heap - Advanced Data Structures and Algorithms - Exam, Exams of Data Structures and Algorithms

Toggle sidebar
bg1
- 1 -
Be neat and concise, but complete.
1. (5 points) The figure below shows a single Fibonacci heap. The numbers next to the nodes
are the key values. The ranks are not shown. Show how the heap structure changes
following a deletemin operation. Perform the linking steps from left to right – that is always
combine the leftmost pair of trees that are “eligible” to be combined.
CS 542 – Advanced Data Structures and Algorithms
Exam 2
J
onathan Turne
r
11/1/05
k3
e5
d2
a7q6
l8
i9
f 10 g12
h13
p3
o6b7
n8
m4
r5
j7
c9
k3
k3
e5
e5
d2
a7
d2
d2
a7
a7q6
l8
q6
q6
l8
l8
i9
f 10
i9
i9
f 10
f 10 g12
h13
g12
g12
h13
h13
p3
o6
p3
p3
o6
o6b7
n8
b7
b7
n8
n8
m4
r5
m4
m4
r5
r5
j7
c9
j7
j7
c9
c9
pf3
pf4
pf5

Partial preview of the text

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

Be neat and concise, but complete.

  1. (5 points) The figure below shows a single Fibonacci heap. The numbers next to the nodes

are the key values. The ranks are not shown. Show how the heap structure changes following a deletemin operation. Perform the linking steps from left to right – that is always combine the leftmost pair of trees that are “eligible” to be combined.

 - Exam CS 542 – Advanced Data Structures and Algorithms 
  • Jonathan Turner 11/1/ - d 2 e^5 k - a 7 q - l - i - f 10 g - h - p
    • o 6 b - n - m - r - j - c - d 2 ee^55 kk - a - dd - aa 77 q - l - qq - ll - i - f - ii - ff 1010 g - h - gg - hh
      • p
    • o
      • pp
    • oo 66 b - n - bb - nn - m - r - mm - rr - j - c - jj - cc
  1. (10 points) Consider the graph shown below. Suppose we apply the general scanning and labeling method for shortest paths to this graph.

If the vertices are scanned in topological order, what is the total number of times that a vertex is scanned?

Suppose the vertices are scanned in the most inefficient possible order. How many times are vertices scanned in this case? Explain.

Generalize the example to show that the scanning and labeling method can take Ω(2 n ) time in the worst-case.

d e

a

f

g

b

h

i

c

j
j

d e

a

f

g

b

h

i

c

j

  1. (15 points) Let G be a directed graph with each edge ( u , v ) having a non-negative capacity , cap ( u , v ). The bottleneck capacity of a path in G is the minimum capacity of one of its edges and a best bottleneck capacity path is one with the largest bottleneck capacity. A best bottleneck path tree is a spanning tree of G whose paths are best bottleneck paths.

Let T be a spanning tree of G with root s and let bcap ( u ) be the bottleneck capacity of the path from s to u in T. Show that if T is a best bottleneck path tree, then bcap ( v )≥min{ bcap ( u ), cap ( u , v )}, for all edges ( u , v ) in G.

Show that if there is a non-tree path p from s to some vertex x , that has bottleneck capacity larger than bcap ( x ), then there must be some edge ( u , v ) for which bcap ( v )<min{ bcap ( u ), cap ( u , v )}.

  1. (10 points) Consider an execution of the capacity scaling version of the augmenting path algorithm for maximum flows. Suppose that we’re at the start of a scaling phase, in which the scaling parameter is equal to 100, and that X is the set of all vertices that can be reached from the source vertex s , by paths with capacity of at least 200. Let X ′ be the set containing all other vertices.

Give an upper bound on the residual capacity of an edge with one endpoint in X and the other in X ′. Justify your answer.

Suppose there are 40 edges that cross the cut ( X , X ′) that have residual capacity of at least 100 (from the endpoint in X to the endpoint in X ′). Give an upper bound on the number of augmenting paths that can be found before the end of this scaling phase. Justify your answer.

Suppose that in the original graph, all edge capacities are multiples of 25 and that the largest edge capacity is 400. Give an upper bound on the number of scaling phases in which at least one augmenting path is found. Justify your answer.

  1. (10 points) The figure below shows an intermediate state in the execution of Dinic’s algorithm with dynamic trees. In the picture of the flograph, the adjacency lists are indicated by the arcs connecting the edges at each vertex, and the solid circles indicate the position of the nextedge pointers in the adjacency lists. So for example, nextedge ( c )=( b , c ) and nextedge ( g )=( g , i ) .The dynamic trees data structure is shown at right.

What is the flow on edge ( e , h )?

What is the residual capacity of edge ( f , t )?

Show the state of the dynamic trees data structure at the point the next search for an augmenting path reaches the sink. Be sure to show all the node costs.

Show the changes to the flow values in the flograph data structure after flow is added to the augmenting path found by this search. You may just mark the changes on the diagram above.

g H

s 2

c 3 b^4

d 4

e 2

f H

i

capacity, f low

c

d g

b e

t

f
i
h
h

1 h^1

t H

nextedge level

gg HH

ss 22

cc 33 bb^44

dd

ee 22

ff HH

ii

capacity, f low

c

d g

b e

t

f

i

h

1 hh^11

tt HH

nextedge level