Linear Programming and Game Theory: Network Models
Linear Programming and Game Theory: Network Models
Maximizing the return flow from the sink to the source, f61,
(dotted line), maximizes the total flow into the sink.
Incidence Matrix
A is a node-edge incidence matrix. Constraint 2 tells us that Af = 0.
The rows correspond to nodes and the columns correspond to edges,
with +1, -1 for every edge showing a balance in inflows and outflows.
The last column is for the additional return flow from the sink to the
source (dotted line).
1 1 -1 node 1
-1 1 1 2
-1 1 1 3
A=
-1 -1 1 4
-1 -1 1 5
-1 -1 1 6
edge 12 13 24 25 34 35 46 56
Maximal Flow61 Maximize f61 subject to: 1) 0 ≤ fij ≤ cij and 2) Af = 0
Maximal Flow Problem 1:
Return Flow f61 = 6 Goal:
2+3= 5
2/2 Max Flow
2 4 5 /6
Source 2/4 0/5
cut
1 capacity 6
4/5 3/3 2+3+1
1/ 1 Sink
3 5
1/4
The key is to find a cut in the network across which all capacities are filled. The
edges going forward across the cut have total capacity
= 2 + 3 + 1 = 6 and no more can get across!
S-T Cuts and Max flow−Min cut Theorem
An s-t cut is a node partition into two sets, S and T, such that
the source is in S and the sink is in T.
The max flow−min cut theorem states that the maximum value
of a flow in a network is equal to the total capacity across the
minimal cut (cut of smallest capacity).
If you could increase the capacity of any one pipe, which change would
produce the largest increase in the maximal flow? Name edges using ij.
Edge ____ from ___ to ___ OR Edge ____ from ___ to ___
[HINT: There is more than one possibility!]
Maximal Flow Problem 2:
Return Flow f6 1 = 8 2+3= 5 Goal:
-2 - 1- 2 = - 5 2/2
-2 - 3 = -5
2 4
Max Flow
2/2
Source 5/5 1/1
cut
1 2/2 3/3 capacity 6
2+3+1+2
3/4 3/ 4 6/ 7 Sink
3 5
2/2
3+2= 5 2+1+3= 6
-3 - 2 = -5
SOLUTION:
flow of 2 on path 1-2-4-6-1
+ flow 0f 2 on path 1-2-3-5-6-1 + flow of 1 on path 1-2-5-6-1
+ flow 0f 3 on path 1-3-4-5-6-1 = 2 + 2 + 1 + 3 = 8!
If you could increase the capacity of any one pipe, which change
would produce the largest increase in the maximal flow?
35 from 2 to 3 OR 45 from 3 to 4 OR 46 from 2 to 3
Graph Terminology
Directed graph (or digraph) − a graph with directional
arrows as its edges (or sides). Each edge connects two
adjacent nodes (or vertices, or endpoints).
In-degree and out-degree refer to the number of edges
entering and leaving a vertex, respectively.
The degree of a vertex equals the sum of its in- and out-
degrees.
Source − a node with 0 in-degree .
Sink − a node with 0 out-degree.
Cut − a partition of the nodes into two subsets.
Cut-set of the cut contains edges whose nodes are in
different sets of the partition.
Edges are said to be crossing the cut if they are in its cut-set.
The Marriage Problem
Compatibility Matrix Graph
jth column
ith row
women men
1 0 0 0
1 1 1 0
A=
0 0 0 1
0 0 0 1
Two marriages on the left, three (maximum) on
the right. The third is created by adding two new
marriages and one divorce (backward flow).
1
1 1-1
1 1
M2 1
1 1
1
1
s t s t
cut
capacity
1 3
1 1 1
1 1
Complete Matching - set of four 1’s in the
matrix; they would come from 4 different rows
and 4 different columns
1 0 0 0
0 1 0 0
A=
0 0 1 0
0 0 0 1
For Complete Matching, there is no specific
order as long as there are a set of four 1’s in the
matrix and they would come from 4 different
rows and 4 different columns
0 1 0 0
0 0 0 1
A=
0 0 1 0
1 0 0 0
Whenever there is a subset of k women who
among them like fewer than k men, a complete
matching is impossible.
1 0 0 0
1 1 1 0
0 0 0 1
0 0 0 1
The general rule for an n x n matrix is that a p by q
block of zeros prevents a matching if p + q > n.
Hall’s condition
If every set of p women does like at least p
men, a complete matching is possible.
1 1
1 1 1
1 1
1 1 1
1
1
s 1 1 t s 1 t
1 1
1
1 1 1
1
1 1
Each woman must like at least one man, each two women
must between them like at least two men, and so on, to p=n.
A complete matching is possible if and only if
Hall’s condition holds
Proof:
Let the capacities be n on all edges across the middle. The capacities out of
the source and into the sink are still 1.
If the maximal flow is n, all those edges are filled and the flow produces n
marriages.
When the maximal flow is below n, some cut must be responsible. That cut
will have capacity below n , so no middle edges cross it.
n
Suppose p = 2 remaining women 1 1
and r = 1 man left 1 1
Capacity is n – p + r = 4 – 2 + 1 = 3 n
which is below n = 4 s t
cut
exactly when p > r, 2 > 1 capacity
Thus, Hall’s condition fails. 3
1 1
Recall: Hall’s condition - If every set of p
women does like at least p men, a
complete matching is possible n
Spanning Trees and the Greedy
Algorithm