0% found this document useful (0 votes)
54 views

Advanced Algorithms Course. Lecture Notes. Part 6: A Simplified Airline Scheduling Problem

This document discusses several problems that can be modeled as minimum cut problems on graphs, including: 1. An airline scheduling problem that models flight segments as a directed acyclic graph and asks if a schedule can be realized using a maximum number of planes. 2. An image segmentation problem that labels pixels as foreground or background to maximize classification strengths while minimizing switches between labels. 3. A project selection problem that chooses a set of projects respecting precedence constraints to maximize total revenue. 4. A baseball elimination problem that determines if a team can still become champion by modeling wins passing through remaining games.

Uploaded by

Kasapa
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)
54 views

Advanced Algorithms Course. Lecture Notes. Part 6: A Simplified Airline Scheduling Problem

This document discusses several problems that can be modeled as minimum cut problems on graphs, including: 1. An airline scheduling problem that models flight segments as a directed acyclic graph and asks if a schedule can be realized using a maximum number of planes. 2. An image segmentation problem that labels pixels as foreground or background to maximize classification strengths while minimizing switches between labels. 3. A project selection problem that chooses a set of projects respecting precedence constraints to maximize total revenue. 4. A baseball elimination problem that determines if a team can still become champion by modeling wins passing through remaining games.

Uploaded by

Kasapa
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/ 4

Advanced Algorithms Course.

Lecture Notes. Part 6

A Simplified Airline Scheduling Problem


An airline has to operate m flight segments where each segment j is char-
acterized by: origin and destination airport, departure and arrival time.
For any two flight segments we define, by ad-hoc criteria, when flight j is
reachable from flight i (for example: same airport, enough time between
the arrival of i and departure of j). This reachability relation defines a di-
rected acyclic graph (DAG) on the set of flight segments. If j is reachable
from i, then both flight segments may be performed by the same plane. A
fleet of k planes is available. The problem is: Can the given flight schedule
be realized using at most k planes?
We model the problem as a circulation problem. Here is is tempting to
represent the airports by nodes, but in order to allow for various reachability
criteria we model everything by edges, whereas the nodes are merely the
ends of edges but have no physical meaning. Now a possible construction
follows. The pairs of numbers mean lower and upper bounds on capacities,
and the directions of edges should be obvious.
We represent flight segments by mutually disjoint edges with capacities
(1, 1), since every flight must be performed. If a flight is reachable by another
one, we connect the two edges by another edge with capacity (0, 1), since
we may use this connection but we are not obliged to do so. Furthermore,
insert a source s and a sink t. Connect s with each flight, by an edge of
capacity (0, 1). Similarly, connect each flight with t, by an edge of capacity
(0, 1). Finally we connect s with t by an edge of capacity (0, k). Nodes s and
t have demands k and k, respectively, and all other nodes have demand 0.
It is not hard to see that the possible schedules correspond to the possible
circulations, where the flow on edge (s, t) is the number of unused planes.
Each of the other units of flow corresponds to one plane and connects all
the flight segments operated by that plane.

1
A Machine Learning Problem: Image Segmentation
This problem asks to label each pixel of a digital image as foreground (part
of an object) or background. The picture is represented as an undirected
graph G = (V, E) where nodes are pixels and edges exist between any
two neighbored pixels. For every pixel i we are also given two numbers
ai and bi expressing the strength of belief that pixel i is foreground or
background, respectively. We do not discuss here in depth how these val-
ues are obtained (criteria could be, for example, the colors and positions
of pixels), we just consider them as input to our problem. A further as-
sumption is that the picture does not comprise too many switches between
foreground and background, that is, it shows a few large and connected
objects. Therefore we introduce penalties for label switches: For each pair
of neighbored pixels i, j we charge a penalty pij if i and j have different
labels. Altogether this gives rise to the following optimization problem:
Split V into sets A and B (foreground and background) so as to maximize
q(A, B) := iA ai + jB bj (i,j)E,iA,jB pij . That is, the segmenta-
P P P

tion should respect the classification criteria for the single pixels (strength
of belief) but it should not need too many switches.
We can reduce this problem to Minimum Cut as follows. First ob-
serve that it is equivalent to minimize q 0 (A, B) := iA bi + jB aj +
P P
P
(i,j)E,iA,jB pij . That is, we want to minimize the penalties for both
false labels and switches. As we need a directed graph, we replace every
edge (i, j) with two opposite directed edges with capacity pij . We insert a
source s and sink t, and for every pixel k we insert edges (s, k) with capac-
ity ak , and (k, t) with capacity bk . Now any s t cut (A, B) has capacity
q 0 (A, B). Thus, an optimal segmentation corresponds to a minimum cut.

Project Selection
Let P be a set of possible projects to choose from. Project i has revenue
pi . Value pi can also be negative, in this case the project is an investment
for other projects: Some projects depend on others. These dependencies
are given as a directed graph G = (P, E) where an edge (i, j) means: if i
shall be done, then j must be done, too (before i can even start). Clearly,
G must be acyclic, since projects in a directed cycle of dependencies can
never be done. We call a set of projects A P feasible if A respects
these precedence constraints. The problem is to select a feasible set A that
P
maximizes iA pi . This is also known as the Open-Pit Mining problem.
(One can easily imagine the reason.)

2
We reduce Project Selection (Open-Pit Mining) to Minimum Cut. We
insert a source s and a sink t. Edges are (s, i) with capacity pi , if pi > 0, and
(i, t) with capacity pi , if pi < 0. Edges in G (for the precedence constraints)
get a huge capacity. Hence none of these edges can go from A to B in a
minimum cut (A {s}, B {t}). It follows that A is feasible whenever
(A {s}, B {t}) is a minimum cut. Now we can solve the Minimum Cut
problem and need not worry about the feasibilty of A.
It remains to show that minimizing the cut capacity is in fact equivalent
to maximizing the revenue. This is proved in a few lines:
c(A {s}, B {t}) = pi >0,iB pi pi <0,iA pi holds by the definition of
P P

capacity. We artificially add zero: c(A {s}, B {t})


= pi >0,iB pi pi <0,iA pi pi >0,iA pi + pi >0,iA pi .
P P P P

Now we can group the terms in a different way: c(A {s}, B {t}) =
pi >0 pi
P P
iA pi . Note that the first term is constant and the second
term is the revenue.

Baseball Elimination
Like to see a fun application after all these serious ones? A set S of baseball
teams are playing in a league. For every team x we know the number wx
of wins so far, and for each pair of teams x, y we know the number gxy of
games x against y that are left. You are concerned about your favourite
team: Can z still become champion? You only want to answer this yes/no
question.
First think a while and realize what the difficulty of the problem is.
Next, it may be hard to believe that this has anything to do with flows. It
has, but this time the idea is more tricky.
For answering the can z still become champion? question it is safe
to assume that z will win all its remaining games (all other cases would
be worse). Now let m be the total number of wins of z. For convenience
define S 0 := S \ {z} and g := x,yS 0 gxy (the total number of remaining
P

games). Teams and games will be represented as nodes of a directed graph.


We insert a source s and a sink t. Roughly speaking, the role of s is to
generate wins that pass through the game nodes and team nodes and
are eventually absorbed by t.
We create a node vx for each x S 0 , and a games node uxy when
gxy > 0. Edges (s, uxy ) with capacity gxy will forward wins to the game
nodes. (Each game has a winner.) Edges (uxy , vx ) and (uxy , vy ) with huge
capacity will pass one unit of flow to the winner of each game between x and

3
y. Edges (vx , t) with capacity m wx collect the wins from the teams.
The capacities ensure that no team x can reach more than m wins in total.
That means: z has a chance to become champion if and only if there exists
a flow with value g .
But, in the case that z is no longer a candidate for championship, how can
we convince an enthusiast of team z of this sad truth? (Most likely he will
not understand any word about flows, and probably he will even doubt our
computer result.) Clearly, z cannot become champion anymore if, in a subset
T of teams, the average number of wins from past games and games inside T
exceeds m. This quantity does not depend on the results of the outstanding
games inside T . Formally, this condition is: xT wx + x,yT gxy > m|T |.
P P

Note that such a set T provides (hopefully) an easily understandable proof


that z is out. Interestingly, such T does always exist and can be computed
via a minimum cut in the graph constructed above. But we do not go into
further details.

You might also like