Course Home | Assignments | Peer Assessment Procedures | Schedule & Lecture Notes

Saint Louis University

Computer Science 314
Algorithms

Michael Goldwasser

Fall 2014

Dept. of Math & Computer Science

Homework Assignment 06

Network Flows


Overview

Topics: Network Flow
Related Reading: Chapters 26 of CLRS
Due: 10:00am, Monday, 1 December, 2014

Please make sure to strictly adhere to the stated course procedures regarding the format of your submitted homework. In particular, your name should not appear on anything other than the cover page, and your solution for each problem must be in a separate packet, labeled appropriately with your assigned codename.

You must also adhere to the policies on academic integrity, paying particular attention to the limits on collaboration.


Problems to be Submitted

  1. Work entirely on your own

    Consider the following graph:



    You are to simulate the Edmonds-Karp algorithm for computing the maximum flow from s to t. To succinctly describe the process, list each augmenting path that is used, in the order considered by the algorithm, including the sequence of vertices on the path (e.g., sefgt) and the amount of flow that is augmented along that path.

  2. Work entirely on your own

    Let f be a maximum flow for a network G, and let e be some edge of the graph for which the nonzero flow, f(e), is equal to the edge capacity, c(e). Assuming that you have already computed the maximum flow f for G:

    1. Explain how to efficiently compute a new maximum flow f + for a graph G + that results when increasing the capacity of edge e by 1 unit.

    2. Explain how to efficiently compute a new maximum flow f - for a graph G - that results when decreasing the capacity of edge e by 1 unit.

  3. Work entirely on your own

    One of the network flow applications that we examined during class was a contest problem titled "Collector's Problem" (linked here). During class I sketched the following reduction from that problem to network flow.

    You are to demonstrate your understanding of this reduction by completing the following tasks:

    1. Draw the precise graph that results from the second test case given in the programming contest sample output, including all edge capacities.

    2. Clearly identify the flow across each edge of that example network for some maximum flow. (Note that the maximum flow might not be unique.)

  4. You may discuss ideas with other students (but your writeup must be independent)

    You are in charge of creating a schedule for the employees of your store. You have w employees who work at the store, and you have s shifts that must be covered during the week, with a requirement that there be two employees for each shift. Furthermore, you have created a survey in which each employee has indicated which shifts he or she would be able to work, and an absolute limit on the maximum number of shifts that he or she is willing to work. For the purpose of notation, we number the shifts {1, 2, ..., s} and the workers from {1, 2, ... w}. For a particular worker k, we let Ak ⊆ {1, 2, ..., s} represent those shifts for which the employee is available to work, and Lk be a limit on the maximum number of shifts that the employee is willing to work.

    Your goal is to produce a feasible assignment of employees to shifts respecting the employee's constraints (or to determine that it is impossible). Explain how to reduce this problem to maximum flow, making sure to outline:

  5. Work entirely on your own

    Professor Wishful claims that if cut (S, T) is a minimum s-t cut for flow network G, then it remains a minimum s-t cut for flow network G+ that is defined to be equal to G, except with the capacity of each edge raised by one unit. Construct a counterexample to this claim. Your answer must clearly identify the network G, the identity of some minimum s-t cut (S, T), and then the identify of some other s-t cut, (S', T'), that has strictly lower cost than (S, T) for network G+.

    Note: It should be clear that the capacity of that cut is larger in G+ than in G, but the question is whether the cut itself (i.e., the division of nodes) remains the minimum cut in G+.


Extra Credit

  1. You may discuss ideas with other students (but your writeup must be independent)

    Assume that you have a network that is designed to move k units of flow from source s to destination t, with each edge having capacity 1. An attacker is able to destroy the s-t connectivity of your network by destroying precisely k edges of the network (by destroying any minimum s-t cut of the graph). However, since there may be many minimum cuts, there is some mystery as to which edges were destroyed.

    After the attack, your job is to report back to your boss the complete set of all vertices that are unreachable from s. As your only tool, you are allowed to call ping(v) for any vertex v, to determine if that vertex is currently reachable from s. So clearly, you could use |V| ping calls to analyze the connectivity. However, we wish for you to develop a more efficient algorithm.

    Give an algorithm that determines all vertices that are unreachable from s using only O(k log |V|) pings, based on the assumption that precisely k edges of the network have been destroyed. Your algorithm is allowed to decide which vertex to ping next based on the outcome of earlier ping operations.


Michael Goldwasser ©2014
CSCI 314, Fall 2014
Last modified: Saturday, 22 November 2014
Course Home | Assignments | Peer Assessment Procedures | Schedule & Lecture Notes