Академический Документы
Профессиональный Документы
Культура Документы
School of Mathematical and Physical Sciences, Faculty of Science and Information Technology, University of Newcastle, Australia
Semester 2
Lec 8
Recap
What is the difference between a graph and digraph (i.e. network)? What are three different ways of characterizing a tree? What is a subgraph? What is a spanning tree? What is a minimum spanning tree (MST)? How does Prims algorithm work? What is a cut? What is a cut induced by an edge of a spanning tree? What does the interchangeable property (i.e. Property 2) tell us about spanning trees? What is the cut optimality condition for MST? How can the cut optimality condition be used to prove that Prims algorithm constructs an MST?
Lec 8
Recap
What is the difference between a graph and digraph (i.e. network)?
Lec 8
Example: Find the shortest path from node 1 to node 5 (i.e. s=1, t=5) Shortest path is (1, 2, 3, 5) with cost 8. (why?)
1 5 8 9
2
2
3
2
1
1
Lec 8
Example: Find the shortest path from node 1 to node 5 (i.e. s=1, t=5) Shortest path is (1, 2, 3, 5) with cost 8. (why?)
1 5 8 9
2
2
3
2
1
1
Enumeration: Path 1: (1,2,3,5) with cost 8 Path 2: (1,2,5) with cost 9 Path 3: (1,2,4,5) with cost 12 Path 4: (1,4,5) with cost 10
Lec 8
Example: Find the shortest path from node 1 to node 5 (i.e. s=1, t=5) Shortest path is (1, 2, 3, 5) with cost 8. (why?)
1 5 8 9
2
2
3
2
1
1
Enumeration: Path 1: (1,2,3,5) with cost 8 Path 2: (1,2,5) with cost 9 Path 3: (1,2,4,5) with cost 12 Path 4: (1,4,5) with cost 10 Logical deduction: The shortest path must use one of the arcs (4,5), (2,5), and (3,5). The cost of any path using arcs (2,5), or (4,5) is at least 9. The only path that does not use arcs (4,5) and (2,5) is the path (1, 2, 3, 5) with cost 8 and therefore optimal.
Lec 8
Lec 8
Max no. of paths between a pair of nodes (n!) 3628800 2432902008176640000 30414093201713378043612608166065(32 more digits) 93326215443944152681699238856267(126 more digits) : 402387260077093773543702433923(2,538 more digits)
Lec 8
Find the shortest (either time or distance) path from origin to destination
Lec 8
If the company requires a car for 5 years, what is the optimal strategy?
Lec 8
If the company requires a car for 5 years, what is the optimal strategy? A network model:
node arc length
i i i
cij
Start of year i
j j
Buy a car at the start of year i and drive until start of year j (i < j) Cost of buying a car at the start of year i + cost of j-i years of maintenance trade-in value of (j-i) year-old car
Lec 8
If the company requires a car for 5 years, what is the optimal strategy?
19+1+2+5-6 = 21 19+1+2-10 = 12
1
19+1-12 = 8
3
18.5+1+2-10 = 11.5
Lec 8
Lec 8
Lec 8
Lec 8
di tracks the distance of the shortest path found so far from s to node i. pi tracks the node that precedes i on the shortest path found so far from s to i.
Lec 8
di tracks the distance of the shortest path found so far from s to node i. pi tracks the node that precedes i on the shortest path found so far from s to i.
Lec 8
di tracks the distance of the shortest path found so far from s to node i. pi tracks the node that precedes i on the shortest path found so far from s to i.
Lec 8
2
2
5 8 9
3
2
1
1
Lec 8
2
2
5 8 9
3
2
1
1
4
Unlabelled nodes Labelled nodes
10
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4.
1
1
4
Unlabelled nodes Labelled nodes
Update distance and predecessor labels for neighbouring nodes of i: for all nodes j s.t. (i,j) is an arc if dj > di + cij then set dj to di + cij and set pj to i.
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled.
1
1
4
Unlabelled nodes Labelled nodes
5
Update distance and predecessor labels for neighbouring nodes of i: for all nodes j s.t. (i,j) is an arc if dj > di + cij then set dj to di + cij and set pj to i.
11
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Update distance and predecessor labels for neighbouring nodes of i: for all nodes j s.t. (i,j) is an arc if dj > di + cij then set dj to di + cij and set pj to i.
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
12
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5.
Update distance and predecessor labels for neighbouring nodes of i: for all nodes j s.t. (i,j) is an arc if dj > di + cij then set dj to di + cij and set pj to i.
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5. Step 4. Mark node 4 as labelled.
4 (,-) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2)
13
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5. Step 4. Mark node 4 as labelled.
4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
Step 2. Pick unlabelled node with minimum distance label, i.e, node 3. Step 3. Update distance and predecessor labels for node 5.
Update distance and predecessor labels for neighbouring nodes of i: for all nodes j s.t. (i,j) is an arc if dj > di + cij then set dj to di + cij and set pj to i.
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5. Step 4. Mark node 4 as labelled.
4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
Step 2. Pick unlabelled node with minimum distance label, i.e, node 3. Step 3. Update distance and predecessor labels for node 5. Step 4. Mark node 3 as labelled.
14
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5.
1
1
4
Unlabelled nodes Labelled nodes
Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5. Step 4. Mark node 4 as labelled.
4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
Step 2. Pick unlabelled node with minimum distance label, i.e, node 3. Step 3. Update distance and predecessor labels for node 5. Step 4. Mark node 3 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 5. Step 3. No distance and predecessor labels need updating. Step 4. Mark 5 as labelled. No unlabelled labels remaining. STOP
Lec 8
2
2
5 8 9
3
2
Step 2. Pick unlabelled node with minimum distance label, i.e, node 1. Step 3. Update distance and predecessor labels for nodes 2 and 4. Step 4. Mark node 1 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 2 (node 4 is also possible). Step 3. Update distance and predecessor labels for nodes 3,4 and 5. Step 4. Mark node 2 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 4. Step 3. Update distance and predecessor label for node 5. Step 4. Mark node 4 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 3. Step 3. Update distance and predecessor labels for node 5. Step 4. Mark node 3 as labelled. Step 2. Pick unlabelled node with minimum distance label, i.e, node 5. Step 3. No distance and predecessor labels need updating. Step 4. Mark 5 as labelled. No unlabelled labels remaining. STOP
1
1
4
Unlabelled nodes Labelled nodes
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (6,2) (6,2) (6,2) 4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
0 1 2 3 4
15
Lec 8
2
2
5 8 9
3
The shortest path from 1 to 5 is: (1,2,3,5) with cost 8
2
1
1
4
Unlabelled nodes Labelled nodes
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (6,2) (6,2) (6,2) 4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
0 1 2 3 4
Lec 8
2
2
5 8 9
3
The shortest path from 1 to 5 is: (1,2,3,5) with cost 8
2
1
1
4
Unlabelled nodes Labelled nodes
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (6,2) (6,2) (6,2) 4 (,-) (1,1) (1,1) (1,1) (1,1) 5 (,-) (,-) (9,2) (9,2) (8,3)
0 1 2 3 4
16
Lec 8
2 1
50
200
3
150
(0,-)
4
Unlabelled nodes Labelled nodes
40
Lec 8
Node 1 2 (,-) (100,1) 3 (,-) (,-) 4 (,-) (200,1) 5 (,-) (,-) 6 (,-) (,-)
2
1
50
200
3
150
0 1
(0,-) (0,-)
4
Unlabelled nodes Labelled nodes
40
17
Lec 8
Node 1 2 (,-) (100,1) (100,1) 3 (,-) (,-) (300,2) 4 (,-) (200,1) (150,2) 5 (,-) (,-) (200,2) 6 (,-) (,-) (,-)
2 1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) 6 (,-) (,-) (,-) (,-)
2
1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3
18
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5)
2 1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5) (290,5)
2
1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4 5
19
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5) (290,5) (290,5)
2 1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4 5 6
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5) (290,5) (290,5)
2
1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4 5 6
The shortest path from 1 to 6 is: (1,2,4,5,6) with cost 290 Note: once a node is labelled, its distance and predecessor label is never changed. Hence, once a node is labelled, its distance label gives the shortest distance from s to that node. We could therefore have stopped at iteration 5.
20
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5) (290,5) (290,5)
2 1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4 5 6
The shortest path from 1 to 6 is: (1,2,4,5,6) with cost 290 Note: once a node is labelled, its distance and predecessor label is never changed. Hence, once a node is labelled, its distance label gives the shortest distance from s to that node. We could therefore have stopped at iteration 5. Q. Does Dikstras algorithm always find the shortest path?
Lec 8
Node 1 2 (,-) (100,1) (100,1) (100,1) (100,1) (100,1) (100,1) 3 (,-) (,-) (300,2) (300,2) (300,2) (300,2) (300,2) 4 (,-) (200,1) (150,2) (150,2) (150,2) (150,2) (150,2) 5 (,-) (,-) (200,2) (190,4) (190,4) (190,4) (190,4) 6 (,-) (,-) (,-) (,-) (290,5) (290,5) (290,5)
2
1
50
200
3
150
0 1
4
Unlabelled nodes Labelled nodes
40
2 3 4 5 6
The shortest path from 1 to 6 is: (1,2,4,5,6) with cost 290 Note: once a node is labelled, its distance and predecessor label is never changed. Hence, once a node is labelled, its distance label gives the shortest distance from s to that node. We could therefore have stopped at iteration 5. Q. Does Dikstras algorithm always find the shortest path? A. No.
21
Lec 8
2 1
10
4
1
0 1
(0,-)
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
Lec 8
Node 1 2 (,-) (1,1) 3 (,-) (,-) 4 (,-) (,-) 5 (,-) (,-) 6 (,-) (,-)
2
1
10
4
1
0 1
(0,-) (0,-)
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
22
Lec 8
Node 1 2 (,-) (1,1) (1,1) 3 (,-) (,-) (11,2) 4 (,-) (,-) (2,2) 5 (,-) (,-) (,-) 6 (,-) (,-) (,-)
2 1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
Lec 8
Node 1 2 (,-) (1,1) (1,1) (1,1) 3 (,-) (,-) (11,2) (11,2) 4 (,-) (,-) (2,2) (2,2) 5 (,-) (,-) (,-) (,-) 6 (,-) (,-) (,-) (3,4)
2
1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
23
Lec 8
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (11,2) (11,2) (11,2) 4 (,-) (,-) (2,2) (2,2) (2,2) 5 (,-) (,-) (,-) (,-) (,-) 6 (,-) (,-) (,-) (3,4) (3,4)
2 1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
Lec 8
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (11,2) (11,2) (11,2) (11,2) 4 (,-) (,-) (2,2) (2,2) (2,2) (2,2) 5 (,-) (,-) (,-) (,-) (,-) (-89,3) 6 (,-) (,-) (,-) (3,4) (3,4) (3,4)
2
1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
24
Lec 8
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (11,2) (11,2) (11,2) (11,2) (11,2) 4 (,-) (,-) (2,2) (2,2) (2,2) (2,2) (-88,5) 5 (,-) (,-) (,-) (,-) (,-) (-89,3) (-89,3) 6 (,-) (,-) (,-) (3,4) (3,4) (3,4) (3,4)
2 1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
Lec 8
Node 1 2 (,-) (1,1) (1,1) (1,1) (1,1) (1,1) (1,1) 3 (,-) (,-) (11,2) (11,2) (11,2) (11,2) (11,2) 4 (,-) (,-) (2,2) (2,2) (2,2) (2,2) (-88,5) 5 (,-) (,-) (,-) (,-) (,-) (-89,3) (-89,3) 6 (,-) (,-) (,-) (3,4) (3,4) (3,4) (3,4)
2
1
10
4
1
0 1
3
Unlabelled nodes Labelled nodes
-100
2 3 4 5 6
Q. Does Dikstras algorithm always find the shortest path? A. No. Not if there are negative cost arcs. Q. Are there other algorithms that can find the shortest path when there are negative cost arcs?
25
Lec 8
2 1
50
200
3
150
Path 2: (1,2,3,5,2,3,6) with cost 250 Path 3: (1,2,3,5,2,3,5,2,3,6) with cost 100
40
Path 3: (1,2,3,5,2,3,5,2,3,5,2,3,6) with cost -50 Path 4: (1,2,3,5,2,3,5,2,3,5,2,3,5,2,3,6) with cost -200
Lec 8
2
1
50
200
3
150
40
Path 3: (1,2,3,5,2,3,5,2,3,5,2,3,6) with cost -250 Path 4: (1,2,3,5,2,3,5,2,3,5,2,3,5,2,3,6) with cost -400
Q. What is the shortest path from 1 to 6 that does not contain any cycles?
26
Lec 8
2 1
50
200
3
150
40
Path 3: (1,2,3,5,2,3,5,2,3,5,2,3,6) with cost -250 Path 4: (1,2,3,5,2,3,5,2,3,5,2,3,5,2,3,6) with cost -400
Q. What is the shortest path from 1 to 6 that does not contain any cycles? Q. Are there algorithms that can find the shortest path when there are negative cost arcs? A. Yes, there are efficient algorithms when there are no negative cost cycles. Q. Are there algorithms that can find the shortest path that does not contain any cycles?
Lec 8
2
1
50
200
3
150
40
Path 3: (1,2,3,5,2,3,5,2,3,5,2,3,6) with cost -250 Path 4: (1,2,3,5,2,3,5,2,3,5,2,3,5,2,3,6) with cost -400
Q. What is the shortest path from 1 to 6 that does not contain any cycles? Q. Are there algorithms that can find the shortest path when there are negative cost arcs? A. Yes, there are efficient algorithms when there are no negative cost cycles. Q. Are there algorithms that can find the shortest path that does not contain any cycles? A. Yes but they are not efficient. This can be a very difficult problem.
27
Lec 8
Lec 8
28
Lec 8
Lec 8
Dijkstra
Bi-directional Dijkstra
Bi-directional Dijkstra + A*
29
Lec 8
Lec 8
30
Lec 8
4 1 6
3
4
2
3
Think of arcs in network as conduits carrying flow. Given a network with nodes N and arcs A, for each arc e = (i,j) in A we associate an amount xe (or xij) corresponding to the amount of flow through arc e. A = {(1,2), (1,4), (2,3), (2,4), (4,3)} X = (x1,2, x1,4, x2,3, x2,4, x4,3) = (4,3,2,1,6) Flow vector
Flow
For a graph with nodes N and arcs A, the vector X is called a flow.
Lec 8
4 1 6
3
4
2
3
Q. What is the net flow into node 3? 8 Q. What is the net flow into node 4? 4 Q. What is the net flow out of node 3? 0 Q. What is the net flow out of node 4? 6
31
Lec 8
[1,3]
4
[0,4] [0,5]
3
Bounds on flow
For each arc e, we may be given a lower and/or upper bound le and ue respectively on the allowable flow along e.
A = {(1,2), (1,4), (2,3), (2,4), (4,3)} L = (l1,2, l1,4, l2,3, l2,4, l4,3) = (0,1,0,2,0) U = (u1,2, u1,4, u2,3, u2,3, u4,3) = (5,3,4,3,5) Note: If a lower bound is not given then we can assume it is 0, i.e., we do not have ve flow.
Lec 8
[1,3]
4
[0,4] [0,5]
3
32
Lec 8
[1,3]
4
[0,4] [0,5]
3
3
4
Lec 8
[1,3]
4
Flow 1
1
Flow 3
2 1
2 2 3
3 2 4
5 2 5
1
4
0
3
2
4
1
3
3
4
3
3
Note: if flow balance is satisfied, then the net flow out of s = net flow into t. This net flow out of s (or into t) is the amount of flow that is pushed through from s to t.
33
Lec 8
[1,3]
4
Flow 1
1
Flow 3
2 1
2 2 3
3 2 4
5 2 5
1
4
0
3
2
4
1
3
3
4
3
3
Flow from s to t = 3
Flow from s to t = 5
Flow from s to t = 8
Lec 8
Flow 1
1
Flow 2
2 1
Flow 3
2 1
2 2 3
3 2 4
5 2 5
1
4
0
3
2
4
1
3
3
4
3
3
Flow from s to t = 3
Flow from s to t = 5
Flow from s to t = 8
34
Lec 8
2 10 1 8 3
12
10
6 12
10 10
35