Max flow problems [00S6]
- November 11, 2026
In class, we saw that the Ford-Fulkerson algorithm can be implemented to run in O(CE) time, where C is the total capacity coming out of the source vertex. There is also a particular instantiation of the Ford-Fulkerson framework, known as Dinitz’ Algorithm, which can be implemented to find maximum flows in a network in O(V^2 E) time. For these problems, you may assume O(CE) or O(V^2 E) as the time needed to solve a max flow problem, whichever is better.
[F1] Mobile connections (2 pts) [00S7]
- November 11, 2026
Consider a set of mobile computing clients in a certain town who each need to be connected to one of several possible base stations. We’ll suppose there are n clients, with the position of each client specified by its (x,y) coordinates in the plane. There are also k base stations; the position of each of these is specified by (x,y) coordinates as well.
We wish to connect each client to exactly one of the base stations, but our choice of connections is constrained in the following ways. First, there is a range parameter, denoted by r: a client can only be connected to a base station that is within distance r. There is also a load parameter L: no more than L clients can be connected to any single base station.
Your goal is to design a polynomial-time algorithm for the following problem. Given the positions of a set of clients and a set of base stations, as well as the range and load parameters r and L, decide whether every client can be connected simultaneously to a base station, subject to the constraints r and L.
Be sure to justify the correctness of your algorithm and analyze its asymptotic running time. Also, be sure to express the running time in terms of n, k, L, and r as appropriate; do not just say it takes O(V^2 E).
[F2] Exam scheduling (2 pts) [00S8]
- November 11, 2026
Given a list of n classes, a list of r rooms, a list of t time slots, and a list of a therapy animals, our goal is to assign the final exam for each class to a particular room at a particular time, with a visit from one of a list of therapy animals.
- Each class i has a size S_i.
- Each room j has a capacity C_j; classes may only be assigned to rooms that are large enough to fit them, that is, if S_i \leq C_j.
- Each room is only available during some of the time slots, and may have at most one class assigned to it per time slot.
- Each therapy animal is only available during certain time slots, and an animal may only visit one exam per time slot.
- To avoid overwhelming the therapy animals, each animal may be assigned to visit a maximum of three exams.
Design an algorithm to find a valid way to assign each class to a room, time, and therapy animal that satisfies all the constraints (or report that no such assignment is possible). Be sure to justify the correctness of your algorithm and analyze its asymptotic running time.
[F3] Vertex capacities (2 pts) [00S9]
- November 11, 2026
Suppose that, in addition to edge capacities, a flow network has vertex capacities. That is, each vertex v has a limit c(v) on how much flow can pass through v. Show how to transform a flow network G = (V,E) with vertex capacities into an equivalent flow network G' = (V', E') without vertex capacities, such that a maximum flow in G' has the same value as a maximum flow in G. How many vertices and edges does G' have?
[F4] Escape problem (3 pts) [00SA]
- November 11, 2026
An n \times n grid is an undirected graph consisting of n rows and n columns of vertices, as shown in the figure below. We denote the vertex in the ith row and the jth column by (i,j). All vertices in a grid have exactly four neighbors, except for the boundary vertices.
Given m \leq n^2 starting points (x_1, y_1), (x_2, y_2), \dots , (x_m, y_m) in the grid, the escape problem is to determine whether or not there are m vertex-disjoint paths (i.e. paths that do not share any vertices or edges) from the starting points to any m different points on the boundary. For example, the grid shown on the left has an escape, but the grid on the right does not.
Describe a polynomial-time algorithm to solve the escape problem, and analyze its running time.
Hint.
- November 11, 2026
Use the result from [F3] Vertex capacities (2 pts).