Course Home | Assignments | Schedule & Lecture Notes

Saint Louis University

Computer Science 3100
Algorithms

Michael Goldwasser

Fall 2016

Dept. of Computer Science

Homework Assignment 04

MST, Shortest Paths


Overview

Topics: MST, Single-source Shortest Paths
Related Reading: Chapters 23, 24 of CLRS
Due: Tuesday, November 8, 2016 (by appointment)
Click here for presentation schedule


Oral Presentation Guidelines

This will be an unconventional assignment in that you will not be submitting written solutions for these problems. Instead, you will work with a group to prepare for orally presenting your solutions to the instructor. Students should work in groups of at most three students (with three being the ideal group size). Each group must present three of the following four problems. We will allow the group to eliminate one of the four problems a priori. The instructor will then randomly assign the remaining three problems to individual members of the group. Therefore, each individual of the group must be well versed and prepared to present any of the remaining problems.

Click here for additional details of the presentation procedures.


Problems to be presented (33⅓ points each)

  1. Assume that you have an undirected, weighted graph G=(V,E) with positive edge weights, and that you have a tree T that is known to be a minimum-spanning tree for G.

    Now assume that the weight of one particular edge (u,v) of the graph is changed (its weight might be increased or decreased, and that edge may or may not be part of tree T). Describe an efficient algorithm that determines whether or not T remains an MST for the new graph G', and if not, computes a new tree T' that is an MST for G'.

  2. Dijkstra's algorithm is used to compute single-source shortest paths in graphs with nonnegative edge weights. Its basic operations are to create a priority queue with V entries, to have V calls to the EXTRACT-MIN operation, and at most E calls to the DECREASE-KEY operation. When using a Fibonacci Heap, the worst-case running time of Dijkstra's algorithm is O(E + V lg V).

    Show that if all edge weights of a graph are integers in the range from 1 to W, for some fixed W, then a custom implementation of a priority queue data structure can be used to allow Dijkstra's algorithm to run in time O(E + VW).

    Note: You are NOT to change Dijkstra's algorithm per se. You are only to design a new concrete implementation for the priority queue abstraction, which allows the existing algorithm to achieve the stated time bound. (Hint: think about the limited set of priority values that will be seen as the algorithm runs.)

  3. For this problem, assume we have a weighted, directed graph G=(V,E) with arbitrary edge weights (possibly negative), but without any negative-weight cycles.

    1. Assume that someone has run a single-source shortest path for a given source s, and has produced values v.d for all verticies. They claim that v.d = δ(s,v) for all v, but you do not know what algorithm they used to produce those values nor do you trust their implementation skills.

      Explain how to check, in O(V+E) time, whether or not their collection of values are accurate shortest path costs. Your algorithm must simply report that "yes" the values are all correct or "no" there exist one or more errors.

    2. In similar style, assume that someone provides you with values v.π which they claim form a valid shortest-path tree, using our text book's convention in which v.π is the predecessor of v in the shortest-path tree. (But they do not provide you with any such v.d values.)

      Explain how to check, in O(V+E) time, whether or not their collection of pointers form a valid shortest-path tree. Your algorithm must simply report that "yes" the values are all correct or "no" there exist one or more errors.

  4. Note: the example table was revised on 10/31/2016

    We consider a problem for trucking companies, in which they must plan routes between locations while respecting vehicle weight limits on roads that are used during travel. We model this as an connected, undirected, weighted graph G=(V,E), in which an edge (u,v) represents a road connecting locations u and v, with the positive integer weight w(u,v) of that edge designating a limit on the weight of any vehicle that is allowed to travel on that edge.

    For a particular pair of vertices u and v, we define L(u,v) as the overall weight limit for traveling from u to v. That is, a vehicle of weight L(u,v) is able to travel from u to v, but no heavier vehicle can complete such travel. As a technicality, we define L(v,v) = ∞, as there is no upper bound on the weight of a vehicle that "travels" from v to itself.

    As an example, consider the following graph:

    The weight limits L(u,v) for this network are as follows:
    Blaxhall Clacton Dunwich Feering Harwich Maldon Tiptree
    Blaxhall 29 40 46 40 29 31
    Clacton 29 29 29 29 40 29
    Dunwich 40 29 40 53 29 31
    Feering 46 29 40 40 29 31
    Harwich 40 29 53 40 29 31
    Maldon 29 40 29 29 29 29
    Tiptree 31 29 31 31 31 29

    Your goal is to describe an algorithm that computes the value L(u,v) for all pairs u and v. You should clearly explain your algorithm, justify its correctness, and analyze its running time.


Michael Goldwasser ©2016
CSCI 3100, Fall 2016
Last modified: Monday, 31 October 2016
Course Home | Assignments | Schedule & Lecture Notes