Transportation
Transportation
Transportation
1
.
Applications of Network Optimization
Physical analog Physical analog
Applications Flow
of nodes of arcs
phone exchanges,
Cables, fiber optic Voice messages,
Communication computers,
links, microwave Data,
systems transmission
relay links Video transmissions
facilities, satellites
Pumping stations Water, Gas, Oil,
Hydraulic systems Pipelines
Reservoirs, Lakes Hydraulic fluids
Integrated Gates, registers,
Wires Electrical current
computer circuits processors
Rods, Beams,
Mechanical systems Joints Heat, Energy
Springs
Passengers,
Intersections, Highways,
Transportation freight,
Airports, Airline routes
systems vehicles,
Rail yards Railbeds
2 operators
.
Description
A transportation problem basically deals with
the problem, which aims to find the best way
to fulfill the demand of n demand points using
the capacities of m supply points. While trying
to find the best way, generally a variable cost
of shipping the product from one supply point
to a demand point or a similar constraint
should be taken into consideration.
3
.
7.1 Formulating
Transportation Problems
Example 1: Powerco has three electric
power plants that supply the electric
needs of four cities.
The associated supply of each plant
and demand of each city is given in the
table 1.
The cost of sending 1 million kwh of
electricity from a plant to a city
depends on the distance the electricity
4
must travel. .
Transportation tableau
A transportation problem is specified by
the supply, the demand, and the
shipping costs. So the relevant data
can be summarized in a transportation
tableau. The transportation tableau
implicitly expresses the supply and
demand constraints and the shipping
cost between each demand and supply
point.
5
.
Table 1. Shipping costs, Supply, and Demand for
Powerco Example
From To
City City 2 City 3 City Supply
1 4 (Million
kwh)
Plant 1 $8 $6 $10 $9 35
Plant 2 $9 $12 $13 $7 50
Plant 3 $14 $9 $16 $5 40
Demand 45 20 30 30
(Million
Transportation
kwh)
6 Tableau
.
Solution
1. Decision Variable:
Since we have to determine how much
electricity is sent from each plant to each
city;
Minimize Z = 8X11+6X12+10X13+9X14
+9X21+12X22+13X23+7X24
+14X31+9X32+16X33+5X34
8
.
3. Supply Constraints
Since each supply point has a limited production
capacity;
X11+X12+X13+X14 <= 35
X21+X22+X23+X24 <= 50
X31+X32+X33+X34 <= 40
9
.
4. Demand Constraints
Since each supply point has a limited production
capacity;
X11+X21+X31 >= 45
X12+X22+X32 >= 20
X13+X23+X33 >= 30
X14+X24+X34 >= 30
10
.
5. Sign Constraints
Since a negative amount of electricity can not be
shipped all Xij’s must be non negative;
11
.
LP Formulation of Powerco’s Problem
Min Z = 8X11+6X12+10X13+9X14+9X21+12X22+13X23+7X24
+14X31+9X32+16X33+5X34
∑X
i =1
ij ≥ dj ( j = 1,2,..., n)
14
.
Balanced Transportation Problem
If Total supply equals to total demand,
the problem is said to be a balanced
transportation problem:
i =m j =n
∑s = ∑d
i =1
i
j =1
j
15
.
Balancing a TP if total supply exceeds
total demand
16
.
Balancing a transportation problem if
total supply is less than total demand
7. Vogel’s Method
19
.
1. Northwest Corner Method
To find the bfs by the NWC method:
Begin in the upper left (northwest) corner of the
transportation tableau and set x11 as large
as possible (here the limitations for setting
x11 to a larger number, will be the demand
of demand point 1 and the supply of supply
point 1. Your x11 value can not be greater
than minimum of this 2 values).
20
.
According to the explanations in the previous slide we can set
x11=3 (meaning demand of demand point 1 is satisfied by
supply point 1).
3 5 2 3
3 2
X 5 2 3
21
.
After we check the east and south cells, we saw that we can go
east (meaning supply point 1 still has capacity to fulfill some
demand).
3 2 X
X 3 2 3
3 2 X
3 3
X X 2 3
22
.
After applying the same procedure, we saw that we can go south
this time (meaning demand point 2 needs more supply by supply
point 2).
3 2 X
3 2 1
X X X 3
3 2 X
3 2 1 X
23 X X X 2
.
Finally, we will have the following bfs, which is:
x11=3, x12=2, x22=3, x23=2, x24=1, x34=2
3 2 X
3 2 1 X
2 X
X X X X
24
.
2. Minimum Cost Method
The Northwest Corner Method dos not utilize
shipping costs. It can yield an initial bfs easily but
the total shipping cost may be very high. The
minimum cost method uses shipping costs in
order come up with a bfs that has a lower cost.
To begin the minimum cost method, first we find
the decision variable with the smallest shipping
cost (Xij). Then assign Xij its largest possible
value, which is the minimum of si and dj
25
.
After that, as in the Northwest Corner Method
we should cross out row i and column j and
reduce the supply or demand of the
noncrossed-out row or column by the value of
Xij. Then we will choose the cell with the
minimum cost of shipping from the cells that do
not lie in a crossed-out row or column and we
will repeat the procedure.
26
.
An example for Minimum Cost Method
Step 1: Select the cell with minimum cost.
2 3 5 6
5
2 1 3 5
10
3 8 4 6
15
12 8 4 6
27
.
Step 2: Cross-out column 2
2 3 5 6
5
2 1 3 5
2
8
3 8 4 6
15
12 X 4 6
28
.
Step 3: Find the new cell with minimum shipping cost and cross-out
row 2
2 3 5 6
5
2 1 3 5
X
2 8
3 8 4 6
15
10 X 4 6
29
.
Step 4: Find the new cell with minimum shipping cost and cross-out
row 1
2 3 5 6
X
5
2 1 3 5
X
2 8
3 8 4 6
15
5 X 4 6
30
.
Step 5: Find the new cell with minimum shipping cost and cross-out
column 1
2 3 5 6
X
5
2 1 3 5
X
2 8
3 8 4 6
10
5
X X 4 6
31
.
Step 6: Find the new cell with minimum shipping cost and cross-out
column 3
2 3 5 6
X
5
2 1 3 5
X
2 8
3 8 4 6
6
5 4
X X X 6
32
.
Step 7: Finally assign 6 to last cell. The bfs is found as: X11=5,
X21=2, X22=8, X31=5, X33=4 and X34=6
2 3 5 6
X
5
2 1 3 5
X
2 8
3 8 4 6
X
5 4 6
X X X X
33
.
3. Vogel’s Method
Begin with computing each row and column a
penalty. The penalty will be equal to the
difference between the two smallest shipping
costs in the row or column. Identify the row or
column with the largest penalty. Find the first
basic variable which has the smallest shipping
cost in that row or column. Then assign the
highest possible value to that variable, and cross-
out the row or column as in the previous
methods. Compute new penalties and use the
same procedure.
34
.
An example for Vogel’s Method
Step 1: Compute the penalties.
6 7 8
10 7-6=1
15 80 78
15 78-15=63
Demand 15 5 5
35
.
Step 2: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
5 8-6=2
5
15 80 78
15 78-15=63
Demand 15 X 5
36
.
Step 3: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
0 _
5 5
15 80 78
15 _
Demand 15 X X
37
.
Step 4: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
X _
0 5 5
15 80 78
15 _
Demand 15 X X
Column Penalty _ _ _
38
.
Step 5: Finally the bfs is found as X11=0, X12=5, X13=5, and X21=15
6 7 8
X _
0 5 5
15 80 78
X _
15
Demand X X X
Column Penalty _ _ _
39
.
7.3 The Transportation
Simplex Method
40
.
How to Pivot a Transportation Problem
Based on the transportation tableau, the
following steps should be performed.
Step 1. Determine (by a criterion to be
developed shortly, for example northwest corner
method) the variable that should enter the basis.
Step 2. Find the loop (it can be shown that there
is only one loop) involving the entering variable
and some of the basic variables.
Step 3. Counting the cells in the loop, label them
as even cells or odd cells.
41
.
Step 4. Find the odd cells whose variable
assumes the smallest value. Call this value θ.
The variable corresponding to this odd cell will
leave the basis. To perform the pivot, decrease
the value of each odd cell by θ and increase the
value of each even cell by θ. The variables that
are not in the loop remain unchanged. The pivot
is now complete. If θ=0, the entering variable will
equal 0, and an odd variable that has a current
value of 0 will leave the basis. In this case a
degenerate bfs existed before and will result after
the pivot. If more than one odd cell in the loop
equals θ, you may arbitrarily choose one of these
42
odd cells to leave the
. basis; again a degenerate
7.5. Assignment Problems
Example: Machineco has four jobs to be
completed. Each machine must be assigned to
complete one job. The time required to setup each
machine for completing each job is shown in the
table below. Machinco wants to minimize the total
setup time needed to complete the four jobs.
43
.
Setup times
(Also called the cost matrix)
Time (Hours)
Job1 Job2 Job3 Job4
Machine 1 14 5 8 7
Machine 2 2 12 6 5
Machine 3 7 8 3 9
Machine 4 2 4 6 10
44
.
The Model
According to the setup table Machinco’s problem
can be formulated as follows (for i,j=1,2,3,4):
min Z = 14 X 11 + 5 X 12 + 8 X 13 + 7 X 14 + 2 X 21 + 12 X 22 + 6 X 23 + 5 X 24
+ 7 X 31 + 8 X 32 + 3 X 33 + 9 X 34 + 2 X 41 + X 42 + 6 X 43 + 10 X 44
s.t. X 11 + X 12 + X 13 + X 14 = 1
X 21 + X 22 + X 23 + X 24 = 1
X 31 + X 32 + X 33 + X 34 = 1
X 41 + X 42 + X 43 + X 44 = 1
X 11 + X 21 + X 31 + X 41 = 1
X 12 + X 22 + X 32 + X 42 = 1
X 13 + X 23 + X 33 + X 43 = 1
X 14 + X 24 + X 34 + X 44 = 1
Xij = 0orXij = 1
45
.
For the model on the previous page note that:
Minimize c
i 1 j 1
ij xij
x
j 1
ij 1, i 1,K , n Each supply is 1
xij 1, j 1,K , n
i 1
Each demand is 1
xij 0 or 1, ij
47
.
Comments on the Assignment Problem
The Air Force has used this for assigning
thousands of people to jobs.
51
.
Transshipment Problem
52
.
The following steps describe how the optimal
solution to a transshipment problem can be found
by solving a transportation problem.
Step1. If necessary, add a dummy demand point
(with a supply of 0 and a demand equal to the
problem’s excess supply) to balance the problem.
Shipments to the dummy and from a point to itself
will be zero. Let s= total available supply.
Step2. Construct a transportation tableau as
follows: A row in the tableau will be needed for each
supply point and transshipment point, and a column
will be needed for each demand point and
53transshipment point.
.
Each supply point will have a supply equal to it’s
original supply, and each demand point will have a
demand to its original demand. Let s= total
available supply. Then each transshipment point will
have a supply equal to (point’s original supply)+s
and a demand equal to (point’s original demand)+s.
This ensures that any transshipment point that is a
net supplier will have a net outflow equal to point’s
original supply and a net demander will have a net
inflow equal to point’s original demand. Although we
don’t know how much will be shipped through each
transshipment point, we can be sure that the total
amount will not exceed s.
54
.
Transshipment Example
Example 5: Widgetco manufactures widgets at
two factories, one in Memphis and one in
Denver. The Memphis factory can produce as
150 widgets, and the Denver factory can
produce as many as 200 widgets per day.
Widgets are shipped by air to customers in LA
and Boston. The customers in each city require
130 widgets per day. Because of the
deregulation of airfares, Widgetco believes that it
may be cheaper first fly some widgets to NY or
Chicago and then fly them to their final
destinations. The cost of flying a widget are
shown next. Widgetco wants to minimize the
total cost of shipping the required widgets to
customers.
55
.
Transportation Tableau Associated with
the Transshipment Example
NY Chicago LA Boston Dummy Supply
Memphis $8 $13 $25 $28 $0 150
Denver $15 $12 $26 $25 $0 200
NY $0 $6 $16 $17 $0 350
Chicago $6 $0 $14 $16 $0 350
Demand 350 350 130 130 90
Supply points: Memphis, Denver
Demand Points: LA Boston
Transshipment Points: NY, Chicago
The problem can be solved using the transportation
simplex method
56
.
Limitations of Transportation Problem
One commodity ONLY: any one product
supplied and demanded at multiple locations
Merchandise
Electricity, water
Invalid for multiple commodities: (UNLESS
transporting any one of the multiple commodities
is completely independent of transporting any
other commodity and hence can be treated by
itself alone)
Example: transporting product 1 and product 2 from the
supply points to the demand points where the total
amount (of the two products) transported on a link is
subject to a capacity constraint
Example: where economy of scale can be achieved by
transporting the two products on the same link at a
57
larger total volume and at a lower unit cost of
transportation .
Limitations of Transportation Problem
Difficult to generalize the technique to
accommodate (these are generic difficulty for
“mathematical programming,” including linear and
non-linear programming
Economy of scale the per-unit cost of transportation
on a link decreasing with the volume (nonlinear and
concave; there is a trick to convert a “non-linear
program with a piecewise linear but convex
objective function to a linear program; no such tricks
exists for a piecewise linear but concave objective
function)
Fixed-cost: transportation usually involves fixed
charges. For example, the cost of truck rental (or
cost of trucking in general) consists of a fixed charge
that is independent of the mileage and a mileage
charge that is proportional to the total mileage
driven. Such fixed charges render the objective
function NON-LINEAR and CONCAVE and make
58 the problem much more difficult to solve
.
Chapter 8
Network Models
59
.
Networks are Everywhere
Physical Networks
Road Networks
Railway Networks
Airline traffic Networks
Electrical networks, e.g., the power grid
Abstract networks
organizationalcharts
precedence relationships in projects
Others?
60
.
Overview:
61
.
Description
Many important optimization problems can be
analyzed by means of graphical or network
representation. In this chapter the following network
models will be discussed:
64
.
Network Analysis and Their LP Connections
Several
Major Basic Classes of Network
Problems
How to recognize and formulate them? What are the
features they can be used to model? What are their
limitations?
All can be formulated as an LP
Several important “ad-hoc” algorithms and their
rationales will be provided
Most efficient transportation of goods,
information etc. through a network
Transportation problem (already discussed)
Transshipment problem
65
.
Network Analysis and Their LP Connections
67
.
8.1 Basic Definitions
A graph or network is defined by two sets of
symbols:
Nodes: A set of points or vertices(call it V) are
Nodes
called nodes of a graph or network.
1 2
68
.
Chain: A sequence of arcs such that every arc
has exactly one vertex in common with the
previous arc is called a chain.
Common vertex
between two arcs
1 2
69
.
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
70
.
Essence of Dijkstra’s Shortest- Path Algorithm
71
.
Essence of Dijkstra’s Shortest- Path
Algorithm
General thought process involved in each
iteration
LetS 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
72 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.”
73
.
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
74 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
75
.
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
76
.
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}
77
.
Dijkstra’s Algorithm for Shortest Path on a
Network with Positive Arc Lengths
A
Solved Nodes 2
O B
5
C
78
.
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.
(0) B
5
C
O
79 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
7
A
Current Solved (2) D
4
Nodes
3
B
O (4) E
80 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
A (2)
Current solved nodes D 5
(8)
B (4) T
(0)
O
7
82 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)
83 C
(4)
.
Shortest-Path Algorithm Applied to Seervada
Park Problem
n Solved Nodes Closest Total Nth Minimum Last
Directly Connected Distance Nearest Distance Connection
Connected to Unsolved Involved Node
Unsolved Nodes Node
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
84
.
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
5
Send one unit of flow from node 1 to node
85
6 .
LP Formulation of the Shortest Path
Problem
Use flow conservation constraints
(Outflow from any node – inflow to that node) =
0
For origin = 1
For destination = -1
For all other nodes = 0
Let xj denote the flow along link j, j = 1, 2, .., 7,
xj = 0 or 1
It turns out that this 0-1 constraints can be
replaced by 0 ≤ xj ≤ 1, which can in turn be
replaced by xj ≥ 0
86
.
LP Formulation of the Shortest Path Problem
88
.
Maximum Flow Problem
Typical applications
Maximize the flow through a company’s
distribution network from its factories to its
customers
Maximize the flow through a company’s supply
network from its vendors to its factories
Maximize the flow of oil through a system of
pipelines
Maximize the flow of water through a system of
aqueducts
Maximize the flow of vehicles through a
transportation network
89
.
Maximum Flow Algorithm
Some Terminology
The residual network shows the remaining arc
capacities for assigning additional flows after
some flows have been assigned to the arcs
The residual capacity for assigning some flow from node B to node O
5
2
O B
91
.
Maximum Flow Algorithm
The Augmenting Path Algorithm
Assume that the arc capacities are either integers or
rational numbers
1. identify an augmenting path by finding some
directed path from the source to the sink in the
residual network such that every arc on this path
has strictly positive residual capacity. If no such
path exists, the net flows already assigned
constitute an optimal flow pattern
2. Identify the residual capacity c* of this
augmenting path by finding the minimum of the
residual capacities of the arcs on this path.
92
Increase the flow in this path by c*
.
Maximum Flow Example
During the peak season the park management
of the Seervada park would like to determine
how to route the various tram trips from the park
entrance (Station O) to the scenic (Station T) to
maximize the number of trips per day. Each tram
will return by the same route it took on the
outgoing trip so the analysis focuses on outgoing
trips only. To avoid unduly disturbing the ecology
and wildlife of the region, strict upper limits have
been imposed on the number of outgoing trips
allowed per day in the outbound direction on
each individual road. For each road the direction
of travel for outgoing trips is indicated by an
arrow in the next slide. The number at the base
of the arrow gives the upper limit on the number
93
of outgoing trips allowed per day.
.
Maximum Flow Example
Consider the problem of sending as many units from
node O to node T for the following network (current flow,
capacity): (0,3)
A
D (0,9)
(0,5)
(0,1)
(0,4) T
(0,1)
(0,7)
B (0,6)
O
(0,5)
(0,4) (0,2)
(0,4) E
94
.
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
95
.
Maximum Flow Example
Iteration2: 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
96
.
Maximum Flow Example
Iteration3: 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
97
.
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
98
.
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
99
.
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
100
.
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
101
.
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
102 the sink equals the minimum cut value for
all cuts of the network
.
8.3 Maximum Flow Problems
Many situations can be modeled by a network in
which the arcs may be thought of as having a
capacity that limits the quantity of a product that
may be shipped through the arc. In these
situations, it is often desired to transport the
maximum amount of flow from a starting point
(called the source) to a terminal point (called the
sink). Such problems are called maximum flow
problems.
103
.
An example for maximum flow problem
Sunco Oil wants to ship the maximum possible
amount of oil (per hour) via pipeline from node so
to node si as shown in the figure below.
Arc Capacity
a0 (so,1) 2
(1)3 (so,2) 3
so 1 2 si (1,2) 3
(2)2 (1)3 (2)2
(1,3) 4
(1)4 3 (1)1
(3,si) 1
(2,si) 2
The various arcs represent pipelines of different diameters. The
maximum number of barrels of oil that can be pumped through
each arc is shown in the table above (also called arc capacity).
104
.
For reasons that will become clear soon, an
artificial arc called a0 is added from the sink to the
source. To formulate an LP about this problem first
we should determine the decision variable.
Max Z= X0
S.t. Xso,1<=2 (Arc Capacity constraints)
Xso,2<=3
X12<=3
X2,si<=2
X13<=4
X3,si<=1
X0=Xso,1+Xso,2 (Node so flow constraints)
Xso,1=X12+X13 (Node 1 flow constraints)
Xso,2+X12=X2,si (Node 2 flow constraints)
106
X13=X3,si (Node 3 flow constraints)
X3,si+X2,si=X0 .(Node si flow constraints)
One optimal solution to this LP is Z=3, Xso,1=2,
X13=1, X12=1, Xso,2=1, X3,si=1, X2,si=2, Xo=3.
107
.
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
108arcs 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
109
.
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
110
.
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
111
.
Minimum Spanning Tree Problem Description
1 1
2
2
2
6
5 4
2 3
4
4
5 3
116
.
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
117
.
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
118
.
8.4 CPM and PERT
Network models can be used as an aid in the scheduling of
large complex projects that consist of many activities.
119
.
CPM and PERT are used in many applications
including the following:
Scheduling construction projects such as office
buildings, highways and swimming pools
Developing countdown and “hold” procedure for
the launching of space crafts
Installing new computer systems
Designing and marketing new products
Completing corporate mergers
Building ships
120
.
Project Planning, Scheduling and
Control
122
.
To apply CPM and PERT, we need a list of
activities that make up the project. The project is
considered to be completed when all activities have
been completed. For each activity there is a set of
activities (called the predecessors of the activity)
that must be completed before the activity begins.
A project network is used to represent the
precedence relationships between activities. In the
following discussions the activities will be
represented by arcs and the nodes will be used to
represent completion of a set of activities (Activity
on arc (AOA) A type of network).
B
1 2 3
Activity A must be completed before activity B starts
123
.
While constructing an AOA type of project diagram
one should use the following rules:
Node 1 represents the start of the project. An arc should
lead from node 1 to represent each activity that has no
predecessors.
A node (called the finish node) representing the
completion of the project should be included in the network.
Number the nodes in the network so that the node
representing the completion time of an activity always has a
larger number than the node representing the beginning of
an activity.
An activity should not be represented by more than one
arc in the network
Two nodes can be connected by at most one arc.
124
To avoid violating rules 4 and 5, it can be sometimes
necessary to utilize a .dummy activity that takes zero time.
Formulating the CPM Problem
Input Data:
Precedence relationships and durations
Decision Variable:
ESi : Earliest starting times for each of the tasks
Objective:
Minimize the elapsed time of the project
where node n is the last node in the graph
125
.
Constraints
126
.
Critical Path Definitions
Earliest Start Time (ES) is the earliest time a
task can feasibly start
Earliest Finish Time (EF) is the earliest time a
task can feasibly end
Latest Start Time (LS) is the latest time a task
can feasibly start, without delaying the project
at all.
Latest Finish Time (LF) is the latest time a
task can feasibly end, without delaying the
project at all
127
.
Critical Path Method
Forward Pass
Go through the jobs in order
Start each job at the earliest time while satisfying the
precedence constraints
It finds the earliest start and finish times
EFi = ESi + ti
Earliest start time for an activity leaving a particular
node is equal to the largest of the earliest finish
times for all activities entering the node.
128
.
CPM: The Backward Pass
Fix the finishing time
Look at tasks in reverse order
Lay out tasks one at a time on the Gantt chart
starting at the finish and working backwards to
the start
Start the task at its latest starting time
LSi = LFi - ti
Latest finish time for an activity entering a particular
node is equal to the smallest of the latest start times for
all activities leaving the node.
129
.
CPM and Critical Path
130
.
CPM and Critical Path
131
.
An example for CPM
Widgetco is about to introduce a new product. A
list of activities and the precedence relationships
are given in the table below. Draw a project
diagram for this project.
Activity Predecesso Duration(days)
A:train workers rs
- 6
B:purchase raw - 9
materials
C:produce product 1 A, B 8
D:produce product 2 A, B 7
E:test product 2 D 10
F:assemble products C, E 12
1321&2
.
Project Diagram for Widgetco
C8 F 12
3 5 6
A6
D7
1 Dummy
E 10
B9 2 4
133
.
Project Diagram for Widgetco Forward Pass
(ES,EF)
(9,17) (26,38)
C8 F 12
(0,6) 3 5 6
A6
D7
1 Dummy
E 10
(16,26)
B9 (9,16)
2 4
(0,9)
Node 1 = starting node
Node 6 = finish node
134
.
Project Diagram for Widgetco Backward Pass (LS,LF)
(18,26) (26,38)
C8 F 12
(3,9) 3 5 6
A6
D7
1 Dummy
E 10
(16,26)
B9 (9,16)
2 4
(0,9)
Node 1 = starting node
Node 6 = finish node
135
.
For Widgetco example ES(i)’s and LS(i)’s are as
follows:
Activity B: 0
Activity A: 3
Activity D: 0
Activity C: 9
Activity E: 0
Activity F: 0
137
.
Critical path
An activity with a slack of zero is a critical
activity
A path from node 1 to the finish node that
consists entirely of critical activities is called a
critical path.
Z=XF-X1
139
.
Min Z =X6-X1
S.T. X3>=X1+6 (Arc (1,3) constraint)
X2>=X1+9 (Arc (1,2) constraint)
X5>=X3+8 (Arc (3,5) constraint)
X4>=X3+7 (Arc (3,4) constraint)
X5>=X4+10 (Arc (4,5) constraint)
X6>=X5+12 (Arc (5,6) constraint)
X3>=X2 (Arc (2,3) constraint)
142
.
PERT
CPM assumes that the duration of each activity is
known with certainty. For many projects, this is
clearly not applicable. PERT is an attempt to
correct this shortcoming of CPM by modeling the
duration of each activity as a random variable. For
each activity, PERT requires that the project
manager estimate the following three quantities:
a : estimate of the activity’s duration under the
most favorable conditions
b : estimate of the activity’s duration under the
least favorable conditions
m : most likely value for the activity’s duration
143
.
Let Tij be the duration of activity (i,j). PERT
requires the assumption that Tij follows a beta
distribution. According to this assumption, it can
be shown that the mean and variance of Tij may
be approximated by
a + 4m + b
E (Tij ) =
6
(b − a ) 2
var Tij =
36
144
.
PERT requires the assumption that the durations
of all activities are independent. Thus,
∑ E (T )
( i , j )∈path
ij : expected duration of activities on any path
∑ var Tij
( i , j )∈path
: variance of duration of activities on any path
145
.
Let CP be the random variable denoting the total
duration of the activities on a critical path found by
CPM. PERT assumes that the critical path found
by CPM contains enough activities to allow us to
invoke the Central Limit Theorem and conclude
that the following is normally distributed:
CP = ∑T ij
( i , j )∈criticalpath
146
.
a, b and m for activities in Widgetco
Activity a b m
(1,2) 5 13 9
(1,3) 2 10 6
(3,5) 3 13 8
(3,4) 1 13 7
(4,5) 8 12 10
(5,6) 9 15 12
147
.
According to the table on the previous slide:
5 + 13 + 36 (13 − 5) 2
E (T 12) = = 9, var T 12 = = 1.78
6 36
2 + 10 + 24 (10 − 2) 2
E (T 13) = = 6, var T 13 = = 1.78
6 36
3 + 13 + 32 (13 − 3) 2
E (T 35) = = 8, var T 35 = = 2.78
6 36
1 + 13 + 28 (13 − 1) 2
E (T 34) = = 7, var T 34 = =4
6 36
8 + 12 + 40 (12 − 8) 2
E (T 45) = = 10, var T 45 = = 0.44
6 36
9 + 15 + 48 (15 − 9) 2
E (T 56) = = 12, var T 56 = =1
148 6 36
.
Of course, the fact that arc (2,3) is a dummy arc
yields
E(T23)=varT23=0
150
.
More on Project Management
CPM
Advantage of ease of use
Lays out the Gantt chart (nicely visual)
Other issues
Tasks take resources, which are limited
Task times are really random variables
etc
153
.
Project Management Software
Project management
Simple model: we use estimates of the
time for each task, and we use the
precedence constraints
155
.