You are on page 1of 23

MATHEMATICAL MODELING

SUPPORT MATERIAL For

LAB WORK And ASSIGNMENTS

Program ▶ Institution:

Computer Science ▶ HCMUT - Vietnam

Author: Man VM. Nguyen


Contents

SUPPORT MATERIAL For LAB WORK And ASSIGNMENTS . . . . . . . . . . . . . . . 1

Chapter 1 Successive shortest path algorithm 2


1.1 Minimum-cost flow - ASSUMPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Algorithms for the Minimum-cost flow (MinCF) problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 The Successive shortest paths algorithm (Successive SPA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Chapter 2 Flows and Flow Algorithms 15


2.1 Maximum flow problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Ford-Fulkerson’s algorithm for Max Flow Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3 Multi-source Multi-sink Maximum Flow Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

MATHEMATICAL MODELING LAB WORK * PROBLEMS


Chapter 1

Successive shortest path algorithm

Chapter blueprint

1. Minimum-cost flow - ASSUMPTION

2. Algorithms for the minimum-cost flow problems

3. The Successive shortest paths algorithm (Successive SPA)

We firstly present Minimum-cost flow (MCF) on weighted directed graphs, then discuss the Successive shortest

path algorithm (Successive SPA). Briefly speaking, the successive shortest path algorithm searches for the maximum

flow and optimizes a pre-defined objective function simultaneously.


1.1. Minimum-cost flow - ASSUMPTION 3

1.1 Minimum-cost flow - ASSUMPTION

The input to our problem consists of a flow network 𝐺 = (𝑉, 𝐸) of 𝑛 nodes and 𝑚 edges, where each edge 𝑒

has a cost 𝐴(𝑒), in addition to the usual edge capacities 𝐶(𝑒) and vertex balances. Edge costs can be positive,

negative, or zero. The total cost of any flow 𝑓 is then defined as

∑︁
𝐴(𝑓 ) = 𝐴(𝑒) 𝑓 (𝑒)
𝑒∈𝐸

However, in most practical usages,

(1) the cost function 𝐴 ≡ 𝑎 : 𝐸 −→ R should fulfil that 𝐴(𝑒) ≥ 0 for all 𝑒 ∈ 𝐸 , and

(2) 𝐺 could be pre-defined with or without special source and target vertices.

(3) We will also need a capacity function 𝐶 ≡ 𝑐 : 𝐸 −→ R s.t. 𝐶(𝑒) ≥ 0 for all 𝑒 ∈ 𝐸 .

Relationships of the flow 𝑓 , the cost 𝐴 and the capacity function 𝐶 are described in Section 2.1.

If allow one source and one target then the source 𝑠 and the sink 𝑡 are marked.
∑︀ ∑︀
(4) The node-balance at each internal node means 𝑣∈𝑉 𝑓 (𝑣, 𝑢) = 𝑣∈𝑉 𝑓 (𝑢, 𝑣), for 𝑢 ̸= 𝑠, 𝑡.

AIM: Few problems

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.2. Algorithms for the Minimum-cost flow (MinCF) problems 4

A network with many supply nodes (sources)


and many demand nodes (sinks).

Figure 1.1: Supply nodes are the left ones, demand nodes are the right ones

1/ General: The optimal-cost flow problem (OCF) without fixed total flow quantity asks for a feasible flow with

minimum cost value, or with maximum value 𝐶(𝑓 ).

2/ The minimum-cost flow problem (MinCF) with a given value 𝐾 , a total flow quantity from 𝑠 to 𝑡, we have to

find a flow of this quantity, and among all flows of this value 𝐾 we choose the flow with the lowest cost 𝐶(𝑓 ).

* Sometimes the task is given a little differently: you want to find the maximum flow, and among all maximal flows

we want to find the one with the least cost. This is called the minimum-cost maximum-flow problem. Both these

problems can be solved effectively with the algorithm of successive shortest paths.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.2. Algorithms for the Minimum-cost flow (MinCF) problems 5

1.2 Algorithms for the Minimum-cost flow (MinCF) problems

The MinCF algorithm is very similar to the Edmonds-Karp for computing the maximum flow, originally raised by

Ford-Fulkerson (1950s), based on the idea of augmenting paths, defined on

the residual network 𝐺𝑓 consisting of all edges 𝑒 = 𝑢 → 𝑣 with non-zero residual capacity 𝑟𝑐(𝑒), 1 .

Simplest case of MinCF: First we assume the graph is oriented, and there is at most one edge between any pair

of vertices (e.g. if (𝑖, 𝑗) is an edge in the graph, then (𝑗, 𝑖) cannot be part in it as well).

Let 𝐶𝑖𝑗 be the capacity of an edge (𝑖, 𝑗) if this edge exists, and 𝐴𝑖𝑗 be the cost per unit of flow along this edge.

And finally let 𝐹𝑖,𝑗 be the flow along the edge (𝑖, 𝑗). Initially all flow values are zero.

We modify the network as follows: for each edge (𝑖, 𝑗) we add the reverse edge (𝑗, 𝑖) to the network

with the capacity 𝐶𝑗𝑖 = 0 and the cost 𝐴𝑗𝑖 = −𝐴𝑖𝑗 . Since, according to our restrictions, the edge (𝑗, 𝑖) was

not in the network before, we still have a network that is not a multigraph (graph with multiple edges).

In addition we will always keep the condition 𝐹𝑗𝑖 = −𝐹𝑖𝑗 true during the steps of the algorithm. Define the residual

network for some fixed flow 𝐹 = 𝑓 as follow (just like in the Ford-Fulkerson algorithm- see Chapter 2).
1see https://cp-algorithms.com/graph/edmonds-karp.html].
A reminder of original algorithms by Ford-Fulkersonis given in Chapter 2.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.2. Algorithms for the Minimum-cost flow (MinCF) problems 6

1.2.1 Algorithms to compute the minimum-cost flow

Chapter 2 provides more details of Ford-Fulkerson: the residual network contains only unsaturated edges (i.e.

edges in which 𝐹𝑖𝑗 < 𝑈𝑖𝑗 ), and the residual capacity of each such edge is 𝑅𝑖𝑗 = 𝑈𝑖𝑗 − 𝐹𝑖𝑗 .]

Their algorithm (concepts to computation) solves Maximum flow problem, but now we can briefly modify it to the

algorithms to compute the Minimum-cost flow.

At each algorithm’s iteration we find the shortest path in the residual graph from 𝑠 to 𝑡. In contrary to Ford-

Fulkerson we look for the shortest path in terms of the cost of the path, instead of the number of edges.

1. If there doesn’t exists a path anymore, then the algorithm terminates, and the stream 𝐹 is the desired one.

2. If a path was found, we increase the flow along it as much as possible (i.e. we find the minimal residual capacity 𝑅

of the path, and increase the flow by it, and reduce the back edges by the same amount).

3. If at some point the flow reaches the value 𝐾 , then we stop the algorithm.

Note that in the last iteration of the algorithm it is necessary to increase the flow by only such an amount so that

the final flow value doesn’t surpass 𝐾 .

FACT: If we set 𝐾 = ∞, then the algorithm will find the minimum-cost maximum-flow. So both variations of the

problem can be solved by the same algorithm.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 7

1.2.2 Algorithms for Undirected graphs / multigraphs

The case of an undirected graph or a multigraph doesn’t differ conceptually from the algorithm above. The algorithm

will also work on these graphs. However it becomes a little more difficult to implement it.

An undirected edge (𝑖, 𝑗) is actually the same as two oriented edges (𝑖, 𝑗) and (𝑗, 𝑖) with the same capacity and

values. Since the above-described minimum-cost flow algorithm generates a back edge for each directed edge, so

it splits the undirected edge into 4 directed edges, and we actually get a multigraph.

How do we deal with multiple edges?

1. First the flow for each of the multiple edges must be kept separately.

2. Secondly, when searching for the shortest path, it is necessary to take into account that it is important which of the

multiple edges is used in the path. Thus instead of the usual ancestor array we additionally must store the edge

number from which we came from along with the ancestor.

3. Thirdly, as the flow increases along a certain edge, it is necessary to reduce the flow along the back edge. Since

we have multiple edges, we have to store the edge number for the reversed edge for each edge.

There are no other obstructions with undirected graphs or multigraphs.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 8

1.3 The Successive shortest paths algorithm (Successive SPA)

Key ref. https://www.topcoder.com/thrive/articles/Minimum%20Cost%20Flow%20Part%20Tw%20Algorithms

The Successive shortest path algorithm (Successive SPA) is based on the theory of Maximum flow problems

initially proposed by Ford and Fulkerson in the mid-1950s, see next Chapter 2. Later it - the Successive SPA was

rediscovered by William Jewell in 1958, Masao Iri in 1960, and Robert Busacker and Paul Gowen in 1960 2.

1.3.1 The Successive SPA - ASSUMPTION

The Successive SPA is formulated on a general flow network 𝐺 = (𝑉, 𝐸) with capacities 𝑓 (.), lower bounds, costs

𝐶(.) on edges, and balances (flow in equal to flow out at any node). Assumption below are satisfied

1. Edges have non-negative capacities and zero lower bounds: 0 ≤ 𝑓 (𝑢, 𝑣) ≤ 𝑐(𝑢, 𝑣), for all (𝑢, 𝑣) ∈ 𝐸

2. Every flow 𝑓 must satisfy the conservation constraint, namely In-flow equals out-flow at each internal node:
∑︀ ∑︀ ∑︀ ∑︀
𝑣∈𝑉 𝑓 (𝑣, 𝑢) = 𝑣∈𝑉 𝑓 (𝑢, 𝑣) ⇔ 𝑣∈𝑉 𝑓 (𝑣, 𝑢) − 𝑣∈𝑉 𝑓 (𝑢, 𝑣) = 0, for 𝑢 ̸= 𝑠, 𝑡
It means all node balances are zero, and so any feasible flow in such a network is actually a circulation- a sum of

directed cycles. This special case is normally called the Minimum- cost circulation or just shortly MinCF problem.
2link https://scholar.archive.org/work/m5jyzp64rraijldhzojde7ud3i

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 9

1.3.2 Successive SPA with Cycle Canceling and Pseudo-flow network

Successive Shortest Paths (Successive SP) are used to solve any instance of the Minimum-cost circulation -

Minimum- cost flow problem using a natural generalization of the well-known Ford-Fulkerson augmenting path

algorithm. Successive SP essentially are built on the cycle canceling algorithm 3 and the pseudo-flow, defined below.

Definition 1.1
A pseudo-flow 𝜓 : 𝐸 −→ R is a minimum-cost flow if and only if it satisfies three conditions: ♣

Feasible: 𝑙(𝑒) ≤ 𝜓(𝑒) ≤ 𝐶(𝑒) for every edge 𝑒.


∑︀ ∑︀
Balanced: 𝑣∈𝑉 𝜓(𝑣, 𝑢) − 𝑣∈𝑉 𝜓(𝑢, 𝑣) = 𝑏(𝑣) for every vertex 𝑢.
Locally optimal: The residual graph (residual network) 𝐺𝜓 contains no negative-cost cycles.

Remind that, any residual network 𝐺𝑓 consists of all edges 𝑒 = 𝑢 → 𝑣 with non-zero residual capacity cf 𝑟𝑐(𝑒).

KEY: The cycle-canceling algorithm incrementally improves a feasible and balanced pseudoflow 𝜓 : 𝐸 −→ R

(that is, a circulation) until it is also locally optimal. HOW?


3This algorithm is attributed to Morton Klein in 1967, see WIKI https://en.wikipedia.org/wiki/Morton-Klein

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 10

A complementary strategy called successive shortest paths incrementally improves a feasible and locally optimal

pseudoflow until it is also balanced.

Step 1: For each residual edge 𝑒 = 𝑢 → 𝑣 in 𝐺𝑓 that is not an edge in the original graph 𝐺, we define its cost

𝐴(𝑢 → 𝑣) = −𝐴(𝑣 → 𝑢)

Step 2: Now let 𝛾 be a directed cycle in the residual graph 𝐺𝑓 . We define the residual capacity 𝑟𝑐𝑓 (𝛾) of 𝛾 to be

the minimum residual capacity of the edges in 𝛾 , and the cost 𝐴(𝛾) of 𝛾 to be the sum of the costs of the edges in 𝛾 :

∑︁
𝑟𝑐𝑓 (𝛾) := min 𝑟𝑐𝑓 (𝑒); 𝐴(𝛾) = 𝐴(𝑒)
𝑒∈𝛾
𝑒∈𝛾

Step 3:

3A/ Exactly as in Ford-Fulkerson idea, we can augment the circulation 𝑓 , by pushing 𝑅 units of flow around 𝛾 , to

obtain a new circulation 𝑓 *

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 11



𝑓 (𝑢 → 𝑣) + 𝑟𝑐𝑓 (𝛾) if 𝑢 → 𝑣 ∈ 𝛾






𝑓 * (𝑢 → 𝑣) = 𝑓 (𝑢 → 𝑣) − 𝑟𝑐𝑓 (𝛾) if 𝑣 → 𝑢 ∈ 𝛾 (1.1)




⎩𝑓 (𝑢 → 𝑣)

⎪ otherwise

3B/ Direct calculation now implies that the cost

𝐴(𝑓 * ) = 𝐴(𝑓 ) + 𝑟𝑐𝑓 (𝛾) · 𝐴(𝛾). (1.2)

SUMMARY-
1. In particular, if 𝐴(𝛾) < 0, the new circulation 𝑓 * has lower cost than the original circulation 𝑓 . We conclude that

a feasible circulation 𝑓 is a Minimum-cost circulation if and only if 𝐺𝑓 contains no negative cycles!

Essence: Klein’s cycle canceling algorithm initializes 𝑓 to the all-zero circulation, and then repeatedly augments 𝑓

along an arbitrary negative residual cycle, until there are no more negative residual cycles.

The desirable pseudo-flow 𝜓 [Definition 1.1] is just the newly constructed flow 𝑓 * on the found net 𝐺𝑓 .

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 12

2. For the special instances generated by our reduction from maximum flow, every negative-cost residual cycle con-

sists of a path from source 𝑠 to sink 𝑡 and the sole negative edge 𝑡 → 𝑠, so Cycle canceling is equivalent to Ford

and Fulkerson’s augmenting path algorithm. The whole ideas give the name Successive shortest paths algorithm!

3. Further analysis: TBA.

ELUCIDATION to Algorithms

The successive shortest paths algorithm requires two simplifying assumptions about the initial flow network 𝐺:

(1) All lower bounds are zero: Otherwise, think of the lower-bound function 𝑙 as a pseudoflow (sending 𝑙(𝑒) units

of flow across each edge e), and consider the residual graph G‘ .

(2) All costs are non-negative.

Enforcing these assumptions may introduce non-zero balances at the nodes, even if all balances in the initial flow

network are zero. These two assumptions imply that the all-zero pseudo-flow (a newly set up 𝜓 ) is both feasible

and locally optimal, but not necessarily balanced. [more discussion ?]

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 13

1.3.3 Successive SPA Algorithms

ALGORITHM 1- SuccessiveShortestPaths(𝑉, 𝐸, 𝐶, 𝑏, 𝐴): # 𝐶 = capacity, 𝐴 = cost

1. for every edge 𝑒 ∈ 𝐸 𝜓(𝑒) ←− 0


∑︀
2. 𝐵 ←− 𝑢 |𝑏(𝑢)| /2
3. while 𝐵 > 0

construct 𝐺𝜓

𝑠 ←− any vertex with 𝑏𝜓 (𝑠) < 0


𝑡 ←− any vertex with 𝑏𝜓 (𝑡) > 0
𝜎 ←− shortest path in 𝐺𝜓 from 𝑠 to 𝑡

Augment(𝑠, 𝑡, 𝜎 )

4. return the pseudo-flow 𝜓

MATHEMATICAL MODELING LAB WORK * PROBLEMS


1.3. The Successive shortest paths algorithm (Successive SPA) 14

ALGORITHM 2 - Augment(𝑠, 𝑡, 𝜎 )

1. 𝑅 ←− min{−𝑏𝜓 (𝑠), 𝑏𝜓 (𝑡), min𝑒∈𝜎 𝑐𝜓 (𝑒)}

2. 𝐵 ←− 𝐵 − 𝑅

3. for every directed edge 𝑒 ∈ 𝜎

if 𝑒 ∈ 𝐸

𝜓(𝑒) ←− 𝜓(𝑒) + 𝑅
else # <𝑟𝑒𝑣(𝑒) ∈ 𝐸>

𝜓(𝑒) ←− 𝜓(𝑒) − 𝑅
Lemma 1.1

After every iteration of the main loop of SuccessiveShortestPaths(𝑉, 𝐸, 𝐶, 𝑏, 𝐴),

the feasible pseudoflow 𝜓 is locally optimal; that is, the residual graph 𝐺𝜓 contains no negative cycles.

Proof By induction.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


Chapter 2

Flows and Flow Algorithms

Chapter blueprint

1. Maximum flow problem

2. Ford-Fulkerson’s algorithm for Max Flow Problem

3. Multi-source Multi-sink Maximum Flow Problem

* Coutersy of FCSE statfs at HCMUT (the lecture note of Discrete Structure for CS).

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.1. Maximum flow problem 16

2.1 Maximum flow problem

Given data

A directed graph 𝑁 = (𝑉, 𝐴) describes a transport network, with source node 𝑠 and sink node 𝑡,

with a given underlying undirected graph 𝐺 = (𝑉, 𝐸);

capacity function 𝑐 : 𝐸 −→ ℛ, i.e. 𝑐(𝑢, 𝑣) ≥ 0 for any edge (𝑢, 𝑣) ∈ 𝐸

cost function 𝑎 : 𝐸 −→ ℛ, i.e. 𝑎(𝑢, 𝑣) ≥ 0 for any edge (𝑢, 𝑣) ∈ 𝐸

Objective coupling with Assumption

Send as much flow as possible with flow 𝑓 : 𝐸 −→ 𝑅+ such that Assumption below are satisfied

1. 𝑓 (𝑢, 𝑣) ≤ 𝑐(𝑢, 𝑣), for all (𝑢, 𝑣) ∈ 𝐸

2. In-flow equals out-flow at each internal node:


∑︀ ∑︀
𝑣∈𝑉 𝑓 (𝑣, 𝑢) = 𝑣∈𝑉 𝑓 (𝑢, 𝑣), for 𝑢 ̸= 𝑠, 𝑡
∑︀
3. the total cost (𝑢,𝑣)∈𝐸 𝑎(𝑢, 𝑣) 𝑓 (𝑢, 𝑣) should be minimized

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.2. Ford-Fulkerson’s algorithm for Max Flow Problem 17

Flow Algorithms

Ford-Fulkerson algorithm 𝑂(𝐸 max |𝑓 |)


∑︀
Objective: maximize 𝑣𝑎𝑙(𝑓 ) = 𝑣∈𝑉 𝑓 (𝑠, 𝑣), the flow from source node 𝑠 and sink node 𝑡

Edmond-Karp algorithm 𝑂(𝑉 𝐸 2 )

Dinitz blocking flow algorithm 𝑂(𝑉 2 𝐸)

General push-relabel maximum flow algorithm 𝑂(𝑉 2 𝐸) ...

2.2 Ford-Fulkerson’s algorithm for Max Flow Problem

KEY CONCEPTS for Max Flow Problem

Let 𝑓 be a flow for a transport network 𝑁 = (𝑉, 𝐴) with a given underlying undirected graph 𝐺 = (𝑉, 𝐸) associated

with 𝑁 .

a) An edge 𝑒 = (𝑢, 𝑣) of the network is called saturated if 𝑓 (𝑒) = 𝑐(𝑒).

When 𝑓 (𝑒) < 𝑐(𝑒) the edge 𝑒 is called unsaturated.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.2. Ford-Fulkerson’s algorithm for Max Flow Problem 18

b) If 𝑠 is the source of network 𝑁 , then

∑︁
𝑣𝑎𝑙(𝑓 ) = 𝑓 (𝑠, 𝑣)
𝑣∈𝑉

is called the value of the flow.

c) If 𝐶 is a cut-set for the undirected graph 𝐺 then C is called a cut, or an 𝑠 − 𝑡 cut, if the removal of the edges in

𝐶 from the network results in the separation of 𝑠 and 𝑡.

This cut partitions the vertices of 𝑁 into the two sets 𝑃 ⊂ 𝑉 and its complement 𝑃 𝑐

so the cut 𝐶 is denoted as (𝑃, 𝑃 𝑐 ).

KEY THEOREMS for Ford-Fulkerson’s algorithm

The capacity of a cut, denoted 𝑐(𝑃, 𝑃 𝑐 ), is defined by

∑︁
𝑐(𝑃, 𝑃 𝑐 ) = 𝑐(𝑣, 𝑤) (2.1)
𝑣∈𝑃,𝑤∈𝑝𝑐

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.2. Ford-Fulkerson’s algorithm for Max Flow Problem 19

Using the idea of the capacity of a cut, this next result provides an upper bound for the value of a flow in a network.
Theorem 2.1
A. Let 𝑓 be a flow in a transport network 𝑁 = (𝑉, 𝐴). ♡

If 𝐶 = (𝑃, 𝑃 𝑐 ) is any cut in 𝑁 then the value of the flow can not exceed the capacity of that cut:
∑︁ ∑︁
𝑣𝑎𝑙(𝑓 ) = 𝑓 (𝑠, 𝑣) ≤ 𝑐(𝑃, 𝑃 𝑐 ) = 𝑐(𝑣, 𝑤). (2.2)
𝑣∈𝑉 𝑣∈𝑃,𝑤∈𝑃 𝑐

Lester R. Ford, Jr., and Delbert Ray Fulkerson invented the algorithm, see originally in Network Flow Theory, the RAND Corporation, 1956, or full

paper Flows in Network, Princeton University Press, 1962, link www.rand.org/content/dam/rand/pubs/reports/2007/R375.pdf.

Using Key Theorem A

We find that in a network with source 𝑠, the flow’s value

∑︁
𝑣𝑎𝑙(𝑓 ) = 𝑓 (𝑠, 𝑣) ≤ 𝑐(𝑃, 𝑃 𝑐 ),
𝑣∈𝑉

ie. the value for any flow 𝑓 is less than or equal to the capacity of any cut 𝐶 in that network.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.2. Ford-Fulkerson’s algorithm for Max Flow Problem 20

Hence the value of the maximum flow cannot exceed the minimum capacity over all cuts in a network,

𝑣𝑎𝑙(𝑓max ) ≤ 𝑐(𝑃, 𝑃 𝑐 )min

How to construct such a flow and why its value equals the minimum capacity among all cuts will be dealt with in

next developments. But we observe the following results.


===

Proof Theorem A: see original papers by Ford and Fulkerson [1956, 1962], or Theorem 13.3 in Grimaldi 1

Key Theorem B
Theorem 2.2
B. Assume 𝑓 be a flow in a transport network 𝑁 = (𝑉, 𝐴). ♡

1. Then the value of the flow from the source 𝑠 is equal to the value of the flow into the sink 𝑡.

2. Now let 𝐶 = (𝑃, 𝑃 𝑐 ) be a cut in 𝑁 such that val(f ) = f (s, v) = c(P, Pc ) then
∑︀
v∈V

i) 𝑓 is a maximum flow for the network 𝑁 , and

ii) 𝐶 = (𝑃, 𝑃 𝑐 ) is a minimum cut (that is it has minimum capacity in 𝑁 ).


1Discrete and Combinatorial Mathematics, Ralph P. Grimaldi -5th ed., Pearson, 2004

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.3. Multi-source Multi-sink Maximum Flow Problem 21

HINT for proving (1): Let 𝑃 = {𝑠}, and 𝑄𝑐 = {𝑡}, then 𝑃 𝑐 = 𝑉 ∖ 𝑃 , and 𝑄 = 𝑉 ∖ 𝑄𝑐 . Just prove that
∑︁ ∑︁
𝑓 (𝑠, 𝑣) = 𝑣𝑎𝑙(𝑓 ) = 𝑓 (𝑦, 𝑡)
𝑣∈𝑃 𝑐 𝑦∈𝑄

Proving (2): we use Theorem A by choosing any flow 𝑓1 and any cut (𝑄, 𝑄𝑐 ),

and check 𝑣𝑎𝑙(𝑓1 ) ≤ 𝑐(𝑃, 𝑃 𝑐 ) = 𝑣𝑎𝑙(𝑓 ) ≤ 𝑐(𝑄, 𝑄𝑐 ).

f (s, v) = c(P, Pc )?
∑︀
Key Theorem C: But when val(f ) = v∈V

Theorem 2.3
C. Conditions of max flow meeting min cut ♡

For a transport network 𝑁 = (𝑉, 𝐴), with a source 𝑠 and a sink 𝑡, let 𝑓 be a flow and (𝑃, 𝑃 𝑐 ) be a cut.

𝑓 (𝑠, 𝑣) = 𝑐(𝑃, 𝑃 𝑐 ) if and only if


∑︀
Then 𝑣𝑎𝑙(𝑓 ) = 𝑣∈𝑉

1. 𝑓 (𝑒) = 𝑐(𝑒) for each arc 𝑒 = (𝑥, 𝑦), where 𝑥 ∈ 𝑃 and 𝑦 ∈ 𝑃 𝑐 , and

2. 𝑓 (𝑒) = 0 for each arc 𝑒 = (𝑣, 𝑤), where 𝑣 ∈ 𝑃 𝑐 and 𝑤 ∈ 𝑃 .

Under these conditions, 𝑓 is a maximum flow and (𝑃, 𝑃 𝑐 ) is a minimum cut.

MATHEMATICAL MODELING LAB WORK * PROBLEMS


2.3. Multi-source Multi-sink Maximum Flow Problem 22

2.3 Multi-source Multi-sink Maximum Flow Problem

Given a network 𝒩 = (𝑉, 𝐸) with 𝑠

a set of sources 𝑆 = 𝑠1 , . . . , 𝑠𝑛 and +∞+∞ +∞

a set of sinks 𝑇 = 𝑡1 , . . . , 𝑡𝑚 𝑠1 𝑠2 ... 𝑠𝑛

find the maximum flow across 𝒩 .

=⇒ transform into a maximum flow problem by


adding a super source connecting to each vertex in 𝑡1 𝑡2 ... 𝑡𝑚
𝑆 and a super sink connected by each vertex in 𝑇 +∞+∞ +∞
with infinite capacity on each edge 𝑡

MATHEMATICAL MODELING LAB WORK * PROBLEMS

You might also like