Thursday, February 9, 2006
Wednesday, February 15, 2006
- Please review the
- You must write down with whom you worked on the assignment. If this
changes from problem to problem, then you should write down this
information separately with each problem.
- Numbered problems are all from the textbook Network Flows .
- Problem 4.20. Shorst path conditions.
- Problem 5.8. Shortest paths with arbitrary data.
- Problem 4.34, Problem 4.36. K-shortest paths.
- Suppose that we order the edge relaxations in each pass of the
Bellman-Ford algorithm as follows. Before the first pass, we assign
an arbitrary linear order v1,v2,...,vn
to the vertices of the input graph.
Then, we partition the edge set E into Ef and Eb, where Ef are the forward edges, i.e. the ones of the form (vi,vj) with i < j and
Eb, the backwards edges, i.e. the ones of the form (vi,vj) with i> j.
Define Gf=(V,Ef) and Gb=(V,Eb).
- Prove that Gf is acyclic with topological sort v1,v2,...,vn and
that Gb is acyclic with
topological sort vn,vn-1,...,v1
Suppose that we implement each pass of the Bellman-Ford
algorithm in the following way. We visit each vertex in the order
v1, v2, ... , vn, relaxing edges of Ef that leave
the vertex. We then visit each vertex in the order vn,
vn-1, ..., v1, relaxing edges of Eb that leave the vertex.
Prove that with this scheme, if G contains no
negative-weight cycles that are reachable from the source vertex s
then after only ceiling(n/2) passes over the edges, d(v) is the correct
shortest path distance for each vertex v.
- Does this scheme improve the asymptotic running time of
the Bellman-Ford algorithm?