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

IE331 Lecture14 Note

Uploaded by

ohamju0430
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)
6 views

IE331 Lecture14 Note

Uploaded by

ohamju0430
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

IE 331 OR: Optimization KAIST, Spring 2023

Lecture #14: Maximum st-flow and bipartite matching April 13, 2023
Lecturer: Dabeen Lee

1 Outline
In this lecture, we cover

• the maximum st-flow problem,

• bipartite matching.

2 Maximum st-flow
The minimum cost flow model we learned does not have a designated source or a sink. In this
section, we discuss a network flow model with a sink node and a source node. Let s and t be
the source node and the sink node, respectively. The source node s sends flows, and the sink node
receives the flows sent by the source. The other nodes are transhipment node, meaning that the
othder nodes have 0 net supply. Each arc in the given network has an upper bound on the amount
of flowws that it can take, i.e.
0 ≤ xij ≤ cij , (i, j) ∈ A.
Then the problem is to compute the maximum amount of flows that the source node s can send to
the sink node t while obeying the flow capacities of arcs.

Figure 14.1: Sending flow from s to t

Although this problem seems different from the minimum cost flow problem, we may formulate the
problem as a min cost flow model. The common trick is to add a dummy arc from the sink node t
to the source node s. This dummy arc (t, s) sends back all the flows coming from s to t. Basically,
we impose that X X
xts = xkt − xtj .
k∈N :(k,t)∈A j∈N :(t,j)∈A
| {z }
the net amount of flows into t

Moreover, A′ = A ∪ {(t, s)} is the arc set of the new network obtained after adding the dummy arc

1
(t, s). Then
X X
0 = xts + xtj − xkt
j∈N :(t,j)∈A k∈N :(k,t)∈A
X X
= xtj − xkt .
j∈N :(t,j)∈A′ k∈N :(k,t)∈A′
| {z }
the net amount of flows into t in the new network

Furthermore, the amount of flows that the sink node t receives is equal to the amount of flows that
the source node s sends out. Hence, we have
X X X X
xsj − xks = xkt − xtj = xts
j∈N :(s,j)∈A k∈N :(k,s)∈A k∈N :(k,t)∈A j∈N :(t,j)∈A
| {z }
the net amount of flows out of s

Then it follows that


X X
0= xsj − xks − xts
j∈N :(s,j)∈A k∈N :(k,s)∈A
X X
= xsj − xks .
j∈N :(s,j)∈A′ k∈N :(k,s)∈A′
| {z }
the net amount of flows out of s in the new network

The other nodes in the network are transhipment nodes and are not connected to the dummay arc
(t, s), so we have X X
xij − xki = 0, i ∈ N \ {s, t}.
j∈N :(i,j)∈A′ k∈N :(k,i)∈A′

Then the problem can be formulated as

max xts
X X
s.t. xij − xki = 0, ∀i ∈ N
j∈N :(i,j)∈A∪{(t,s)} k∈N :(k,i)∈A∪{(t,s)}

0 ≤ xij ≤ cij , ∀(i, j) ∈ A.

Observe that the dummy arc xts is a free variable, which is equivalent to −∞ ≤ xts ≤ +∞. As
this formulation is an instance of the minimum cost flow model, it returns an integer flow as long
as the capacities cij for (i, j) ∈ A are integers.

3 Bipartite matching
A bipartite graph is a graph G = (V, E) where

• the vertex set V is partitioned into two sets V1 and V2 ,

• each edge e ∈ E crosses the partition, i.e. e has one end in V1 and the other end in V2 .

For example, Figure 14.2 shows a bipartite graph on 7 vertices where one set contains 3 and the
other has 4. A matching is a set of edges without common vertices. In Figure 14.2, the set of

2
Figure 14.2: Bipartite graph and a matching

green edges gives rise to a matching. The matching problem is to find a matching that has the
maximum number of edges.
The first approach is to reduce bipartite matching to maximum st-flow. Given a bipartite graph
G = (V, E) with V partitioned into V1 and V2 , we run the following transformation procedure.

• Add a source node s and a sink node t.

• Add arcs from s to all vertices in V1 : {(s, u) : u ∈ V1 }.

• Add arcs to t from all vertices in V2 : {(v, t) : v ∈ V2 }.

• Direct every edge (u, v) where u ∈ V1 and v ∈ V2 so that (u, v) becomes an arc from u to v.

• Set the flow upper bound cuv of every arc (u, v) to 1.

Figure 14.3: Reducing a bipartite graph to a flow newtwork

3
Then the following linear program computes a maximum st-flow over the above network.
X
max xsu
u∈V1
X
s.t. xuv − xsu = 0, u ∈ V1
v∈V2 :(u,v)∈E
X
xvt − xuv = 0, v ∈ V2
u∈V1 :(u,v)∈E

0 ≤ xsu , xvt , xuv ≤ 1, (u, v) ∈ E

In particular, there is an optimal solution x∗ that has integer entries only. As each component of
x∗ is between 0 and 1, we may select

M = {(u, v) ∈ E : x∗uv = 1} .

Note that X
x∗uv = x∗su ≤ 1.
v∈V2 :(u,v)∈E

Therefore, u is connected to at most one edge in M . Similarly,


X
x∗uv = x∗vt ≤ 1.
u∈V1 :(u,v)∈E

Therefore, v is connected to at most one edge in M . This implies that M is a matching. In fact,
|M | is the size of the matching, and moreover,
X
|M | = x∗uv .
u∈V1

This implies that we have just solved bipartite matching by maximum st-flow.

You might also like