Design and Analysis of Algorithms
Graph Algorithms
July 19, 2008
1. If
P
is a path in a weighted graph
G
, let
maxweight
(
P
)
be the maximum of all the weights of the
edges in
P
.
Give a polynomialtime algorithm to solve the following problem:
Given an undirected graph whose edges have positive integral weights, and two distinct vertices
s
and
t
, among all
s

t
paths
P
find one for which
maxweight
(
P
)
is minimized. (This is a
bottleneck
shortest
s

t
path
.)
2. Let
G
be a connected graph whose edges have positive integral weights. A
minimum product spanning
tree
is a spanning tree in
G
, for which the
product
of the edge weights in minimized.
Give a polynomialtime algorithm that finds a minimum product spanning trees in a given connected,
weighted graph. Hint: Think logarithms, but you cannot actually use them in the final algorithm, since
computers cannot exactly manipulate irrational numbers like logarithms.
3. Prove that a graph is bipartite if and only if it has no odd cycles.
4. Give an algorithm running in time
O
(
m
+
n
)
for finding the distance from
s
to every other vertex in
an undirected graph, all of whose edges have weight 1 or 2.
5. Look at problem one to find the definition of a matching. A
maximum matching
is one of maximum
cardinality. Prove that the following algorithm correctly finds a maximum matching in a forest
F
:
If
F
has no edges, output the empty set and halt. Otherwise, let
v
be a leaf in
F
, let
u
be its neighbor
and let
e
=
{
u, v
}
. Let
F
0
be the forest obtained by deleting both
v
and
u
(and all incident edges)
from
F
. Recursively find a maximum matching
M
0
in
F
0
, and output
M
0
∪ {
e
}
.
6. Consider bipartite graphs of the following special form:
 the vertex set is
{
x
1
, ..x
n
}
(boys),
{
y
1
, ...y
n
}
(girls).
 if
(
x
i
, y
j
)
is an edge, there are no edges of the form
(
x
u
, y
v
)
with both
u > i
and
v < j
.
A
matching
is a set of edges, no two of wich are incident on the same vertex. Design an algorithm
that finds a maximum cardinality matching in linear time.
7.
Edgedisjoint paths
a
Given an undirected graph
G
=
V, E
and two distinguished nodes,
s
and
t
, describe an algorithm
that finds a maximumsized set of edgedisjoint paths from
s
to
t
. (We say that two paths are
edge

disjoint
if they don’t share a common edge, even though they are allowed to go through
the same vertex.) Give a time analysis for your algorithm in terms of

V

and

E

.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
b
Given a solution to (a), suppose we add one more edge to the graph. Give an efficient algorithm for
updating the solution. Give a time analysis for your algorithm in terms of

V

and

E

. (Your
algorithm should be significantly faster than redoing the entire problem from scratch.)
8.
Special cases of shortest paths
Problem
You need to solve all pairs longest paths (
i.e.
total delays) for a VLSI application. The input
graphs are
DAG
s where each node has indegree at most 2. The edge lengths are all either 1 or
2. What algorithm and which data structures would you use? What is the time complexity of the
algorithm for these instances?
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '08
 staff
 Algorithms, Graph Theory, Planar graph, Bipartite graph

Click to edit the document details