Professional Documents
Culture Documents
Programming Problems
The Primal-Dual
Relationship
Concept of Duality
.
Example:
Maximize ZX = 6000X1+4000X2
s.t. 4X1 + X2 <or= 12
9X1 + X2 <or= 20
7X1 + 3X2 <or= 18
10X1 +40X2 <or= 40
X1,X2 >or= 0
Primal Variab
X1 X
Y1 4
les
l
Hence the Dual Problem looks like,
Minimize ZY = 12Y1+20Y2+18Y3+40Y4
subject to the constraints,
4Y1+9Y2+7Y3+10Y4 >or= 6000
Y1+ Y2+3Y3+40Y4 >or= 4000
Y1,Y2 >or= 0
Linear Programming
Sensitivity Analysis
What if there is uncertainly about one or
more values in the LP model?
1. An OFC changes, or
2. A RHS changes
8
Max X7 T + 5 C (profit)
Clearly profit goes up, but would we want to
make more tables and less chairs?
(i.e. Does the optimal solution change?)
Characteristics of OFC Changes
• There is no effect on the feasible region
200
Feasible
100
Region
0
0 100 200 300 400 500 T
C
1000
What if the OFC
became higher? Both have new
Or lower? optimal corner
points
11T + 5C = $5500 600
Optimal Solution 450
(T=500, C=0)
3T + 5C = $2850
Optimal Solution Feasible
(T=200, C=450) Region
0
0 100 500 800 T
• There is a range for each OFC where the
current optimal corner point remains
optimal.
2T
Profit=$4820
2T
Original
+
1C
+1C
100 Feasible
=1
=1
00
0
300
Region
0
6X1 + 5X2 ≤ 30
Optimal
solution
Solution if
rounding off
Integer Solution to Harrison
Electric Co. (continued)
Rounding off is one way to reach integer
solution values, but it often does not yield the
best solution.
An important concept to understand is that an
integer programming solution can never be
better than the solution to the same LP problem.
The integer problem is usually worse in terms
of higher cost or lower profit.
Branch and Bound Method
Branch and Bound break the feasible
solution region into sub-problems until an
optimal solution is found.
There are Six Steps in Solving Integer
Programming Maximization Problems by
Branch and Bound.
The steps are given over the next several
slides.
Branch and Bound Method: The
Six Steps
1. Solve the original problem using LP.
If the answer satisfies the integer constraints,
it is done.
If not, this value provides an initial upper
bound.
1. Find any feasible solution that meets the
integer constraints for use as a lower bound.
Usually, rounding down each variable will
accomplish this.
Branch and Bound Method
Steps: (continued)
3. Branch on one variable from Step 1 that does not
have an integer value.
Split the problem into two sub-problems based on
integer values that are immediately above and below
the non-integer value.
For example, if X2 = 3.75 was in the final LP solution,
introduce the constraint X2 ≥ 4 in the first sub-
problem and X2 ≤ 3 in the second sub-problem.
3. Create nodes at the top of these new branches by
solving the new problems.
Branch and Bound Method
Steps: (continued)
5.
a) If a branch yields a solution to the LP
problem that is not feasible, terminate the
branch.
b) If a branch yields a solution to the LP
problem that is feasible, but not an integer
solution, go to step 6.
Branch and Bound Method
Steps: (continued)
5. (continued)
c) If the branch yields a feasible integer solution,
examine the value of the objective function.
If this value equals the upper bound, an
optimal solution has been reached.
If it is not equal to the upper bound, but
exceeds the lower bound, set it as the new
lower bound and go to step 6.
Finally, if it is less than the lower bound,
terminate this branch.
Branch and Bound Method
Steps: (continued)
6. Examine both branches again and set the upper bound equal to
the maximum value of the objective function at all final nodes.
– If the upper bound equals the lower bound, stop.
– If not, go back to step 3.
Subproblem A
maximize profit = $7X1 + $6X2
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
Subproblem B
X1 ≥4
maximize profit = $7X1 + $6X2
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≤3
Optimal Solution for Sub-
Optimal solutions are:problems
Sub-problem A: X1 = 4; X2 = 1.2,
profit=$35.20
Sub-problem B: X1=3, X2=2,
profit=$33.00
(see figure on next slide)
Stop searching on the Subproblem B branch because it has
an all-integer feasible solution.
The $33 profit becomes the lower bound.
Subproblem A’s branch is searched further since it has a
non-integer solution.
The second upper bound becomes $35.20, replacing $35.25
from the first node.
Optimal Solution for Sub-
problem
Sub-problems C and D
Subproblem A’s branching yields Subproblems C and
D.
Subproblem C
maximize profit = $7X1 + $6X2
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1
Subproblem ≥D4
X2 2 ≥ 2
maximize profit = $7X1 + $6X
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X2 ≤ 1
Sub-problems C and D
(continued)
Subproblem C has no feasible solution at all because
the first two constraints are violated if the X1 ≥ 4 and
X2 ≥ 2 constraints are observed.
Terminate this branch and do not consider its
solution.
Subproblem D’s optimal solution is
X1 = 4 , X2 = 1, profit = $35.16.
This non-integer solution yields a new upper
bound of $35.16, replacing the original $35.20.
Subproblems C and D, as well as the final branches
for the problem, are shown in the figure on the next
slide.
Branch and Bound
Solution
Subproblems E and F
Finally, create subproblems E and F and
solve for X1 and X2 with the added
constraints X1 ≤ 4 and X1 ≥ 5. The
subproblems and their solutions are:
Subproblem E
maximize profit = $7X1 + $6X2
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X1 ≤4
X2 ≤ 1
Optimal solution for E:
Subproblems E and F
(continued)
Subproblem F
maximize profit = $7X1 + $6X2
Subject to: 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X1 ≥5
X2 ≤ 1
Optimal solution for F:
X1 = 5, X2 = 0, profit = $35
Goal Programming
Firms usually have more than one goal. For example,
maximizing total profit,
maximizing market share,
maintaining full employment,
providing quality ecological management,
minimizing noise level in the neighborhood, and
meeting numerous other non-economic goals.
It is not possible for LP to have multiple goals unless they are
all measured in the same units (such as dollars),
a highly unusual situation.
An important technique that has been developed to supplement
LP is called goal programming.
Goal Programming (continued)
Goal programming “satisfices,”
as opposed to LP, which tries to “optimize.”
Satisfice means coming as close as possible to
reaching goals.
The objective function is the main difference
between goal programming and LP.
In goal programming, the purpose is to minimize
deviational variables,
which are the only terms in the objective function.
Example of Goal Programming
Harrison Electric Revisited
Goals Harrison’s management wants to
achieve, each equal in priority:
Goal 1: to produce as much profit above $30 as possible
during the production period.
Goal 2: to fully utilize the available wiring department hours.
Goal 3: to avoid overtime in the assembly department.
Goal 4: to meet a contract requirement to produce at least
seven ceiling fans.
Example of Goal Programming
Harrison Electric Revisited
Need a clear definition of deviational variables, such as :
Cj - Zj 0 0 0 0 0 0 0 0 1 0
Zj 2 3 0 1 0 0 0 -1 0 0 12
P2 {
Cj - Zj -2 -3 0 0 0 0 0 1 0 0
{ Zj 7 6 1 0 0 0 -1 0 0 0 3
P1
Cj - Zj -7 -6 0 0 0 0 1 0 0 0 0
Second Goal
Programming Tableau
Cj 0 0 P1 P2 0 P4 0 0 P3 0
Solution x1 x2 d1- d2- d3- d4- d1+ d2+ d3+ d4+ Quantity
Mix
P1 x1 1 6/7 1/7 0 0 0 -1/7 0 0 0 30/7
P2 d2- 0 9/7 -2/7 1 0 0 +2/7 -1 0 0 24/7
0 d3- 0 -1/7 -6/7 0 1 0 6/7 0 -1 0 30/7
P4 d4- 0 1 0 0 0 1 0 0 0 -1 7
Zj 0 1 0 0 0 1 0 0 0 -1 7
P4 {
Cj - Zj 0 -1 0 0 0 0 0 0 0 +1
{ Zj 0 0 0 0 0 0 0 0 0 0 0
P3
Pivot Column
Cj - Zj 0 0 0 0 0 0 0 0 1 0
Zj 0 9/7 -2/7 1 0 0 2/7 -1 0 0 24/7
P2 {
Cj - Zj 0 -9/7 +2/7 0 0 0 -2/7 +1 0 0
{ Zj 0 0 0 0 0 0 0 0 0 0 0
P1
Cj - Zj 0 0 1 0 0 0 1 0 0 0
Final Solution to Harrison Electric’s
Goal Programming
Cj 0 0 P1 P2 0 P4 0 0 P3 0
Solution x1 x2 d1- d2- d3- d4- d1+ d2+ d3+ d4+ Quantity
Mix
P1 d2+ 8/5 0 0 -1 3/5 0 0 1 -3/5 0 6
P2 x2 6/5 1 0 0 1/5 0 0 0 -1/5 0 6
0 d1+ 1/5 0 -1 0 6/5 0 1 0 -6/5 0 6
P4 d4+ -6/5 0 0 0 -1/5 1 0 0 1/5 -1 1
Zj -6/5 0 0 0 -1/5 1 0 0 1/5 -1 1
P4 {
Cj - Zj 6/5 0 0 0 1/5 0 0 0 -1/5 -1
{ Zj 0 0 0 0 0 0 0 0 0 0 0
P3
Cj - Zj 0 0 0 0 0 0 0 0 1 0
Zj 0 0 0 0 0 0 0 0 0 0 0
P2 {
Cj - Zj 0 0 0 1 0 0 0 0 0 0
{ Zj 0 0 0 0 0 0 0 0 0 0 0
P1
Cj - Zj 0 0 1 0 0 0 0 0 0 0
Transportation Problem (TP)
and Assignment Problem
(AP)
(special cases of Linear Programming)
1. Transportation Problem (TP)
Distributing any commodity from any group
of supply centers, called sources, to any group
of receiving centers, called destinations, in
such a way as to minimize the total
distribution cost (shipping cost).
1. Transportation Problem (TP)
Total supply must equal total demand.
If total supply exceeds total demand, a dummy
destination, whose demand equals the difference
between the total supply and total demand is
created. Similarly if total supply is less than total
demand, a dummy source is created, whose supply
equals the difference.
All unit shipping costs into a dummy destination or
out of a dummy source are 0.
Example 1:
Example 2:
Destination Supply
D1 D2 D3 D4
S1 50 75 35 75 12
Source S2 65 80 60 65 17
S3 40 70 45 55 11
(D) 0 0 0 0 10
Demand 15 10 15 10
Transportation Tableau:
Initial Solution Procedure:
1. Northwest Corner Starting Procedure
1. Select the remaining variable in the upper left
(northwest) corner and note the supply remaining in
the row, s, and the demand remaining in the column,
d.
2. Allocate the minimum of s or d to this variable. If
this minimum is s, eliminate all variables in its row
from future consideration and reduce the demand in
its column by s; if the minimum is d, eliminate all
variables in the column from future consideration and
reduce the supply in its row by d.
REPEAT THESE STEPS UNTIL ALL SUPPLIES HAVE BEEN
ALLOCATED.
Total sipping cost = 2250
2. Least Cost Starting Procedure
1. For the remaining variable with the lowest unit
cost, determine the remaining supply left in its
row, s, and the remaining demand left in its
column, d (break ties arbitrarily).
2. Allocate the minimum of s or d to this variable.
If this minimum is s, eliminate all variables in its
row from future consideration and reduce the
demand in its column by s; if the minimum is d,
eliminate all variables in the column from future
consideration and reduce the supply in its row by
d.
Total sipping cost = 2065
3. Vogel’s Approximation Method Starting
Procedure
1. For each remaining row and column, determine
the difference between the lowest two remaining
costs; these are called the row and column
penalties.
2. Select the row or column with the largest penalty
found in step 1 and note the supply remaining for
its row, s, and the demand remaining in its column,
d.
3. Allocate the minimum of s or d to the variable in
the selected row or column with the lowest
remaining unit cost. If this minimum is s, eliminate
all variables in its row from future consideration and
reduce the demand in its column by s; if the
minimum is d, eliminate all variables in the column
Total sipping cost = 2030
2. The Assignment Problem (AP) —
a special case of TP with m=n and si=dj for all
i, and j.
J1 J2 J3 J4
W1 7 41 0 1
W2 16 11 1 0
W3 0 0 10 34
(D) 74 99 90 56
D1 D2 D3 D4
S1 50 75 35 75 12
Source S2 65 80 60 65 17
S3 40 70 45 55 11
(D) 0 0 0 0 10
Demand 15 10 15 10
Transportation Tableau:
Initial Solution Procedure:
1. Northwest Corner Starting Procedure
1. Select the remaining variable in the upper left
(northwest) corner and note the supply remaining in
the row, s, and the demand remaining in the column,
d.
2. Allocate the minimum of s or d to this variable. If
this minimum is s, eliminate all variables in its row
from future consideration and reduce the demand in
its column by s; if the minimum is d, eliminate all
variables in the column from future consideration and
reduce the supply in its row by d.
REPEAT THESE STEPS UNTIL ALL SUPPLIES HAVE BEEN
ALLOCATED.
Total sipping cost = 2250
2. Least Cost Starting Procedure
1. For the remaining variable with the lowest unit
cost, determine the remaining supply left in its
row, s, and the remaining demand left in its
column, d (break ties arbitrarily).
2. Allocate the minimum of s or d to this variable.
If this minimum is s, eliminate all variables in its
row from future consideration and reduce the
demand in its column by s; if the minimum is d,
eliminate all variables in the column from future
consideration and reduce the supply in its row by
d.
Total sipping cost = 2065
3. Vogel’s Approximation Method Starting
Procedure
1. For each remaining row and column, determine
the difference between the lowest two remaining
costs; these are called the row and column
penalties.
2. Select the row or column with the largest penalty
found in step 1 and note the supply remaining for
its row, s, and the demand remaining in its column,
d.
3. Allocate the minimum of s or d to the variable in
the selected row or column with the lowest
remaining unit cost. If this minimum is s, eliminate
all variables in its row from future consideration and
reduce the demand in its column by s; if the
minimum is d, eliminate all variables in the column
Total sipping cost = 2030
2. The Assignment Problem (AP) —
a special case of TP with m=n and si=dj for all
i, and j.
J1 J2 J3 J4
W1 7 41 0 1
W2 16 11 1 0
W3 0 0 10 34
(D) 74 99 90 56
Definition:
A Hamiltonian cycle is a tour which contains every node once
Consider the Hamiltonian cycles for this graph
A
There are just three essentially
2 4 different Hamiltonian cycles:
5
4 D 4
C ACBDA with weight 16
6 ABCDA with weight 17
B
ABDCA with weight 17
A A
A
2 4
2 4
5
4 D C D 4 5
C D 4
4 C
6 6
B B
B
However, not all graphs have Hamiltonian cycles.
1-2-3-4 2
Step 5 Move on to node 2 and repeat until each node has been
the start node once
To look for possible improvement in a tour using the tour improvement algorithm:
Here is a network:
Pick A as node 1 and consider the tour from A-C-E-D
A This has weight 8 + 8 + 5 = 21
6 5 Now swap the middle two nodes
6 E
B
8 4 And you get A-E-C-D
5 5 This has weight 5 + 8 + 7 = 20
7 8
So swap E and C and the tour becomes AECDBA
C 7 D Now look at ECDB
ECDB = 8 + 7 + 7 = 22 EDCB = 5 + 7 + 5 = 17
And here is a tour:
So swap C and D and the tour becomes AEDCBA
ACEDBA
Now look at DCBA
It has weight 34
DCBA = 7 + 5 + 6 = 18 DBCA = 7 + 5 + 8 = 20
Let’s see if we can So leave the tour as AEDCBA
improve on that:
Now look at CBAE
We have now had
CBAE = 5 + 6 + 5 = 16 CABE = 8 + 6 + 6 = 20
each node at the
front and so we stop. So leave the tour as AEDCBA
The final tour is Now look at BAED
ADCBEA.
BAED = 6 + 5 + 5 = 16 BEAD = 6 + 5 + 4 = 15
1 2
• Path: A path is a chain in which the terminal node
of each arc is identical to the initial node of next arc.
For example in the figure below (1,2)-(2,3)-(4,3) is a
chain but not a path; (1,2)-(2,3)-(3,4) is a chain and
a path, which represents a way to travel from node 1
to node 4.
1 4
2 3
Essence of Dijkstra’s Shortest- Path
Algorithm
• Key Points regarding the nature of the
algorithm
– In each iteration, the shortest path from the
origin to one of the rest of the nodes is found.
That is, we obtain one new “solved” node in
each iteration. (More than one such path and
node may be found in one iteration when
there is a tie. There may also exist multiple
shortest paths from the origin to some nodes.)
– The algorithm stops when the shortest path to
the destination is found
Essence of Dijkstra’s Shortest- Path
Algorithm
• General thought process involved in each
iteration
– Let S be the current set of “solved nodes” (the
set of nodes whose shortest paths from the
origin been found), N be the set of all nodes,
and N – S be the set of “unsolved nodes
• 1. The next “solved” node should be reachable
directly from one of the solved nodes via one direct
link or arc (these nodes can be called neighboring
nodes of the current solved nodes). Therefore, we
consider only such nodes and all the links
providing the access from the current solved nodes
to these neighboring nodes (but no other links).
Essence of Dijkstra’s Shortest- Path
Algorithm
– 2. For each of these neighboring nodes, find
the shortest path from the origin via only
current solved nodes and the corresponding
distance from the origin
– 3. In general, there exist multiple such
neighboring nodes.The shortest path to one of
these nodes is claimed to have been found.
This node is the one that has the shortest
distance from the origin among these
neighboring nodes being considered. Call this
new node “solved node.”
Algorithm for the Shortest Path
Problem
• Objective of the nth iteration: Find the nth nearest node
to the origin (to be repeated for n = 1, 2, … until the nth
nearest node is the destination)
• Input for the nth Iteration: (n – 1) nearest nodes to the
origin (solved for at the previous iterations), including their
shortest path and distance from the origin. (These nodes
plus the origin will be called solved nodes; the others are
unsolved nodes)
• Candidates for the nth nearest node: Each solved node
that is directly connected by a link to one or more unsolved
nodes provides one candidate the unsolved node with
the shortest connecting link (ties provide additional
candidates)
• Calculation of nth nearest node: For each solved node
and its candidate, add the distance between them and the
distance of the shortest path from the origin to this solved
node. The candidate with the smallest such total distance
is the nth nearest node (ties provide additional solved
nodes), and its shortest path is the one generating this
distance.
The Road System for Seervada Park
• Cars are not allowed into the park
• There is a narrow winding road system for trams
and for jeeps driven by the park rangers
– The road system is shown without curves in the next
slide
– Location O is the entrance into the park
– Other letters designate the locations of the ranger
stations
– The scenic wonder is at location T
– The numbers give the distance of these winding roads
in miles
• The park management wishes to determine
which route from the park entrance to station T
has the smallest total distance for the operation
of the trams
The Road System for Seervada Park
7
A
D 5
2
2
4 T
1
5
O B 7
3
4 1
E
4
C
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• Oth iteration: Shortest distance from node O
to Node O. S = {O}.
• Ist iteration:
– Step 1: Neighboring Nodes = {A, B, C}
– Step 2: Shortest path from O to neighboring
nodes that traverse through the current set of
solved nodes S. Min {2, 5, 4} = 2 (corresponding
to node A).
– Step 3: The shortest path from O to A has been
found with a distance of 2. S = {O, A}
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
A
Solved Nodes 2
O B
5
C
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• 2nd Iteration:
– Step 1: Neighboring nodes = {B, C, D}
– Step 2: Min (Min (2 + 2, 5), 4, (2 + 7)) = 4.
– Step 3: Shortest path from B and C has been
found. S = {O, A, B, C}
• 7
Current Solved Nodes A D
(2) 2
(0) B
5
C
O
4
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• 3rd Iteration:
– Step 1: Neighboring nodes = {D, E}. Only AD, BD,
BE, and CE
– Step 2: Min(Min(2 + 7, 4+4), Min(4 + 3, 4+4)) = 7
– Step 3: The shortest path to E has been found S = {O,
A, B, C, E}
7
A
Current Solved (2) D
4
Nodes
3
B
O (4) E
C 4
(4)
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• Iteration 4
– Step 1: Include (only) Nodes D and T. Include
only arcs AD, BD, ED, & ET
– Step 2: Min((min(2+7, 4+4, 7+1), (7+7))) = 8
– Step 3: Shortest path from node O to Node D
has been found. S = {O, A, B, C, D, E}
7
A
(2) D
4
O 1
(4) B
E T
Current solved nodes 7
(4) (7)
C
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• Iteration 5
– Step 1: Include only node T and include arcs DT and
ET
– Step 2: Min(8+5, 7+7) = 13 (no other competing
nodes)
– Step 3: The shortest path from the origin to T, the
destination, has been found, with a distance of 13
A (2)
Current solved nodes D 5
(8)
B (4) T
(0)
O
7
E
(4) (7)
C
Dijkstra’s Algorithm for Shortest Path
on a Network with Positive Arc Lengths
• Final Solution
• Incidentally, we have also found the nth
nearest node from the origin sequentially
A (2)
(8)
2
2 5
D
4
T
O
B 1
(0) 4 3 (13)
(4)
E
(7)
C
(4)
Shortest-Path Algorithm Applied to
Seervada Park Problem
n Solved Nodes Closest Total Nth Nearest Minimum Last
Directly Connected Connected Distance Node Distance Connection
to Unsolved Nodes Unsolved Node Involved
1 O A 2 A 2 OA
2, 3 O C 4 C 4 OC
A B 2+2=4 B 4 AB
4 A D 2+7=9
B E 4+3=7 E 7 BE
C E 4+4=8
5 A D 2+7=9
B D 4+4=8 D 8 BD
E D 7+1=8 D 8 ED
6 D T 8+5=13 T 13 DT
E T 7+7=14
LP Formulation of the Shortest
Path Problem
• Consider the following shortest path
problem from node 1 to node 6
∀ ∆ : denotes a link
3
2 4 2
4
3
6
1 2 6
1
4
3 2
3
2 3 5 7
The residual capacity for assigning some flow from node B to node O
5
2
O B
C
Maximum Flow Example
• Iteration 1: one of the several augmenting paths is O→B→E→T, which has a
residual capacity of min{7, 5, 6} = 5. By assigning the flow of 5 to this path,
the resulting network is shown above
(0,3)
A
D (0,9)
(0,5)
(0,1)
(0,4) T
(0,1)
(5,7)
B (5,6)
O
(5,5)
(0,4) (0,2)
(0,4) E
C
Maximum Flow Example
• Iteration 2: Assign a flow of 3 to the augmenting
path O→A→D→T. The resulting residual network
is (3,3)
A
D (3,9)
(3,5)
(0,1)
(0,4) T
(0,1)
(5,7)
B (5,6)
O
(5,5)
(0,4) (0,2)
(0,4) E
C
Maximum Flow Example
• Iteration 3: Assign a flow of 1 to the augmenting
path O→A→B→D→T. The resulting residual
network is (3,3)
A
D (4,9)
(4,5)
(1,1)
(1,4) T
(0,1)
(5,7)
B (5,6)
O
(5,5)
(0,4) (0,2)
(0,4) E
C
Maximum Flow Example
• Iteration 4: Assign a flow of 2 to the augmenting path O→B→D→T.
The resulting residual network is
(3,3)
A
D (6,9)
(4,5)
(1,1)
(3,4) T
(0,1)
(7,7)
B (5,6)
O
(5,5)
(0,4) (0,2)
(0,4) E
C
Maximum Flow Example
Iteration 5: Assign a flow of 1 to the augmenting
path O→C→E→D→T. The resulting residual
network is (3,3)
A
D (7,9)
(4,5)
(1,1)
(3,4) T
(1,1)
(7,7)
B (5,6)
O
(5,5)
(1,4) (0,2)
(1,4) E
C
Maximum Flow Example
Iteration 6: Assign a flow of 1 to the augmenting
path O→C→E→T. The resulting residual network
is (3,3)
A
D (7,9)
(4,5)
(1,1)
(3,4) T
(1,1)
(7,7)
B (6,6)
O
(5,5)
(2,4) (0,2)
(2,4) E
C
Maximum Flow Example
• There are no more flow augmenting paths, so the
current flow pattern is optimal
3
A 7
D
1
4
T
13 3 1
O B 13
6
7
2 5
E
C 2
Maximum Flow Example
• Recognizing optimality
• Max-flow min-cut theorem can be useful
• A cut is defined as any set of directed arcs
containing at least one arc from every directed
path from the source to the sink
• For any particular cut, the cut value is the sum of
the arc capacities of the arcs of the cut
• The theorem states that, for any network with a
single source and sink, the maximum feasible
flow from the source to the sink equals the
minimum cut value for all cuts of the network
8.6 Minimum Spanning Tree
Problems
Suppose that each arc (i,j) in a network has a
length associated with it and that arc (i,j)
represents a way of connecting node i to node j.
For example, if each node in a network represents
a computer in a computer network, arc(i,j) might
represent an underground cable that connects
computer i to computer j. In many applications, we
want to determine the set of arcs in a network that
connect all nodes such that the sum of the length
of the arcs is minimized. Clearly, such a group of
arcs contain no loop.
Minimum Spanning Tree Problem
• An undirected and connected network is being
considered, where the given information
includes some measure of the positive length
(distance, cost, time, etc.) associated with each
link
• Both the shortest path and minimum spanning
tree problems involve choosing a set of links that
have the shortest total length among all sets of
links that satisfy a certain property
– For the shortest-path problem this property is that the
chosen links must provide a path between the origin
and the destination
– For the minimum spanning tree problem, the required
property is that the chosen links must provide a path
between each pair of nodes
Some Applications
• Design of telecommunication networks (fiber-
optic networks, computer networks, leased-line
telephone networks, cable television networks,
etc.)
• Design of lightly used transportation network to
minimize the total cost of providing the links (rail
lines, roads, etc.)
• Design of a network of high-voltage electrical
transmission lines
• Design of a network of wiring on electrical
equipment (e.g., a digital computer system) to
minimize the total length of the wire
• Design of a network of pipelines to connect a
number of locations
For a network with n nodes, a spanning tree is a
group of n-1 arcs that connects all nodes of the
network and contains no loops.
12
1 2
(1,2)-(2,3)-(3,1) is a loop
4
7
1 1
2
2
2
6
5 4
2 3
4
4
5 3
• Iteration 3: Since node 3 is two blocks from node
5, we may include arc(5,3) in the minimum
spanning tree. Now C={1,2,5,3} and Ć={4}.
1 1
2
2
2
6
5 4
2 3
4
4
5 3
• Iteration 4: Node 5 is the closest node to node 4.
Thus, we add arc(5,4) to the minimum spanning
tree.
We now have a minimum spanning tree consisting
of arcs(1,2), (2,5), (5,3), and (5,4). The length of
the minimum spanning tree is 1+2+2+4=9 blocks.
1 1
2
2
2
6
5 4
2 3
4
4
5 3