Shortest Path Version - Advanced Data Structures and Algorithms - Exam, Exams of Data Structures and Algorithms

Main points of this exam paper are: Shortest Path Version, Advanced Data Structures, Algorithms, Augmenting Path Algorithm, Residual Graph, Paths Sadt, Intermediate State, Edmonds Algorithm, Partition Data Structure, Blossoms

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 -
1. (10 points) In the analysis of the shortest path version of the augmenting path algorithm Ri
was defined to be the residual graph for the flow on the graph following the i-th
augmenting path step. In the flow graph below, assume that the first two steps of the
augmenting path algorithm select the paths sadt and scet.
Draw R2 and label each vertex u with the value of level2(u).
The shortest augmenting path algorithm selects the edges in the augmenting path from a
subset of the edges in Ri. In the example flow graph, which edges are in this set of eligible
edges for R2?
CS 542 – Advanced Data Structures and Algorithms
Final Exam
Jonathan Turner 5/7/2012
s
a
c
b
d
e
t
2
3
2
3
4
5
6
7
6 2 1
5
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Shortest Path Version - Advanced Data Structures and Algorithms - Exam and more Exams Data Structures and Algorithms in PDF only on Docsity!

  1. ( 10 points) In the analysis of the shortest path version of the augmenting path algorithm R i

was defined to be the residual graph for the flow on the graph following the i - th

augmenting path step. In the flow graph below, assume that the first two steps of the

augmenting path algorithm select the paths sadt and scet.

Draw R 2

and label each vertex u with the value of level 2

( u ).

The shortest augmenting path algorithm selects the edges in the augmenting path from a

subset of the edges in R i

. In the example flow graph, which edges are in this set of eligible

edges for R 2

CS 542 – Advanced Data Structures and Algorithms

Final Exam

Jonathan Turner 5/7/201 2

s

a

c

b

d

e

t

  1. (1 0 points) The diagram below shows a partial representation of an intermediate state in the

execution of Edmonds algorithm for maximum size matching.

Identify three blossoms in the graph by drawing closed curves around them. Recall that one

blossom may be contained in another.

Write down the vertex sets defined by the partition data structure at this point in the

execution of the algorithm.

Mark the bridges of the blossoms with a B.

If edge { i,n } is processed next, an augmenting path is found. List the vertices in that

augmenting path.

a

c

b

d

e

g

i

h

j

k

m

o

n

p

x

s

u

t

v

w

  1. (10 points) The diagram below shows an intermediate state in the execution of Dinic’s

algorithm with dynamic trees. The nextedge pointers are indicated by the dots on the edges.

Assume that these start at the “12-oclock” position and rotate clockwise.

Notice that costs have been omitted for vertices b and k. What values should they have?

Assume that in the state shown above, the findpath method is called. What edges are

removed from the dynamic trees data structure during the execution of findpath.

For each of the edges that are removed what flow values are assigned to those edges in the

flow graphs?

What edges are added during the execution of findpath?

For each vertex in the dynamic trees data structure for which the cost changes during the

execution of findpath , what is the new cost value?

g

t

h

i

k

j

a e

b

c

d f

s

_

H

_ H

H

capacity, flow

cost

  1. ( 12 points) The tree shown below is what Tarjan refers to as a virtual tree in the dynamic

trees data structure (that is, it represents the underlying implementation of the abstraction

provided by the data structure). The dynamic trees data structure represents information

about paths with positive residual capacity in a flow graph. In the tree below, assume that s

is the source vertex and t is the sink of the flow graph.

Identify an augmenting path from s to t ; list the vertices in the order they occur in the flow

graph. Hint: think about the “actual tree” represented by this virtual tree.

What is the residual capacity of the augmenting path?

Suppose you did an expose operation at the source node, s. After the expose, which vertices

would be in the same binary search tree as vertex m?

2,

! min ,! cost

b d

e c

a

0,

1,

0,0 0,0 9,

n

t

m

3,

2,

88,

i

s f

h

k

2,

3,

3,

1, 0,

p g

5,

x w

z

3,

2, 0,

  1. (15 points) In the analysis of the FIFO variant of the 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 maximum 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.

In the analysis, we defined a phase to end when all the vertices on the queue at the start of

the phase have been processed. Explain why every phase that contains no relabeling

operation, causes the potential function to decrease.

Consider a step that adds flow to an edge ( u , v ) and saturates it. Can such a step cause the

potential function to increase? Why or why not?

Consider a step that relabels a vertex. Can such a step cause the potential function to

decrease? Why or why not?

Give an upper bound on the sum of the increases in the potential that could result from all

steps that relabel a vertex.

  1. (12 points) The graph at left below has negative length edges. In the diagram at right, give

transformed edge lengths that preserve the relative lengths of shortest paths.

Let G be an arbitrary graph with negative length edges and let length ’( u , v ) be the

transformed edge length for ( u , v ). Suppose p is a path from x to y with length ( p )= 3 and

length ’( p )=7. If q is another path from x to y with length ( q )=3, what is length ’( q )?

In the min-cost augmenting path algorithm (for the min-cost flow problem) using

transformed edge costs, a new shortest path tree is computed during each step, and the

shortest path distances are used to modify the edge costs. What is the total cost of the edges

in the shortest path tree, using the newly modified costs? Explain.

e

b d

f

a c

e

b d

f

a c