The All-Pairs Shortest Path Problem
Jonathan Turner
January 30, 2013
In the all-pairs shortest path problem, we are interested in nding shortest paths between all pairs of vertices. One way to do this is by repeatedly
applying an algorithm for the single-
CS 542 Advanced Data Structures and Algorithms
Quiz 2
Jonathan Turner
2/8/2012
1. (4 points) The credit invariant used in the analysis of the Fibonacci heaps data structure
states that the number of credits on hand must be at least equal to the number of
CS 542 Advanced Data Structures and Algorithms
Quiz 2
Jonathan Turner
2/9/2010
1. (5 points) Draw the residual graph corresponding to the flow shown below. Identify a max
capacity augmenting path for this flow.
cap,flow
2,2
5,3
s
d
4,1
a
3,0
6,2
t
4,1
1,1
CS 542 Advanced Data Structures and Algorithms
Final Exam
Jonathan Turner
5/7/2012
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
CS 542 Advanced Data Structures and Algorithms
Quiz 1
Jonathan Turner
1/25/2012
1. (4 points) The figure below shows the two arrays used to implement a d-heap for some
value of d. That is, h[x] is the item at position x in the heap and key[i] is the key f
CS 542 Advanced Data Structures and Algorithms
Final Exam Solutions
Jonathan Turner
5/12/2010
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 t
CS 542 Advanced Data Structures and Algorithms
Quiz 1
Jonathan Turner
1/26/2010
1. (5 points) Suppose Prims algorithm for minimum spanning trees is executed on a graph
with 100 vertices and 2,000 edges and that the implementation uses a d-heap. For each o
CS 542 Advanced Data Structures and Algorithms
Final Exam Solutions
Jonathan Turner
5/7/2012
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 fol
CS 542 Advanced Data Structures and Algorithms
Final Exam
Jonathan Turner
5/12/2010
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 domin
CS 542 Advanced Data Structures and Algorithms
Exam 2
Jonathan Turner
4/2/2012
1. (15 points) Consider a find operation on the partition data structure in which the find
path has 21 nodes. What is the smallest number of nodes that the partition data struc
CS 542 Advanced Data Structures and Algorithms
Exam 2
Jonathan Turner
4/1/2010
1. (10 points) The diagram below shows a graph and the partition data structure from some
intermediate point in the execution of Kruskals algorithm.
4
a
f
4
6
4
b
2
7
c
g
f
2
e
CS 542 Advanced Data Structures and Algorithms
Exam 2 Solutions
Jonathan Turner
4/2/2012
1. (15 points) Consider a find operation on the partition data structure in which the find
path has 21 nodes. What is the smallest number of nodes that the partition
CS 542 Advanced Data Structures and Algorithms
Exam 1
Jonathan Turner
2/20/2012
1. (10 points) Suppose you are given an edge-weighted graph G and a minimum spanning tree
T of G. Let cfw_u,v be an edge in T. If we increase the weight of cfw_u,v, at some po
CS 542 Advanced Data Structures and Algorithms
Quiz 3
Jonathan Turner
3/2/2010
1. (5 points) In the basic analysis of the partition algorithm, a node x is said to be dominant if
(x) is more than twice (y) for all ancestors y of x. In the tree shown below,
CS 542 Advanced Data Structures and Algorithms
Quiz 5
Jonathan Turner
4/11/2012
1. (5 points) The diagram below shows an intermediate state in the execution of Dinics
algorithm with dynamic trees (the tree edges are shown in bold and the costs are written
Min Cost Flows and Shortest Paths in
Graphs with Negative Edge Lengths
Jonathan Turner
January 17, 2013
In the minimum cost ow problem, we are given a ow graph G =
(V, E) in which each edge has a real-valued cost, in addition to its capacity.
The cost of
Fibonacci Heaps
Jonathan Turner
January 9, 2013
We have seen that the d-heap provides a simple and ecient method for
selecting an item of minimum key from among a set of items. It also allows
us to adjust the key of any item, and for applications where th
The Max Flow Problem
Jonathan Turner
February 6, 2013
Let G = (V, E) be directed graph with a source vertex s, a sink vertex t
and a positive real capacity cap(u, v) for every edge (u, v) (cap(u, v) = 0 if
there is no edge (u, v). We dene a ow on G to be
Matchings in Bipartite Graphs
Jonathan Turner
January 26, 2013
A matching in a graph G = (V, E) is a subset of the edges with no two
edges incident to the same vertex. Figure 1 illustrates matchings in two
graphs, one with edge weights, one without. In th
Shortest Paths in Directed Graphs
Jonathan Turner
January 22, 2013
This note is adapted from Data Structures and Network Algorithms by
Tarjan.
Let G = (V, E) be a directed graphs and let length be a real-valued
function on E. The length of a directed path
Minimum Spanning Trees and d-Heaps
Jonathan Turner
January 9, 2013
This note is adapted from Data Structures and Network Algorithms by
Tarjan.
A spanning tree in a connected, undirected graph is a subtree of the
graph that includes all its vertices. In an
CS 542 Advanced Data Structures and Algorithms
Jonathan Turner
Final Exam Solutions
5/8/2013
1. (10 points) Suppose that r is a root of some tree in a Fibonacci heap. Assume that just before
a deletemin operation, r has no children and that after the dele
CS 542 Advanced Data Structures and Algorithms
Jon Turner
Exam 1 Solution
2/14/2013
1. (10 points) Suppose you are given a graph G=(V,E) with edge weights w(e) and a minimum
spanning tree T of G. Now, suppose a new edge cfw_u,v is added to G. Describe (in
CS 542 Advanced Data Structures and Algorithms
Exam 2 Solution
Jonathan Turner
3/28/2013
1. (12 points) In the final analysis of the partition data structure, suppose that x is a nonsingular node on level 2 and that rank(p(x)=11. What is the largest value
CS 542 Advanced Data Structures and Algorithms
Quiz 6
Jonathan Turner
4/25/2012
1. (6 points) The diagram below shows in intermediate state in the execution of the general
version of the preflow-push algorithm. Show how state changes if in the next three
CS 542 Advanced Data Structures and Algorithms
Quiz 4
Jonathan Turner
3/21/2012
1. (5 points) Consider a findmin operation on a leftist heap with lazy deletion that contains 50
deleted nodes. Findmin calls the purge method which returns a list of heaps. W
CS 542 Advanced Data Structures and Algorithms
Quiz 3
Jonathan Turner
2/29/2012
1. (6 points) In the analysis of the number of find steps performed by the partition data
structure, we defined the function (x) and the concept of a dominant node. In the dia
CS 542 Advanced Data Structures and Algorithms
Exam 1
Jonathan Turner
2/20/2012
1. (10 points) Suppose you are given an edge-weighted graph G and a minimum spanning tree
T of G. Let cfw_u,v be an edge in T. If we increase the weight of cfw_u,v, at some po
CS 542 Advanced Data Structures and Algorithms
Exam 2 Solutions
Jonathan Turner
4/1/2010
1. (10 points) The diagram below shows a graph and the partition data structure from some
intermediate point in the execution of Kruskals algorithm.
4
a
f
4
6
4
b
2
7
CS 542 Advanced Data Structures and Algorithms
Exam 1
Jonathan Turner
2/18/2010
1. (10 points) Prims algorithm can be viewed as applying the blue rule of the general greedy
method n1 times to create a minimum spanning tree. It then implicitly colors the r