OR - Part 1 - Lecture 4 - ClassicalComOpt
OR - Part 1 - Lecture 4 - ClassicalComOpt
2024
1/1
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
1 5 7 1 5 7
3 6 3 6
Basic concepts in graph theory
6 6
2 4 7 2 4 4
4 4
4 2 2 4 2 2
2 2
1 0 5 7 1 9 0 3 5 7
6
3 2 3 2
3 3 3 3
3 6 5 3 6 4
3 3
Basic concepts in graph theory
For a vertex i ∈ V
The indegree of i is 3 6
the number of incoming arcs of i
The outdegree of i is
the number of outgoing arcs of i
The degree of i
= its indegree + its outdegree
Basic concepts in graph theory
i1 − i2 − . . . − ir
2 4
where ik is adjacent to ik+1
(with k = 1, . . . , r − 1)
Example: 1 − 2 − 4 − 5 − 2 − 3 1 5 7
A path in G is
a walk without repetition of vertices
3 6
Example: 1 − 2 − 4 − 5 − 6
Vertices i and j are connected if
there is at least one path from i to j
Example: 1 & 6 are connected
A cut of G is
a partition of the vertex set V
into two parts S and S = V \ S 2 4
Notation: [S, S]
Note: cut [S, S] defines a set of arcs 1 5 7
For a vertex i ∈ V
The degree of i
1 5 7
= the number of edges incident to i
The concepts of
3 6
walk, path, cycle
connected undirected graph
acyclic undirected graph
are defined as with directed graphs
Basic concepts in graph theory
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Problem description
Input:
a directed network G = (N, A)
arc length cij associated with each (i, j) ∈ A
two distinct nodes s, t ∈ N
2 1 1
1 6
6 7
2
2 4
Shortest path problem Problem description
Assumptions
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
q
s
t
.
Property 2
.
Let d(i) be the shortest path distance from source s to node i.
Then a path P from s to node k is a shortest path if and only if
d(j)
. = d(i) + cij for every (i, j) ∈ P.
Shortest path problem Dijkstra’s algorithm
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Problem description
Input:
a directed network G = (N, A)
arc capacity cij associated with each (i, j) ∈ A
source node s ∈ N, sink node t ∈ N
Objective:
send maximum amount of (flow) units from s to t satisfying
arc capacities
flow conversation at all other nodes
3
4 5
s 1 3 4 t
2
1
2
Max-flow problem Problem description
Problem description
Input:
a directed network G = (N, A)
arc capacity cij associated with each (i, j) ∈ A
source node s ∈ N, sink node t ∈ N
Objective:
send maximum amount of (flow) units from s to t satisfying
arc capacities
flow conversation at all other nodes
3
4 5
4 5
s 1 1 3 4 t
2 1
2 1
2
Max-flow problem Problem description
Assumptions
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Intuition
3
4 5
s 1 3 4 t
2
1
2
Max-flow problem Augmenting path algorithm
Intuition
3
4↓3 5↓4
1 1
s 1 0 3↓3 4 t
2↓1 1
1 1↓0
2
Max-flow problem Augmenting path algorithm
Intuition
3
4↓0 5↓1
4 4
s 1 0 3↓3 4 t
2↓1 1
1 1↓0
2
Max-flow problem Augmenting path algorithm
Intuition
3
4↓0 5↓0
4 5
s 1 1 3↓2 4 t
2↓0 1
2 1↓0
2
Max-flow problem Augmenting path algorithm
Residual network
“Remaining flow network” for carrying incremental flow
Intuitive idea:
Original network G: arc (i, j) has capacity cij
Given xij flow units in arc (i, j)
Up to cij − xij flow units can be sent i → j
Up to xij units can be sent j → i to cancel existing flow in (i, j)
Construction of residual network Gr (x):
Replace arc (i, j) in original network G by
arc (i, j) with residual capacity rij = cij − xij , and
arc (j, i) with residual capacity rji = xij
Remove arcs with residual capacity 0
3 3
4 5 1
3 5 5
3
1 2 3 4 1 2 1 4
s 2 0 t s t
2 1 2 1
2 Gr (x) 2
G, x
Max-flow problem Augmenting path algorithm
Augmenting path
An augmenting path is
a directed path from source to sink in residual network
Residual capacity of an augmenting path is
the minimum residual capacity of any arc in the path
Always positive (by residual network construction)
Observation:
Additional flow can be sent s → t along augmenting path
3 3
1
3+1
3 5 5
1 2 1 4 1 1 1+1 4
s t s t
2 1 2 1
2 2
Max-flow problem Augmenting path algorithm
3 3
4 5 4 5
0
0
1 0 3 4 1 3 4
s 0 0 t s t
2 1 2 1
2 Original 2 Residual
Max-flow problem Augmenting path algorithm
3 3
4 5 4 1
4
4 4
1 0 3 4 1 3 4
s 0 0 t s t
2 1 2 1
2 Original 2 Residual
Max-flow problem Augmenting path algorithm
3 3
4 5 4 1
4
4 4
1 0 3 4 1 3 4
s 1 1 t s 1 1 t
2 1 1
2 Original 2 Residual
Max-flow problem Augmenting path algorithm
3 3
4 5 4
5
4 5
1 1 3 4 1 3 4
s 2 1 t s 2 1 t
2 1
2 Original, optimal 2 Residual
Max-flow problem Max-flow min-cut theorem
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
2 4
1 5 7
s t
3 6
Traveling salesman problem Problem description
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Given a list of cities and the distances between each pair of cities,
what is the shortest possible route
that visits each city and returns to the origin city?
Symmetric TSP
Input:
An undirected network G = (N, E) in which
N is set of nodes
E consists of all possible edges
edge length cij associated with each {i, j} ∈ E
Objective: find a (Hamiltonian) cycle of minimum length
(that visits every node in the network)
2 5
3 4
Traveling salesman problem Problem description
http://www.math.uwaterloo.ca/tsp/sweden/index.html
Traveling salesman problem Problem description
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
3 3
2 2
1 4 1 4
5 5
Traveling salesman problem MIP-based approaches
Contents
3. Max-flow problem
Problem description
Augmenting path algorithm
Max-flow min-cut theorem
Observations
1 1
2 5 2 5
3 4 3 4
Traveling salesman problem MIP-based approaches
Network representation
Dantzig-Fulkerson-Johnson formulation
∑
min cij xij
{i,j}∈E
∑ ∑
s.t. xij + xji = 2 ∀i ∈ N
{i,j}∈E {j,i}∈E
∑
xij ≤ |Q| − 1 ∀ Q : ∅ ̸= Q ( N
i,j∈Q:{i,j}∈E
∑
min cij xij
{i,j}∈E
∑ ∑
s.t. xij + xji = 2 ∀i ∈ N
{i,j}∈E {j,i}∈E
∑
xij ≥ 2 ∀S ( N
{i,j}∈E(S)
Miller-Tucker-Zemlin formulation
Set of arcs: A = {(i, j) | i, j ∈ N}
Variables: {
1 if the cycle goes from i to j
xij =
0 otherwise
Formulation:
∑
min cij xij
{i,j}∈A
∑
s.t. xij = 1 ∀i ∈ N
j∈N:(i,j)∈A
∑
xji = 1 ∀i ∈ N
j∈N:(j,i)∈A
ui − uj + nxij ≤ n − 1 2≤i<j≤n
ui ≤ n − 1 ∀i = 2, . . . , n
ui ∈ N ∀i = 2, . . . , n
xij ∈ {0, 1} ∀i, j ∈ N : {i, j} ∈ E
Remark: dummy variables ui are used to exclude sub-tours
Thanks