## Homework 11

### Due Thursday, November 13, 2014

1. Negative cost edges. Suppose that we have a graph with negative cost edges, but no negative cost cycles. Does this algorithm work to find the shortest path? First find the edge with the most negative weight. Call this weight W. Modify the original graph G by adding W to every edge's weight. Call the new graph G'. Since there are no negative weight edges in G', we can use Dijkstra's algorithm on G' and report the shortest path found as the shortest path in G. Explain whether this algorithm works or does not work.

2. "Short" shortest paths. Suppose that you are guaranteed that the shortest paths in a weighted, directed graph G are actually "short". In particular, you know that the shortest path (by weight) between any two vertices in G has no more than k vertices. Describe an algorithm that finds a shortest path between two given vertices in G in O( k E ) time. Briefly justify the correctness and running time of your algorithm.

3. Arbitrage. Problem 24-3, page 679.