hw7 - vertices in set S after each iteration of the while...

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

View Full Document Right Arrow Icon
1 CMPS 101 Summer 2009 Homework Assignment 7 1. (1 Point) Let ) ( G V x and suppose that after INITIALIZE-SINGLE-SOURCE( G , s ) is executed, some sequence of calls to Relax( ) causes ] [ x d to be set to a finite value. Then G contains an s - x path of weight ] [ x d . (Hint: Use induction on the length of the Relaxation sequence, and recall that this result was proved in class.) 2. (1 Point) p.591: 24.1-3 Given a weighted, directed graph ) , ( E V G = with no negative-weight cycles, let m be the maximum over all pairs of vertices V v u , of the minimum number of edges in a shortest path from u to v . (Here, the shortest path is by weight, not the number of edges.) Suggest a simple change to the Bellman-Ford algorithm that allows it to terminate in 1 + m passes. 3. (1 Point) p.600: 24.3-1 Run Dijkstra’s algorithm on the directed graph of Figure 24.2, first using vertex s as the source and then using vertex z as the source. In the style of Figure 24.6, show the d and π values and the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: vertices in set S after each iteration of the while loop. 6 3 2 1 4 2 7 5 3 6 4. (1 Points) p.600: 24.3-4 We are given a directed graph ) , ( E V G = on which each edge E v u ∈ ) , ( has an associated value ) , ( v u r , which is a real number in the range 1 ) , ( ≤ ≤ v u r that represents the reliability of a communication channel from vertex u to vertex v . We interpret ) , ( v u r as the probability that the channel from u to v will not fail, and we assume that these probabilities are independent. Give an efficient algorithm to find the most reliable path between two given vertices. 5. (1 Point) p.613: 24.5-4 Let ) , ( E V G = be a weighted, directed graph with source vertex s and let G be initialized by INITIALIZE-SINGLE-SOURCE( G , s ). Prove that if a sequence of relaxation steps sets ] [ s to a non-NIL value, then G contains a negative-weight cycle. s y t z x...
View Full Document

This note was uploaded on 12/03/2009 for the course CS CS101 taught by Professor Agoreback during the Spring '09 term at American College of Gastroenterology.

Ask a homework question - tutors are online