Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
6.3: Maximum FlowsFrank Stajano Thomas Sauerwald
Lent 2015
Illustration of the Ford-Fulkerson Method
s
2
3
4
5 t
Graph G = (V , E , c):
0/10
0/10
0/2 0/6
0/4
0/8
0/9
0/10
0/10
⇠⇠
0/10 ��0/8
⇠⇠0/108/1
0
0/10
0/2 0/6
0/4
8/8
0/9
0/10
8/10
⇠⇠
8/10 ��0/2
��0/9⇠⇠8/10
10/10
0/10
2/2 0/6
0/4
8/8
2/9
0/10
10/10⇠⇠0/10
��2/9
��0/6⇠⇠0/1010
/10
6/10
2/2 6/6
0/4
8/8
8/9
6/10
10/10⇠⇠6/10
��2/2
��0/4
⇠⇠6/1010/10
8/10
0/2 6/6
2/4
8/8
8/9
8/10
10/10
⇠⇠8/10 ��8/9
��8/8
��2/4⇠⇠8/1010
/10
9/10
0/2 6/6
3/4
7/8
9/9
9/10
10/10
s
2
3
4
5 t
Residual Graph Gf = (V , Ef , cf ):
10
10
2 6
4
8
910
10
2
8
10
2 6
4
8
910
2
8
10
10
2 6
4
8
7
2
1010
10
4
6
2 6
4
8
1
8
4
610
10
2
8
2 6
2
2
8
1
8
2
810
10
1
9
2 6
1
3
7
1
9
1
910
|f | = 0|f | = 8|f | = 10|f | = 16
|f | = 18
|f | = 19
Is this a max-flow?
6.6: Maximum flow T.S. 9
Announcements
Deadline for Microchallenge 7 today!There is a list of errata for the slides on the webpageThere might be a little bit of time in the last lecture to revisitone of the previous topics and briefly discuss some datastructure/algorithm/proof etc. which may or may not havebeen covered in previous lectures.If you have any suggestion, please send an email today.
6.3: Maximum Flows T.S. 2
Outline
Analysis of Ford-Fulkerson
Matchings in Bipartite Graphs
Introduction and Line Intersection
6.3: Maximum Flows T.S. 3
Max-Flow Min-Cut Theorem
The value of the max-flow is equal to the capacity of the min-cut, that is
maxf|f | = min
S,T⊆Vcap(S,T ).
Theorem
6.3: Maximum Flows T.S. 4
Analysis of Ford-Fulkerson
0: def FordFulkerson(G)1: initialize flow to 0 on all edges2: while an augmenting path in Gf can be found:3: push as much extra flow as possible through it
If all capacities c(u, v) are integral, then the flow at every iteration of Ford-Fulkerson is integral.
Lemma
For integral capacities c(u, v), Ford-Fulkerson terminates after V · Citerations, where C := maxu,v c(u, v) and returns the maximum flow.
Theorem
at the time of termination, no augmenting path⇒ Ford-Fulkerson returns maxflow (Key Lemma)
6.3: Maximum Flows T.S. 5
Analysis of Ford-Fulkerson
0: def FordFulkerson(G)1: initialize flow to 0 on all edges2: while an augmenting path in Gf can be found:3: push as much extra flow as possible through it
If all capacities c(u, v) are integral, then the flow at every iteration of Ford-Fulkerson is integral.
Lemma
For integral capacities c(u, v), Ford-Fulkerson terminates after V · Citerations, where C := maxu,v c(u, v) and returns the maximum flow.
Theorem
at the time of termination, no augmenting path⇒ Ford-Fulkerson returns maxflow (Key Lemma)
6.3: Maximum Flows T.S. 5
Analysis of Ford-Fulkerson
0: def FordFulkerson(G)1: initialize flow to 0 on all edges2: while an augmenting path in Gf can be found:3: push as much extra flow as possible through it
If all capacities c(u, v) are integral, then the flow at every iteration of Ford-Fulkerson is integral.
Lemma
For integral capacities c(u, v), Ford-Fulkerson terminates after V · Citerations, where C := maxu,v c(u, v) and returns the maximum flow.
Theorem
at the time of termination, no augmenting path⇒ Ford-Fulkerson returns maxflow (Key Lemma)
6.3: Maximum Flows T.S. 5
Slow Convergence of Ford-Fulkerson (Figure 26.7)
s
u
v
t
G
3/1000
3/1000
3/1000
3/1000
0/1 s
u
v
t
Gf
9973
9973
9973
9973
1
Number of iterations is at least C := maxu,v c(u, v)!
For irrational capacities, Ford-Fulkersonmay even fail to terminate!
6.3: Maximum Flows T.S. 6
Slow Convergence of Ford-Fulkerson (Figure 26.7)
s
u
v
t
G
3/1000
3/1000
3/1000
3/1000
0/1 s
u
v
t
Gf
9973
9973
9973
9973
1
Number of iterations is at least C := maxu,v c(u, v)!
For irrational capacities, Ford-Fulkersonmay even fail to terminate!
6.3: Maximum Flows T.S. 6
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/1 0/φ
φ2 = 1 − φ, φ = (√
5 − 1)/2 ≈ 0.618
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/1 0/φ
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/1 0/φ
s
2 3 4 5
t
1 1 φ
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/1 0/φ
s
2 3 4 5
t
1 1 φ
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0
Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/φ
s
2 3 4 5
t
1 1 φ
��0/1
1/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0
Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/φ
s
2 3 4 5
t
1 1 φ
��0/1
1/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0
Iteration: 1, |f | = 1
Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/φ
s
2 3 4 5
t
1 φ
��0/1
1/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0
Iteration: 1, |f | = 1
Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1 0/φ
s
2 3 4 5
t
1 φ
��0/1
1/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1
Iteration: 2, |f | = 1
Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
1 φ
��0/11/1
1
��0/φ��1/1��0/1
φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1
Iteration: 2, |f | = 1
Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
1 φ
��0/11/1
1
��0/φ��1/1��0/1
φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1
Iteration: 2, |f | = 1 + φ
Iteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1
φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1
Iteration: 2, |f | = 1 + φ
Iteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1
φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φ
Iteration: 3, |f | = 1 + φ
Iteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1
0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φ
Iteration: 3, |f | = 1 + φ
Iteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1
0/φ1/11− φ2/1
��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φ
Iteration: 3, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1
0/φ1/11− φ2/1
��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φ
Iteration: 3, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1
0/φ1/11− φ2/1
��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1
��0/φ��1/1����1− φ2/1
φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1
φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1
φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ
Iteration: 4, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1
φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2
Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:
After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−
Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!
|f | = 1 + 2∑2i
k=1 Φi
≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi ≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi ≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Non-Termination of Ford-Fulkerson for Irrational Capacities
s
2 3 4 5
t
./∞ ./∞ ./∞
./∞ ./∞./∞
0/1
s
2 3 4 5
t
��0/11/1
1
��0/φ��1/1��0/1 φ/φ1− φ/11− φ2/1
φ
1− φ
1− φ
φφ
φ
1− φ 1 φ
��φ/φ����1− φ/11− φ2/1 0/φ1/11− φ2/1 ��0/φ��1/1����1− φ2/1 φ− φ3/φφ/11/1
1
φ
1− φ
φ− φ3
φ3
��1/1 ��φ/1 φ− φ3/φ
1− φ2/1 1/1 φ− φ3/φ
11− φ
φ 1− φ
φ3
Iteration: 1, |f | = 0Iteration: 1, |f | = 1Iteration: 2, |f | = 1Iteration: 2, |f | = 1 + φIteration: 3, |f | = 1 + φIteration: 3, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φIteration: 4, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ φ2Iteration: 5, |f | = 1 + 2 · φ+ 2 · φ2
In summary:After iteration 1: 0−→, 1−→, 0←−, |f | = 1
After iteration 5: 1−φ2
−→ , 1−→, φ−φ3
←− , |f | = 1 + 2φ+ 2φ2
After iteration 9: 1−φ4
−→ , 1−→, φ−φ5
←− , |f | = 1 + 2φ+ 2φ2 + 2φ3 + 2φ4
More generally,
For every i = 0, 1, . . . after iteration 1 + 4 · i : 1−φ2i
−→ , 1−→, φ−φ2i+1
←−Ford-Fulkerson does not terminate!|f | = 1 + 2
∑2ik=1 Φi ≈ 4.23607 < 5
It does not even converge to a maximum flow!
iterations
flow value
1 5 9 13 17 21 25 29 33 37 41 45 49
1
2
3
4
5
6
7
6.3: Maximum Flows T.S. 7
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Summary and Outlook
works only for integral (rational) capacities
Runtime: O(E · |f max|) = O(E · V · C)
Ford-Fulkerson Method
Idea: Find an augmenting path with high capacity
Consider subgraph of Gf consisting of edges (u, v) with cf (u, v) > ∆
scaling parameter ∆, which is initially 2dlog2 Ce and 1 after termination
Runtime: O(E2 · log C)
Capacity-Scaling Algorithm
Idea: Find the shortest augmenting path in Gf
Runtime: O(E2 · V )
Edmonds-Karp Algorithm
6.3: Maximum Flows T.S. 19
Outline
Analysis of Ford-Fulkerson
Matchings in Bipartite Graphs
Introduction and Line Intersection
6.3: Maximum Flows T.S. 20
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Application: Maximum-Bipartite-Matching Problem
A matching is a subset M ⊆ E such that for allv ∈ V , at most one edge of M is incident to v .
Matching
A graph G is bipartite if V can be partitioned into Land R so that all edges go between L and R.
Bipartite Graph
Given a bipartite graph G = (L ∪ R,E), find amatching of maximum cardinality.
L R
Jobs Machines
6.3: Maximum Flows T.S. 21
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Matchings in Bipartite Graphs via Maximum Flows
a
b
c
d
e
f
g
h
i
j
k
l
s t
Every edge in the flownetwork has capacity 1
6.3: Maximum Flows T.S. 22
Correspondence between Maximum Matchings and Max Flow
The cardinality of a maximum matching M in a bipartite graph G equalsthe value of a maximum flow f in the corresponding flow network G̃.
Theorem (Corollary 26.11)
a
b
c
d
e
f
g
h
i
j
k
l
Graph G
a
b
c
d
e
f
g
h
i
j
k
l
s t
Graph G̃
6.3: Maximum Flows T.S. 23
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Matching to Flow
Given a maximum matching of cardinality k
Consider flow f that sends one unit along each each of k paths
⇒ f is a flow and has value k
max cardinality matching ≤ value of maxflow
Graph G
s t
Graph G̃
6.3: Maximum Flows T.S. 24
From Flow to Matching
Let f be a maximum flow in G̃ of value k
Integrality Theorem
⇒ f (u, v) ∈ {0, 1} and k integral
Let M ′ be all edges from L to R which carry a flow of onea) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R
6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value k
Integrality Theorem
⇒ f (u, v) ∈ {0, 1} and k integral
Let M ′ be all edges from L to R which carry a flow of onea) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R
L R
6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value k
Integrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R
L R
6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integral
Let M ′ be all edges from L to R which carry a flow of onea) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R
L R
6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation
⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation
⇒ every node in L sends at most one unitb) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unit
b) Flow Conservation
⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unit
c) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unitc) Cut (L ∪ {s},R ∪ {t})
⇒ net flow is k ⇒ M ′ has k edges⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unitc) Cut (L ∪ {s},R ∪ {t})⇒ net flow is k
⇒ M ′ has k edges⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unitc) Cut (L ∪ {s},R ∪ {t})⇒ net flow is k ⇒ M ′ has k edges
⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unitc) Cut (L ∪ {s},R ∪ {t})⇒ net flow is k ⇒ M ′ has k edges⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
From Flow to Matching
Let f be a maximum flow in G̃ of value kIntegrality Theorem⇒ f (u, v) ∈ {0, 1} and k integralLet M ′ be all edges from L to R which carry a flow of one
a) Flow Conservation⇒ every node in L sends at most one unitb) Flow Conservation⇒ every node in R receives at most one unitc) Cut (L ∪ {s},R ∪ {t})⇒ net flow is k ⇒ M ′ has k edges⇒ By a) & b), M ′ is a matching and by c), M ′ has cardinality k
value of maxflow ≤ max cardinality matching
s t
1/1
1/1
1/1
L R L R6.3: Maximum Flows T.S. 25
7: Geometric AlgorithmsFrank Stajano Thomas Sauerwald
Lent 2015
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 � p3)⇥ (p4 � p3) = (3, 1)⇥ (1, 3) = 8
(p2 � p3)⇥ (p4 � p3) = (�1, 3)⇥ (1, 3) = �6
Opposite signs ) p1p2 crosses(infinite) line through p3 and p4
Opposite signs ) p1p2 crosses(infinite) line through p3 and p4
(p3 � p1)⇥ (p2 � p1) = (�3,�1)⇥ (�4, 2) = �10
(p4 � p1)⇥ (p2 � p1) = (�2, 2)⇥ (�4, 2) = 4
Opposite signs ) p3p4 crosses(infinite) line through p1 and p2
Opposite signs ) p3p4 crosses(infinite) line through p1 and p2
p1p2 crosses p3p4
p3
p4
(p3 � p1)⇥ (p2 � p1) < 0
(p4 � p1)⇥ (p2 � p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 21
Outline
Analysis of Ford-Fulkerson
Matchings in Bipartite Graphs
Introduction and Line Intersection
7: Geometric Algorithms T.S. 2
Introduction
Branch that studies algorithms forgeometric problems
typically, input is a set of points, linesegments etc.
Computational Geometry
computer graphics
computer vision
textile layout
VLSI design...
Applications
p1
p2
p3
p4
Do these lines intersect?
7: Geometric Algorithms T.S. 3
Introduction
Branch that studies algorithms forgeometric problems
typically, input is a set of points, linesegments etc.
Computational Geometry
computer graphics
computer vision
textile layout
VLSI design...
Applications
p1
p2
p3
p4
Do these lines intersect?
7: Geometric Algorithms T.S. 3
Introduction
Branch that studies algorithms forgeometric problems
typically, input is a set of points, linesegments etc.
Computational Geometry
computer graphics
computer vision
textile layout
VLSI design...
Applications
p1
p2
p3
p4
Do these lines intersect?
7: Geometric Algorithms T.S. 3
Introduction
Branch that studies algorithms forgeometric problems
typically, input is a set of points, linesegments etc.
Computational Geometry
computer graphics
computer vision
textile layout
VLSI design...
Applications
p1
p2
p3
p4
Do these lines intersect?
7: Geometric Algorithms T.S. 3
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2
= det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)
= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1
= 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1
= 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1
= y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1 = y1x2 − y2x1
= −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1 = y1x2 − y2x1 = −(p1 × p2)
= −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1 = y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product (Area)
How large is this area?
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p1 + p2 = (3, 4)
Alternatively, one could take the dot-product (butnot used here): p1 · p2 = ‖p1‖ · ‖p2‖ · cos(φ).
p1 × p2 = det(
x1 x2
y1 y2
)= x1y2 − x2y1 = 2 · 3− 1 · 1 = 5
p2 × p1 = y1x2 − y2x1 = −(p1 × p2) = −5
7: Geometric Algorithms T.S. 4
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Cross Product in 3D
y
x
z
p1
p2
p3
p1 + p2
p1 × p2 = (0, 0, x1y2 − x2y1)
p1 × p3
(p1 × · ) > 0
(p1 × · ) < 0
Right-hand rule gives direction of p1 × p2
7: Geometric Algorithms T.S. 5
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (1/2)
x
y
(0, 0)
p1 = (2, 1)
p2 = (1, 3)
p3 = (1,−1)
p1 × p2 > 0: left (counterclockwise) turn
p1 × p3 < 0: right (clockwise) turn
Sign of cross product determines turn!
Cross product equals zero iff vectors are colinear
7: Geometric Algorithms T.S. 6
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Using Cross product to determine Turns (2/2)
x
y
p0 = (2, 1)
(0, 0)
p1 = (4, 2)
p2 = (3, 4)
p3 = (3, 0)
(p1 − p0) × (p2 − p0) > 0: left turn
(2, 1) × (1, 3) = 5
(p1 − p0) × (p3 − p0) < 0: right turn
(2, 1) × (1,−1) = −3
7: Geometric Algorithms T.S. 7
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3)
= (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3)
= 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3)
= (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3)
= −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1)
= (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2)
= −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1)
= (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2)
= 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇
p1p2 ∩ p̃3p4 6= ∅
p̃1p2 ∩ p̃3p4 ⊇
p̃1p2 ∩ p3p4 6= ∅
Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅
Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection (without Trigonometry and Division!)
x
y
1
2
3
4
1 2 3 4 5(0, 0)
p3
p4
p2
p1
(p1 − p3)× (p4 − p3) = (3, 1)× (1, 3) = 8
(p2 − p3)× (p4 − p3) = (−1, 3)× (1, 3) = −6
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
Opposite signs ⇒ p1p2 crosses(infinite) line through p3 and p4
(p3 − p1)× (p2 − p1) = (−3,−1)× (−4, 2) = −10
(p4 − p1)× (p2 − p1) = (−2, 2)× (−4, 2) = 4
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
Opposite signs ⇒ p3p4 crosses(infinite) line through p1 and p2
p̃1p2 ∩ p̃3p4 ⊇ p1p2 ∩ p̃3p4 6= ∅p̃1p2 ∩ p̃3p4 ⊇ p̃1p2 ∩ p3p4 6= ∅Since p̃1p2 ∩ p̃3p4 consists of (at most) one point⇒ p1p2 ∩ p3p4 6= ∅
p1p2 crosses p3p4
p3
p4
(p3 − p1)× (p2 − p1) < 0
(p4 − p1)× (p2 − p1) < 0
p1p2 does not cross p3p4
7: Geometric Algorithms T.S. 8
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9
Solving Line Intersection
x
y
(0, 0)
p3
p4
p2
p1
DIRECTION(p3, p4, p1) = (p1 − p3)× (p4 − p3)
0: DIRECTION(pi , pj , pk )1: return (pk − pi )× (pj − pi )
0: SEGMENTS-INTERSECT(pi , pj , pk )1: d1 = DIRECTION(p3, p4, p1)2: d2 = DIRECTION(p3, p4, p2)3: d3 = DIRECTION(p1, p2, p3)4: d4 = DIRECTION(p1, p2, p4)5: If d1 · d2 < 0 and d3 · d4 < 0 return TRUE6: · · · (handle all degenerate cases)
In total 4 satisfying conditions!
Lines could touch or be colinear
p2
p1
p3
p4
p2
p1
p4
p3
7: Geometric Algorithms T.S. 9