hbs6ter - O ( k ( m + n ) log n ) by running Dijkstras...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 473 HBS 6.55 Spring 2009 CS 473: Undergraduate Algorithms, Spring 2009 HBS 6.55 1. Suppose you are given a directed graph G = ( V , E ) with non-negative edge lengths; ( e ) is the length of e E . You are interested in the shortest path distance between two given locations / nodes s and t . It has been noticed that the existing shortest path distance between s and t in G is not satisfactory and there is a proposal to add exactly one edge to the graph to improve the situation. The candidate edges from which one has to be chosen is given by E 0 = { e 1 , e 2,. .., e k } and you can assume that E E 0 = ; . The length of the e i is α i 0. Your goal is figure out which of these k edges will result in the most reduction in the shortest path distance from s to t . Describe an algorithm for this problem that runs in time O (( m + n ) log n + k ) where m = | E | and n = | V | . Note that one can easily solve this problem in
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: O ( k ( m + n ) log n ) by running Dijkstras algorithm k times, one for each G i where G i is the graph obtained by adding e i to G . 2. Let G be an undirected graph with non-negative edge weights. Let s and t be two vertices such that the shortest path between s and t in G contains all the vertices in the graph. For each edge e , let G \ e be the graph obtained from G by deleting the edge e . Design an O ( E log V ) algorithm that nds the shortest path distance between s and t in G \ e for all e . [ Note that you need to output E distances, one for each graph G \ e ] 3. Given a Directed Acyclic Graph (DAG) and two vertices s and t you want to determine if there is an s to t path that includes at least k vertices. 1...
View Full Document

Ask a homework question - tutors are online