0% found this document useful (0 votes)
203 views1 page

HW 4a PDF

This document provides instructions for homework on data structures and algorithms. It includes 4 problems related to shortest path algorithms on graphs. Problem 1 asks to find the most reliable path between all pairs of vertices in a graph where edge reliabilities are probabilities. Problem 2 asks to check if a given shortest path tree corresponds to a graph with non-negative edge weights. Problem 3 modifies the Bellman-Ford algorithm to handle negative weight cycles. Problem 4 asks for an algorithm to find the vertices in a negative weight cycle.

Uploaded by

Pulkit Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
203 views1 page

HW 4a PDF

This document provides instructions for homework on data structures and algorithms. It includes 4 problems related to shortest path algorithms on graphs. Problem 1 asks to find the most reliable path between all pairs of vertices in a graph where edge reliabilities are probabilities. Problem 2 asks to check if a given shortest path tree corresponds to a graph with non-negative edge weights. Problem 3 modifies the Bellman-Ford algorithm to handle negative weight cycles. Problem 4 asks for an algorithm to find the vertices in a negative weight cycle.

Uploaded by

Pulkit Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ESO207A: Data Structures and Algorithms

Homework 4a: Shortest Paths Due Date: 6 November 2017

Instructions.

1. Start each problem on a new sheet. For each problem, Write your name, Roll No., the problem
number, the date and the names of any students with whom you collaborated.

2. For questions in which algorithms are asked for, your answer should take the form of a short
write-up. The first paragraph should summarize the problem you are solving and what your
results are (time/space complexity as appropriate). The body of the essay should provide the
following:

(a) A clear description of the algorithm in English and/or pseudo-code, where, helpful.
(b) At least one worked example or diagram to show more precisely how your algorithm
works.
(c) A proof/argument of the correctness of the algorithm.
(d) An analysis of the running time of the algorithm.

Remember, your goal is to communicate. Full marks will be given only to correct solutions
which are described clearly. Convoluted and unclear descriptions will receive low marks.

Problem 1. CLRS 24.3-6 Given a directed weighted graph G = (V, E), where each edge (u, v) E
has an associated value r(u, v) which is a real number 0 r(u, v) 1 that represents the reliability
of the communication channel from vertex u to vertex v. We interpret r(u, v) as the probability
that the channel from u to v will not fail and we assume that these probabilities are independent.
Give an O((|V | + |E|) log(|V |) time algorithm to find the most reliable path from a given source
vertex to all the other vertices in V . Argue the modelling of your problem carefully and hence the
complexity of your algorithm. (You do not have to restate or redo any algorithm already done in
the class).
Problem 2. Let G = (V, E) be a given weighted, directed graph with non-negative edge weights.
You are given a table of claimed shortest path distances u.d and predecessor u. for each u V .
Can you check in O(|V | + |E|) time whether the d and values correspond to some shortest path
tree? Is the condition of non-negative edge weights really necessary?
Problem 3. CLRS 24.1-4 Modify the Bellman-Ford algorithm so that it sets v.d to for all
vertices v for which there is a negative-weight cycle on some path from the source to v.
Problem 4. CLRS 24.1-6 Given a weighted, directed graph G = (V, E) with a negative weight
cycle. Give an efficient algorithm (O(|V | |E|) time) to list the vertices of one such cycle. Prove
that your algorithm is correct.

You might also like