Set2_transport & Networks
-
Upload
deepak-bujahi -
Category
Documents
-
view
213 -
download
0
Transcript of Set2_transport & Networks
-
7/28/2019 Set2_transport & Networks
1/155
.1
Chapter 7Transportation, Assignment and
Transshipment Problems
-
7/28/2019 Set2_transport & Networks
2/155
.2
Applications Physical analogof nodes Physical analogof arcs Flow
Communication
systems
phone exchanges,
computers,
transmission
facilities, satellites
Cables, fiber optic
links, microwave
relay links
Voice messages,
Data,
Video transmissions
Hydraulic systemsPumping stations
Reservoirs, LakesPipelines
Water, Gas, Oil,
Hydraulic fluids
Integrated
computer circuits
Gates, registers,
processorsWires Electrical current
Mechanical systems
JointsRods, Beams,
SpringsHeat, Energy
Transportation
systems
Intersections,
Airports,
Rail yards
Highways,
Airline routes
Railbeds
Passengers,
freight,
vehicles,
operators
Applications of Network
Optimization
-
7/28/2019 Set2_transport & Networks
3/155
.3
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 findthe 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.
-
7/28/2019 Set2_transport & Networks
4/155
.4
7.1 Formulating Transportation
ProblemsExample 1: Powerco has three electric
power plants that supply the electric needs
of four cities.
The associated supply of each plant anddemand of each city is given in the table 1.
The cost of sending 1 million kwh ofelectricity from a plant to a city depends on
the distance the electricity must travel.
-
7/28/2019 Set2_transport & Networks
5/155
.5
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.
-
7/28/2019 Set2_transport & Networks
6/155
.6
Table 1. Shipping costs, Supply, and Demand
for Powerco Example
From To
City 1 City 2 City 3 City 4 Supply
(Million kwh)
Plant 1 $8 $6 $10 $9 35
Plant 2 $9 $12 $13 $7 50
Plant 3 $14 $9 $16 $5 40Demand
(Million kwh)45 20 30 30
Transportation Tableau
-
7/28/2019 Set2_transport & Networks
7/155.7
Solution
1. Decision Variable:
Since we have to determine how much electricity
is sent from each plant to each city;
Xij = Amount of electricity produced at plant i
and sent to city j
X14 = Amount of electricity produced at plant 1
and sent to city 4
-
7/28/2019 Set2_transport & Networks
8/155.
8
2. Objective function
Since we want to minimize the total cost of shipping
from plants to cities;
Minimize Z = 8X11+6X12+10X13+9X14
+9X21+12X22+13X23+7X24
+14X31+9X32+16X33+5X34
-
7/28/2019 Set2_transport & Networks
9/155.
9
3. Supply Constraints
Since each supply point has a limited productioncapacity;
X11+X12+X13+X14
-
7/28/2019 Set2_transport & Networks
10/155.
10
4. Demand Constraints
Since each supply point has a limited productioncapacity;
X11+X21+X31 >= 45X12+X22+X32 >= 20
X13+X23+X33 >= 30
X14+X24+X34 >= 30
-
7/28/2019 Set2_transport & Networks
11/155.
11
5. Sign Constraints
Since a negative amount of electricity can not be
shipped all Xijs must be non negative;
Xij >= 0 (i= 1,2,3; j= 1,2,3,4)
-
7/28/2019 Set2_transport & Networks
12/155.
12
LP Formulation of Powercos Problem
Min Z = 8X11+6X12+10X13+9X14+9X21+12X22+13X23+7X24
+14X31+9X32+16X33+5X34
S.T.: X11+X12+X13+X14 = 30
X14+X24+X34 >= 30
Xij >= 0 (i= 1,2,3; j= 1,2,3,4)
-
7/28/2019 Set2_transport & Networks
13/155
.13
General Description of a Transportation
Problem
1. A set of m supply points from which a good is
shipped. Supply point i can supply at mostsi
units.
2. A set of n demand points to which the good is
shipped. Demand pointj must receive at least di
units of the shipped good.
3. Each unit produced at supply point i and shippedto demand pointj incurs a variable costofcij.
-
7/28/2019 Set2_transport & Networks
14/155
.14
Xij = number of units shipped fromsupply point i to
demand point j
),...,2,1;,...,2,1(0
),...,2,1(
),...,2,1(..
min
1
1
1 1
njmiX
njdX
misXts
Xc
ij
mi
i
jij
nj
j
iij
mi
i
nj
j
ijij
-
7/28/2019 Set2_transport & Networks
15/155
.15
Balanced Transportation Problem
If Total supply equals to total demand, theproblem is said to be a balanced
transportation problem:
nj
j
j
mi
i
i ds11
-
7/28/2019 Set2_transport & Networks
16/155
.16
Balancing a TP if total supply exceeds total
demand
If total supply exceeds total demand, we
can balance the problem by adding dummy
demand point. Since shipments to thedummy demand point are not real, they are
assigned a cost of zero.
-
7/28/2019 Set2_transport & Networks
17/155
.17
Balancing a transportation problem if total
supply is less than total demand
If a transportation problem has a total
supply that is strictly less than total
demand the problem has no feasiblesolution. There is no doubt that in such a
case one or more of the demand will be left
unmet. Generally in such situations a
penalty cost is often associated with unmetdemand and as one can guess this time the
total penalty cost is desired to be minimum
-
7/28/2019 Set2_transport & Networks
18/155
.18
7.2 Finding Basic Feasible
Solution for TPUnlike other Linear Programming
problems, a balancedTP with m supply
points and n demand points is easier to
solve, although it has m + n equality
constraints. The reason for that is, if a set
of decision variables (xijs) satisfy all but
one constraint, the values for xijs willsatisfy that remaining constraintautomatically.
-
7/28/2019 Set2_transport & Networks
19/155
.19
Methods to find the bfs for a balanced TP
There are three basic methods:
1. Northwest Corner Method
2. Minimum Cost Method
3. Vogels Method
-
7/28/2019 Set2_transport & Networks
20/155
.20
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 demandpoint 1 and the supply of supply point 1. Your
x11 value can not be greater than minimum of
this 2 values).
-
7/28/2019 Set2_transport & Networks
21/155
.21
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).5
6
2
3 5 2 3
3 2
6
2
X 5 2 3
-
7/28/2019 Set2_transport & Networks
22/155
.22
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
6
2
X 3 2 3
3 2 X
3 3
2
X X 2 3
-
7/28/2019 Set2_transport & Networks
23/155
.23
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
2
X X X 3
3 2 X
3 2 1 X
2
X X X 2
-
7/28/2019 Set2_transport & Networks
24/155
.24
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
-
7/28/2019 Set2_transport & Networks
25/155
.25
2. Minimum Cost Method
The Northwest Corner Method dos not utilize shippingcosts. 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 costmethod, first we find the decision variable with the
smallest shipping cost (Xij). Then assignXijits largest
possible value, which is the minimum ofsi and dj
-
7/28/2019 Set2_transport & Networks
26/155
.26
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 orcolumn 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.
-
7/28/2019 Set2_transport & Networks
27/155
.27
An example for Minimum Cost Method
Step 1: Select the cell with minimum cost.
2 3 5 6
2 1 3 5
3 8 4 6
5
10
15
12 8 4 6
-
7/28/2019 Set2_transport & Networks
28/155
.28
Step 2: Cross-out column 2
2 3 5 6
2 1 3 5
8
3 8 4 6
12 X 4 6
5
2
15
-
7/28/2019 Set2_transport & Networks
29/155
.29
Step 3: Find the new cell with minimum shipping
cost and cross-out row 2
2 3 5 6
2 1 3 5
2 8
3 8 4 6
5
X
15
10 X 4 6
-
7/28/2019 Set2_transport & Networks
30/155
.30
Step 4: Find the new cell with minimum shipping
cost and cross-out row 1
2 3 5 6
5
2 1 3 5
2 8
3 8 4 6
X
X
15
5 X 4 6
-
7/28/2019 Set2_transport & Networks
31/155
.31
Step 5: Find the new cell with minimum shipping
cost and cross-out column 1
2 3 5 6
5
2 1 3 5
2 8
3 8 4 6
5
X
X
10
X X 4 6
-
7/28/2019 Set2_transport & Networks
32/155
.32
Step 6: Find the new cell with minimum shipping
cost and cross-out column 3
2 3 5 6
5
2 1 3 5
2 8
3 8 4 6
5 4
X
X
6
X X X 6
-
7/28/2019 Set2_transport & Networks
33/155
.33
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
5
2 1 3 5
2 8
3 8 4 6
5 4 6
X
X
X
X X X X
-
7/28/2019 Set2_transport & Networks
34/155
.34
3. Vogels 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 smallestshipping 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.
-
7/28/2019 Set2_transport & Networks
35/155
.35
An example for Vogels MethodStep 1: Compute the penalties.
Supply Row Penalty
6 7 8
15 80 78
Demand
Column Penalty 15-6=9 80-7=73 78-8=70
7-6=1
78-15=63
15 5 5
10
15
-
7/28/2019 Set2_transport & Networks
36/155
.36
Step 2: Identify the largest penalty and assign the
highest possible value to the variable.
Supply Row Penalty
6 7 8
5
15 80 78
Demand
Column Penalty 15-6=9 _ 78-8=70
8-6=2
78-15=63
15 X 5
5
15
-
7/28/2019 Set2_transport & Networks
37/155
.37
Step 3: Identify the largest penalty and assign the
highest possible value to the variable.
Supply Row Penalty
6 7 8
5 5
15 80 78
Demand
Column Penalty 15-6=9 _ _
_
_
15 X X
0
15
-
7/28/2019 Set2_transport & Networks
38/155
.38
Step 4: Identify the largest penalty and assign the
highest possible value to the variable.
Supply Row Penalty
6 7 8
0 5 5
15 80 78
Demand
Column Penalty _ _ _
_
_
15 X X
X
15
-
7/28/2019 Set2_transport & Networks
39/155
.39
Step 5: Finally the bfs is found as X11=0, X12=5,
X13=5, and X21=15
Supply Row Penalty
6 7 8
0 5 5
15 80 78
15
Demand
Column Penalty _ _ _
_
_
X X X
X
X
-
7/28/2019 Set2_transport & Networks
40/155
.40
7.3 The Transportation Simplex
Method
In this section we will explain how the simplex
algorithm is used to solve a transportation problem.
-
7/28/2019 Set2_transport & Networks
41/155
.41
How to Pivot a Transportation Problem
Based on the transportation tableau, the followingsteps should be performed.
Step 1. Determine (by a criterion to be developedshortly, for example northwest corner method) the
variable that should enter the basis.
Step 2. Find the loop (it can be shown that there isonly one loop) involving the entering variable and
some of the basic variables.Step 3. Counting the cells in the loop, label them aseven cells or odd cells.
-
7/28/2019 Set2_transport & Networks
42/155
.42
Step 4. Find the odd cells whose variable assumes thesmallest value. Call this value . The variablecorresponding 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 enteringvariable 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 thepivot. If more than one odd cell in the loop equals ,you may arbitrarily choose one of these odd cells to
leave the basis; again a degenerate bfs will result
-
7/28/2019 Set2_transport & Networks
43/155
.43
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 tominimize the total setup time needed to complete the
four jobs.
-
7/28/2019 Set2_transport & Networks
44/155
.
44
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
-
7/28/2019 Set2_transport & Networks
45/155
.
45
The Model
According to the setup table Machincos problem can beformulated as follows (fori,j=1,2,3,4):
10
1
1
1
1
1
1
11..
10629387
5612278514min
44342414
43332313
42322212
41312111
44434241
34333231
24232221
14131211
4443424134333231
2423222114131211
ijij orXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXXXXXts
XXXXXXXX
XXXXXXXXZ
-
7/28/2019 Set2_transport & Networks
46/155
.
46
For the model on the previous page note that:
Xij=1 if machine i is assigned to meet the demands of
jobj
Xij=0 if machine i is not assigned to meet the demands
of jobj
In general an assignment problem is balancedtransportation problem in which all supplies and
demands are equal to 1.
-
7/28/2019 Set2_transport & Networks
47/155
.
47
The Assignment Problem
In general the LP formulation is given as
Minimize 1 1
1
1
1 1
1 1
0
, , ,
, , ,
or 1,
n n
ij ij
i j
n
ijj
n
iji
ij
c x
x i n
x j n
x ij
Each supply is 1
Each demand is 1
Comments on the Assignment
-
7/28/2019 Set2_transport & Networks
48/155
.
48
Comments on the Assignment
Problem The Air Force has used this for assigning
thousands of people to jobs.
This is a classical problem. Research on the
assignment problem predates research on LPs.
Very efficient special purpose solution techniquesexist.
10 years ago, Yusin Lee and J. Orlin solved a problemwith 2 million nodes and 40 million arcs in hour.
Al h h h i i l b
-
7/28/2019 Set2_transport & Networks
49/155
.
49
Although the transportation simplex appears to be very
efficient, there is a certain class of transportation
problems, called assignment problems, for which the
transportation simplex is often very inefficient. For thatreason there is an other method called The Hungarian
Method. The steps of The Hungarian Method are as
listed below:
Step1. Find a bfs. Find the minimum element in each rowof the mxm cost matrix. Construct a new matrix by
subtracting from each cost the minimum cost in its row.
For this new matrix, find the minimum cost in eachcolumn. Construct a new matrix (reduced cost matrix) by
subtracting from each cost the minimum cost in its
column.
-
7/28/2019 Set2_transport & Networks
50/155
.
50
Step2. Draw the minimum number of lines (horizontaland/or vertical) that are needed to cover all zeros in the
reduced cost matrix. If m lines are required , an optimalsolution is available among the covered zeros in the
matrix. If fewer than m lines are required, proceed to step
3.
Step3. Find the smallest nonzero element (call its valuek) in the reduced cost matrix that is uncovered by the
lines drawn in step 2. Now subtract k from eachuncovered element of the reduced cost matrix and add k
to each element that is covered by two lines. Return to
step2.
-
7/28/2019 Set2_transport & Networks
51/155
.
51
7.6 Transshipment Problems
A transportation problem allows only shipments that godirectly from supply points to demand points. In many
situations, shipments are allowed between supply points
or between demand points. Sometimes there may also
be points (called transshipment points) through whichgoods can be transshipped on their journey from a
supply point to a demand point. Fortunately, the optimal
solution to a transshipment problem can be found by
solving a transportation problem.
Transshipment Problem
-
7/28/2019 Set2_transport & Networks
52/155
.
52
Transshipment Problem
An extension of a transportation problem
More general than the transportation problem in that in thisproblem there are intermediate transshipment points. Inaddition, shipments may be allowed between supply points
and/or between demand points
LP Formulation Supply point: it can send goods to another point but cannot
receive goods from any other point
Demand point It can receive goods from other points but
cannot send goods to any other point Transshipment point: It can both receive goods from other
points send goods to other points
-
7/28/2019 Set2_transport & Networks
53/155
.
53
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 problems excess
supply) to balance the problem. Shipments to the dummyand 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 transshipment point.
-
7/28/2019 Set2_transport & Networks
54/155
.
54
Each supply point will have a supply equal to itsoriginal 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 (points original supply)+s and a demand equal
to (points original demand)+s. This ensures that anytransshipment point that is a net supplier will have a netoutflow equal to points original supply and a netdemander will have a net inflow equal to points original
demand. Although we dont know how much will beshipped through each transshipment point, we can be
sure that the total amount will not exceed s.
Transshipment Example
-
7/28/2019 Set2_transport & Networks
55/155
.
55
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 theDenver factory can produce as many as 200 widgetsper day. Widgets are shipped by air to customers inLA and Boston. The customers in each city require130 widgets per day. Because of the deregulation of
airfares, Widgetco believes that it may be cheaperfirst fly some widgets to NY or Chicago and then flythem to their final destinations. The cost of flying awidget are shown next. Widgetco wants to minimizethe total cost of shipping the required widgets tocustomers.
Transportation Tableau Associated
-
7/28/2019 Set2_transport & Networks
56/155
.
56
Transportation Tableau Associatedwith 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 simplexmethod
Limitations of Transportation Problem
-
7/28/2019 Set2_transport & Networks
57/155
.
57
Limitations of Transportation Problem
One commodity ONLY: any one product supplied
and demanded at multiple locations Merchandise Electricity, water
Invalid for multiple commodities: (UNLESStransporting any one of the multiple commodities iscompletely independent of transporting any othercommodity 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 acapacity constraint
Example: where economy of scale can be achieved bytransporting the two products on the same link at a largertotal volume and at a lower unit cost of transportation
Limitations of Transportation Problem
-
7/28/2019 Set2_transport & Networks
58/155
.
58
Limitations of Transportation Problem
Difficult to generalize the technique to accommodate(these are generic difficulty for mathematical
programming, including linear and non-linearprogramming
Economy of scale the per-unit cost of transportation on a linkdecreasing with the volume (nonlinear and concave; there is a trick
to convert a non-linear program with a piecewise linear butconvex 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. Forexample, 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 the problem much more difficult to
solve
-
7/28/2019 Set2_transport & Networks
59/155
.
59
Chapter 8
Network Models
-
7/28/2019 Set2_transport & Networks
60/155
.
60
Networks are Everywhere
Physical NetworksRoad NetworksRailway Networks
Airline traffic NetworksElectrical networks, e.g., the power grid
Abstract networksorganizational charts
precedence relationships in projects
Others?
-
7/28/2019 Set2_transport & Networks
61/155
.
61
Overview:
Networks and graphs are powerfulmodeling tools.
Most OR models have networks or graphs
as a major aspect Each representation has its advantages
Major purpose of a representation
efficiency in algorithms ease of use
-
7/28/2019 Set2_transport & Networks
62/155
.
62
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:
1. Shortest path problems2. Maximum flow problems
3. CPM-PERT project scheduling models
4. Minimum Cost Network Flow Problems5. Minimum spanning tree problems
/
-
7/28/2019 Set2_transport & Networks
63/155
.
63
WHAT IS CPM/PERT FOR?
CPM/PERT are fundamental tools of project
management and are used for one of a kind, oftenlarge and expensive, decisions such as building
docks, airports and starting a new factory. Such
decisions can be described via mathematicalmodels, but this is not essential. Some would
argue that CPM/PERT is not a pure OR topic.
CPM/PERT really falls into gray area that can beclaimed by fields other than OR also.
-
7/28/2019 Set2_transport & Networks
64/155
.
64
General Comments on CPM/PERT vs. ALB
Assembly Line Balancing (ALB) are naturally not
discussed in this text, but it is important to be aware of thehuge difference between the ALB and CPM/PERT
concepts because the precedence diagrams look so similar.
Activity on node (AON) method of network precedence
diagram drawing and the ALB diagram are identical
looking at first. The ALB deals with small repetitive
items such as TVs while CPM/PERT deals with large one
of a kind projects.
Network Analysis and Their LP
-
7/28/2019 Set2_transport & Networks
65/155
.
65
y
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 rationaleswill be provided
Most efficient transportation of goods, information
etc. through a network Transportation problem (already discussed)
Transshipment problem
Network Analysis and Their LP
-
7/28/2019 Set2_transport & Networks
66/155
.
66
yConnections
Most efficient way to go from one point to another in adistance network or networks representing non-distance
phenomenon, e.g., the cost network representingproduction, inventory, and other costs
Shortest path problem:
Find the shortest path between two points in a network Dijkstra algorithm Limitations: Breakdown of the Dijkstras algorithm when side
constraints are added LP formulation
LP formulation to accommodate some side constraints, e.g.,disallowing use of two particular links in the shortest path
An example application to non-distance contexts:Minimum production and inventory cost in the context ofdynamic programming.
Network Analysis and Their LP
-
7/28/2019 Set2_transport & Networks
67/155
.
67
yConnections
Maximum amount of flow from one point toanother in a capacitated network
Maximum flow problem
The flow-augmenting algorithm
Limitations: breakdown of the flow-augmentingalgorithm when side-constraints are added
LP formulation
LP formulation to accommodate some side-
constraints, e.g., no link carrying more than 30% of thewhole flow so as to avoid drastic reduction of flow afterfailure of any one flow-carrying link
-
7/28/2019 Set2_transport & Networks
68/155
.
68
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 callednodes of a graph or network.
Arcs: An arc consists of an ordered pair of vertices andrepresents a possible direction of motion that may occur
between vertices.
1 2
Nodes
1 2
Arc
Chain: A sequence of arcs such that every arc has
-
7/28/2019 Set2_transport & Networks
69/155
.
69
Chain: A sequence of arcs such that every arc hasexactly one vertex in common with the previous arc is
called a chain.
1 2
Common vertex
between two arcs
-
7/28/2019 Set2_transport & Networks
70/155
.
70
Path: A path is a chain in which the terminal node ofeach 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.
2 3
1 4
Essence of Dijkstras Shortest- Path
-
7/28/2019 Set2_transport & Networks
71/155
.
71
jAlgorithm
Key Points regarding the nature of thealgorithm
In each iteration, the shortest path from the originto 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 foundin one iteration when there is a tie. There may alsoexist multiple shortest paths from the origin tosome nodes.)
The algorithm stops when the shortest path to thedestination is found
Essence of Dijkstras Shortest- Path
-
7/28/2019 Set2_transport & Networks
72/155
.
72
jAlgorithm
General thought process involved in eachiteration
Let S be the current set of solved nodes (the setof nodes whose shortest paths from the origin been
found), N be the set of all nodes, and NS be theset of unsolved nodes
1. The next solved node should be reachable directlyfrom one of the solved nodes via one direct link or arc
(these nodes can be called neighboring nodes of thecurrent 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 Dijkstras Shortest- Path
-
7/28/2019 Set2_transport & Networks
73/155
.
73
jAlgorithm
2. For each of these neighboring nodes, find theshortest path from the origin via only currentsolved nodes and the corresponding distance from
the origin
3. In general, there exist multiple such neighboringnodes.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
-
7/28/2019 Set2_transport & Networks
74/155
.
74
g
Objective of the nth iteration: Find the nth nearest node to theorigin (to be repeated for n = 1, 2, until the nth nearest node is
the destination) Input for the nth Iteration: (n1) nearest nodes to the origin(solved for at the previous iterations), including their shortestpath and distance from the origin. (These nodes plus the originwill be called solved nodes; the others are unsolved nodes)
Candidates for the nth nearest node: Each solved node that isdirectly connected by a link to one or more unsolved nodesprovides one candidate the unsolved node with the shortestconnecting link (ties provide additional candidates)
Calculation of nth nearest node: For each solved node and itscandidate, add the distance between them and the distance of the
shortest path from the origin to this solved node. The candidatewith the smallest such total distance is the nth nearest node (tiesprovide additional solved nodes), and its shortest path is the onegenerating this distance.
The Road System for Seervada Park
-
7/28/2019 Set2_transport & Networks
75/155
.
75
y 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 inmiles
The park management wishes to determine whichroute 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/28/2019 Set2_transport & Networks
76/155
.
76
y
O
A
B
C
D
E
T
2
1
2
3
4
7
41
7
5
5
4
Dijkstras Algorithm for Shortest Path on a
-
7/28/2019 Set2_transport & Networks
77/155
.
77
j gNetwork with Positive Arc Lengths
Oth iteration: Shortest distance from node O toNode O. S = {O}. Ist iteration:
Step 1: Neighboring Nodes = {A, B, C}
Step 2: Shortest path from O to neighboring nodesthat traverse through the current set of solvednodes S. Min {2, 5, 4} = 2 (corresponding to nodeA).
Step 3: The shortest path from O to A has beenfound with a distance of 2. S = {O, A}
Dijkstras Algorithm for Shortest Path on aN k i h P i i A L h
-
7/28/2019 Set2_transport & Networks
78/155
.
78
j gNetwork with Positive Arc Lengths
O
A
B
C
Solved Nodes2
5
4
Dijkstras Algorithm for Shortest Path on ak i h i i h
-
7/28/2019 Set2_transport & Networks
79/155
.
79
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}
O
A D
C
B
7
2
5
4
Current Solved Nodes
(2)
(0)
Dijkstras Algorithm for Shortest Path on ak i h i i A h
-
7/28/2019 Set2_transport & Networks
80/155
.
80
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}
O
A
B
C
D
E
7
4
3
4
Current Solved
Nodes (2)
(4)
(4)
Dijkstras Algorithm for Shortest Path on aN k i h P i i A L h
-
7/28/2019 Set2_transport & Networks
81/155
.
81
Network with Positive Arc Lengths Iteration 4
Step 1: Include (only) Nodes D and T. Includeonly 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 hasbeen found. S = {O, A, B, C, D, E}
O
A
B
C
E
D
T
(2)
(4)
(4) (7)
7
4
1
7Current solved nodes
Dijkstras Algorithm for Shortest Path on aN t k ith P iti A L th
-
7/28/2019 Set2_transport & Networks
82/155
.
82
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, thedestination, has been found, with a distance of 13
O
A
B
C
D
E
T(0)
(2)
(4)
(4)
(8)
(7)
5
7
Current solved nodes
Dijkstras Algorithm for Shortest Path on a
-
7/28/2019 Set2_transport & Networks
83/155
.
83
Network with Positive Arc Lengths Final Solution
Incidentally, we have also found the nthnearest node from the origin sequentially
O
A
B
C
D
E
T
2
4(0)
2
4
3 1
5
(2)
(4)
(4)
(7)
(8)
(13)
Shortest-Path Algorithm Applied toSeervada Park Problem
-
7/28/2019 Set2_transport & Networks
84/155
.
84
Seervada Park Problemn Solved Nodes
Directly Connected
to Unsolved Nodes
Closest
Connected
UnsolvedNode
Total
Distance
Involved
Nth
Nearest
Node
Minimum
Distance
Last
Connection
1 O A 2 A 2 OA
2, 3 O
A
C
B
4
2+2=4
C
B
4
4
OC
AB
4 A
B
C
D
E
E
2+7=9
4+3=7
4+4=8
E 7 BE
5 A
B
E
D
D
D
2+7=9
4+4=8
7+1=8
D
D
8
8
BD
ED
6 D
E
T
T
8+5=13
7+7=14
T 13 DT
LP Formu at on o t e ortest PatP bl
-
7/28/2019 Set2_transport & Networks
85/155
.
85
Problem Consider the following shortest path problem
from node 1 to node 6 : denotes a link
Send one unit of flow from node 1 to node 6
1
2
3
4
5
6
4
3
2
3
3
2
1
2
5
4
3
6
7
2
LP Formulation of the Shortest PathP bl
-
7/28/2019 Set2_transport & Networks
86/155
.
86
Problem Use flow conservation constraints
(Outflow from any nodeinflow to that node) = 0For origin = 1For destination = -1
For all other nodes = 0Let 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 replacedby 0 xj 1, which can in turn be replaced by xj 0
LP Formulation of the Shortest PathP bl
-
7/28/2019 Set2_transport & Networks
87/155
.
87
Problem
Min 4x1 + 3x2 + 3x3 + 2x4 + 3x5 + 2x6 + 2x7
S.t. x1 + x2 = 1
-x1 + x3 + x4 = 0
- x2 + x5 = 0 - x3 + x6 = 0
- x4x5 + x7 = 0
- x6x7 = -1 Xj 0, j = 1, 2, , 7 (xj integers)
Maximum Flow Problem
-
7/28/2019 Set2_transport & Networks
88/155
.
88
Maximum flow problem description All flow through a directed and connected network
originates at one node (source) and terminates at one
another node (sink)
All the remaining nodes are transshipment nodes
Flow through an arc is allowed only in the directionindicated by the arrowhead, where the maximum amount of
flow is given by the capacity of that arc. At the source, all
arcs point away from the node. At the sink, all arcs point
into the node
The objective is to maximize the total amount of flow fromthe source to the sink (measured as the amount leaving the
source or the amount entering the sink)
Maximum Flow Problem
-
7/28/2019 Set2_transport & Networks
89/155
.
89
Typical applications
Maximize the flow through a companysdistribution network from its factories to itscustomers
Maximize the flow through a companys supply
network from its vendors to its factoriesMaximize the flow of oil through a system ofpipelines
Maximize the flow of water through a system of
aqueductsMaximize the flow of vehicles through a
transportation network
Maximum Flow Algorithm
-
7/28/2019 Set2_transport & Networks
90/155
.
90
Some Terminology
The residual networkshows the remaining arccapacities for assigning additional flows after some
flows have been assigned to the arcs
O B
25
The residual capacity for flow from node O to Node B
The residual capacity for assigning some flow from node B to node O
Maximum Flow Algorithm
-
7/28/2019 Set2_transport & Networks
91/155
.
91
An augmenting path is a directed path from the source tothe sink in the residual network such that every arc on this
path has strictly positive residual capacity
The residual capacity of the augmenting path is theminimum of these residual capacities (the amount of flow
that can feasibly be added to the entire path)
Basic idea Repeatedly select some augmenting path and add a flow
equal to its residual capacity to that path in the original
network. This process continues until there are no more
augmenting paths, so that the flow from the source to thesink cannot be increased further
Maximum Flow Algorithm
-
7/28/2019 Set2_transport & Networks
92/155
.
92
The Augmenting Path Algorithm Assume that the arc capacities are either integers or rational
numbers
1. identify an augmenting path by finding somedirected 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 augmentingpath by finding the minimum of the residualcapacities of the arcs on this path. Increase the flow in
this path by c*
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
93/155
.
93
During the peak season the park management of theSeervada park would like to determine how to route
the various tram trips from the park entrance (StationO) to the scenic (Station T) to maximize the numberof trips per day. Each tram will return by the sameroute it took on the outgoing trip so the analysisfocuses on outgoing trips only. To avoid undulydisturbing the ecology and wildlife of the region,strict upper limits have been imposed on the numberof outgoing trips allowed per day in the outbounddirection on each individual road. For each road the
direction of travel for outgoing trips is indicated byan arrow in the next slide. The number at the base ofthe arrow gives the upper limit on the number ofoutgoing trips allowed per day.
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
94/155
.
94
Consider the problem of sending as many units from node O tonode T for the following network (current flow, capacity):
O
A
B
C
D
E
T
(0,5)
(0,2)
(0,1)
(0,5)
(0,4)
(0,6)
(0,4)
(0,1)
(0,3)
(0,9)
(0,7)
(0,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
95/155
.
95
Iteration 1: one of the several augmenting paths is OBET, which has aresidual capacity of min{7, 5, 6} = 5. By assigning the flow of 5 to this path, the
resulting network is shown above
O
A
B
C
D
E
T
(0,5)
(0,2)
(0,1)
(5,5)
(0,4)
(5,6)
(0,4)
(0,1)
(0,3)
(0,9)
(5,7)
(0,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
96/155
.
96
Iteration 2: Assign a flow of 3 to the augmenting path
OADT. The resulting residual network is
O
A
B
C
D
E
T
(3,5)
(0,2)
(0,1)
(5,5)
(0,4)
(5,6)
(0,4)
(0,1)
(3,3)
(3,9)
(5,7)
(0,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
97/155
.
97
Iteration 3: Assign a flow of 1 to the augmenting path
OABDT. The resulting residual network is
O
A
B
C
D
E
T
(4,5)
(0,2)
(1,1)
(5,5)
(0,4)
(5,6)
(1,4)
(0,1)
(3,3)
(4,9)
(5,7)
(0,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
98/155
.
98
Iteration 4: Assign a flow of 2 to the augmenting path OBDT. Theresulting residual network is
O
A
B
C
D
E
T
(4,5)
(0,2)
(1,1)
(5,5)
(0,4)
(5,6)
(3,4)
(0,1)
(3,3)
(6,9)
(7,7)
(0,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
99/155
.
99
Iteration 5: Assign a flow of 1 to the augmenting path
OCEDT. The resulting residual network is
O
A
B
C
D
E
T
(4,5)
(0,2)
(1,1)
(5,5)
(1,4)
(5,6)
(3,4)
(1,1)
(3,3)
(7,9)
(7,7)
(1,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
100/155
.
100
Iteration 6: Assign a flow of 1 to the augmenting path
OCET. The resulting residual network is
O
A
B
C
D
E
T
(4,5)
(0,2)
(1,1)
(5,5)
(2,4)
(6,6)
(3,4)
(1,1)
(3,3)
(7,9)
(7,7)
(2,4)
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
101/155
.
101
There are no more flow augmenting paths, so the currentflow pattern is optimal
13
O
C
A
B
E
D
T
13
4
72
1
3
3
5
6
1
7
2
Maximum Flow Example
-
7/28/2019 Set2_transport & Networks
102/155
.
102
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 directedpath from the source to the sink
For any particular cut, the cut value is the sumof the arc capacities of the arcs of the cut
The theorem states that, for any network with a
single source and sink, the maximum feasibleflow from the source to the sink equals theminimum cut value for all cuts of the network
8 3 Maximum Flow Problems
-
7/28/2019 Set2_transport & Networks
103/155
.
103
8.3 Maximum Flow Problems
Many situations can be modeled by a network in whichthe 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 startingpoint (called the source) to a terminal point (called the
sink). Such problems are called maximum flow
problems.
An example for maximum flow problem
-
7/28/2019 Set2_transport & Networks
104/155
.
104
p pSunco Oil wants to ship the maximum possible amount
of oil (per hour) via pipeline from nodeso to nodesi as
shown in the figure below.
so si21(2)2 (1)3 (2)2
(1)3
a0
3(1)4 (1)1
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).
Arc Capacity
(so,1) 2
(so,2) 3(1,2) 3
(1,3) 4
(3,si) 1
(2,si) 2
For reasons that will become clear soon, an artificial arc
called a0 is added from the sink to the source. To
-
7/28/2019 Set2_transport & Networks
105/155
.
105
called a0 is added from the sink to the source. To
formulate an LP about this problem first we should
determine the decision variable.
Xij = Millions of barrels of oil per hour that will pass
through arc(i,j) of pipeline.
For a flow to be feasible it needs to be in the following
range:
0
-
7/28/2019 Set2_transport & Networks
106/155
.
106
Suncos goal is to maximizeX0.
Max Z=X0
S.t. Xso,1
-
7/28/2019 Set2_transport & Networks
107/155
.
107
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.
8.6 Minimum Spanning Tree
-
7/28/2019 Set2_transport & Networks
108/155
.
108
p g
ProblemsSuppose 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 computernetwork, 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 thelength of the arcs is minimized. Clearly, such a group of
arcs contain no loop.
Minimum Spanning Tree Problem
A di d d d k i b i
-
7/28/2019 Set2_transport & Networks
109/155
.
109
An undirected and connected network is beingconsidered, 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 treeproblems involve choosing a set of links that have theshortest total length among all sets of links thatsatisfy a certain property For the shortest-path problem this property is that the
chosen links must provide a path between the origin andthe destination
For the minimum spanning tree problem, the requiredproperty is that the chosen links must provide a pathbetween each pair of nodes
Some Applications
D i f l i i k (fib i
-
7/28/2019 Set2_transport & Networks
110/155
.
110
Design of telecommunication networks (fiber-opticnetworks, computer networks, leased-line telephone
networks, cable television networks, etc.) Design of lightly used transportation network tominimize the total cost of providing the links (raillines, roads, etc.)
Design of a network of high-voltage electricaltransmission lines Design of a network of wiring on electrical
equipment (e.g., a digital computer system) tominimize the total length of the wire
Design of a network of pipelines to connect a numberof locations
For a network with n nodes, a spanning tree is a group
-
7/28/2019 Set2_transport & Networks
111/155
.
111
of n-1 arcs that connects all nodes of the network and
contains no loops.
1
3
212
7
4(1,2)-(2,3)-(3,1) is a loop
(1,3)-(2,3) is the minimum spanning tree
n mum pann ng ree ro emDescription
-
7/28/2019 Set2_transport & Networks
112/155
.
112
p
You are given the nodes of the network but not the
links. Instead you are given the potential links and thepositive length for each if it is inserted into the
network (alternative measures for length of a link
include distance, cost, and time)
You wish to design the network by inserting enoughlinks to satisfy the requirement that there be a path
between every pair of nodes
The objective is to satisfy this requirement in a waythat minimizes the total length of links inserted intothe network
Minimum Spanning Tree Algorithm
-
7/28/2019 Set2_transport & Networks
113/155
.
113
Greedy Algorithm 1. Select any node arbitrarily, and then connect (i.e., add a
link) to the nearest distinct node
2. Identify the unconnected node that is closest to aconnected node, and then connect these two nodes (i.e., add
a link between them). Repeat the step until all nodes have
been connected
3. Tie breaking: Ties for the nearest distinct node (step 1)or the closest unconnected node (step 2) may be broken
arbitrarily, and the algorithm will still yield an optimal
solution.
Fastest way of executing algorithm manually is thegraphical approach illustrated next
Example: The State University campus has five
Th di b i
-
7/28/2019 Set2_transport & Networks
114/155
.
114
computers. The distances between computers are given
in the figure below. What is the minimum length of
cable required to interconnect the computers? Note thatif two computers are not connected this is because of
underground rock formations.
4
2
5
3
1
6
4
5
1
3
2
2
2
4
Solution: We want to find the minimum spanning tree.
-
7/28/2019 Set2_transport & Networks
115/155
.
115
Iteration 1: Following the MST algorithm discussedbefore, we arbitrarily choose node 1 to begin. The
closest node is node 2. Now C={1,2}, ={3,4,5}, andarc(1,2) will be in the minimum spanning tree.
4
2
5
3
1
6
4
5
1
3
2
2
2
4
Iteration 2: Node 5 is closest to C. since node 5 is two
-
7/28/2019 Set2_transport & Networks
116/155
.
116
blocks from node 1 and node 2, we may include either
arc(2,5) or arc(1,5) in the minimum spanning tree. Wearbitrarily choose to include arc(2,5). Then C={1,2,5}
and ={3,4}.
4
2
5
3
1
6
4
5
1
3
2
2
2
4
Iteration 3: Since node 3 is two blocks from node 5,i l d (5 3) i th i i i t
-
7/28/2019 Set2_transport & Networks
117/155
.
117
we may include arc(5,3) in the minimum spanning tree.
Now C={1,2,5,3} and ={4}.
4
2
5
3
1
6
4
5
1
3
2
2
2
4
Iteration 4: Node 5 is the closest node to node 4. Thus,
-
7/28/2019 Set2_transport & Networks
118/155
.
118
we add arc(5,4) to the minimum spanning tree.
We now have a minimum spanning tree consisting ofarcs(1,2), (2,5), (5,3), and (5,4). The length of the
minimum spanning tree is 1+2+2+4=9 blocks.
4
2
5
3
1
6
4
5
1
3
2
2
2
4
8 4 CPM and PERT
-
7/28/2019 Set2_transport & Networks
119/155
.
119
8.4 CPM and PERTNetwork models can be used as an aid in the scheduling of large
complex projects that consist of many activities.
CPM: If the duration of each activity is known with certainty, the
Critical Path Method (CPM) can be used to determine the length
of time required to complete a project.
PERT: If the duration of activities is not known with certainty,
the Program Evaluation and Review Technique (PERT) can be
used to estimate the probability that the project will be completed
by a given deadline.
CPM and PERT are used in many applications
i l di th f ll i
-
7/28/2019 Set2_transport & Networks
120/155
.
120
including the following:
Scheduling construction projects such as officebuildings, highways and swimming poolsDeveloping countdown and hold procedure for thelaunching of space crafts
Installing new computer systems
Designing and marketing new products
Completing corporate mergers
Building ships
Project Planning, Scheduling and
C t l
-
7/28/2019 Set2_transport & Networks
121/155
.
121
Control
Planning: organized approach to accomplish the goal ofminimizing elapsed time of project defines objectives and tasks; represents tasks interactions on
a network; estimates time and resources
Scheduling: a time-phased commitment of resources identifies critical tasks which, if delayed, will delay the
projects completion time.
Control: means of monitoring and revising the progressof a project
N k R i
-
7/28/2019 Set2_transport & Networks
122/155
.
122
Network Representation
Tasks (or activities) are represented by arcs Each task has a duration denoted by tj Node 0 represents the start and node n denotes the finish of
the project
Precedence relations are shown by arcs specify what other tasks must be completed before the task in
question can begin.
A path is a sequence of linked tasks going from beginningto end
Critical path is the longest path
To apply CPM and PERT, we need a list of activities
that make up the project The project is considered to be
-
7/28/2019 Set2_transport & Networks
123/155
.
123
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 thepredecessors 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 willbe represented by arcs and the nodes will be used to
represent completion of a set of activities (Activity on
arc (AOA) type of network).
1 32A B
Activity A must be completed before activity B starts
While constructing an AOA type of project diagram one
should use the following rules:
-
7/28/2019 Set2_transport & Networks
124/155
.
124
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 ofthe 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 thanthe node representing the beginning of an activity.
An activity should not be represented by more than one arc in thenetwork
Two nodes can be connected by at most one arc.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
-
7/28/2019 Set2_transport & Networks
125/155
.
125
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
C t i t
-
7/28/2019 Set2_transport & Networks
126/155
.
126
Constraints
If tj is the earliest starting time of a task, ESi isthe earliest starting time of an immediate
predecessor and ti is the duration of theimmediate predecessor, then we have
ESj ESi + ti for every arc (i, j)
Critical Path Definitions
-
7/28/2019 Set2_transport & Networks
127/155
.
127
Earliest Start Time (ES) is the earliest time a taskcan feasibly start
Earliest Finish Time (EF) is the earliest time atask can feasibly end
Latest Start Time (LS) is the latest time a task canfeasibly start, without delaying the project at all.
Latest Finish Time (LF) is the latest time a task
can feasibly end, without delaying the project atall
Critical Path Method
-
7/28/2019 Set2_transport & Networks
128/155
.
128
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.
CPM Th B k d P
-
7/28/2019 Set2_transport & Networks
129/155
.
129
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 thestart
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 forall activities leaving the node.
CPM d C iti l P th
-
7/28/2019 Set2_transport & Networks
130/155
.
130
CPM and Critical Path
Theorem: The minimum length of the schedule isthe length of the longest path.
The longest path is called the critical path
Look for tasks whose earliest start time and latest start time are
the same. These tasks are critical, and are on a critical path.
CPM d C iti l P th
-
7/28/2019 Set2_transport & Networks
131/155
.
131
CPM and Critical Path
Critical path are found by identifying those tasks whereES=LS (equivalently, EF=LF)
No flexibility in scheduling tasks on the critical path
The makespan of the critical path equals the LF of thefinal task
Slack is the difference between LS and ES, or LF and EF.
An activity with a slack of zero is on the critical path
An example for CPM
-
7/28/2019 Set2_transport & Networks
132/155
.
132
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 Predecessors Duration(days)
A:train workers - 6
B:purchase raw materials - 9
C:produce product 1 A, B 8
D:produce product 2 A, B 7E:test product 2 D 10
F:assemble products 1&2 C, E 12
Project Diagram for Widgetco
-
7/28/2019 Set2_transport & Networks
133/155
.
133
1
65
42
3
A 6
B 9
Dummy
C 8
D 7
E 10
F 12
Node 1 = starting nodeNode 6 = finish node
Project Diagram for Widgetco Forward Pass (ES,EF)
-
7/28/2019 Set2_transport & Networks
134/155
.
134
1
65
42
3
A 6
B 9
Dummy
C 8
D 7
E 10
F 12
Node 1 = starting nodeNode 6 = finish node
(0,6)
(0,9)
(9,17)
(9,16)(16,26)
(26,38)
Project Diagram for Widgetco Backward Pass (LS,LF)
-
7/28/2019 Set2_transport & Networks
135/155
.
135
1
65
42
3
A 6
B 9
Dummy
C 8
D 7
E 10
F 12
Node 1 = starting nodeNode 6 = finish node
(3,9)
(0,9)
(18,26)
(9,16)(16,26)
(26,38)
For Widgetco example ES(i)s and LS(i)s are asfollows:
-
7/28/2019 Set2_transport & Networks
136/155
.
136
follows:
Activity ES(i) LS(i)
A 0 3
B 0 0
C 9 18
D 9 9
E 16 16
F 26 26
According to the table on the previous slide the slacks
are computed as follows:
-
7/28/2019 Set2_transport & Networks
137/155
.
137
are computed as follows:
Activity B: 0
Activity A: 3
Activity D: 0
Activity C: 9
Activity E: 0
Activity F: 0
Critical path
-
7/28/2019 Set2_transport & Networks
138/155
.
138
An activity with a slack of zero is a critical activity A path from node 1 to the finish node that consistsentirely of critical activities is called a critical path.
For Widgetco example B-D-E-F is a critical path.
The Makespan is equal to 38
Using LP to find a critical pathD i i i bl
-
7/28/2019 Set2_transport & Networks
139/155
.
139
Decision variable:
Xij:the time that the event corresponding to node j occurs
Since our goal is to minimize the time required tocomplete the project, we use an objective function of:
Z=XF-X1
Note that for each activity (i,j), before j occurs , i must
occur and activity (i,j) must be completed.
Min Z =X6-X1
S T X >=X +6 (Arc (1 3) constraint)
-
7/28/2019 Set2_transport & Networks
140/155
.
140
S.T. X3>=X1+6 (Arc (1,3) constraint)
X2>=X
1+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)
The optimal solution to this LP is Z=38, X1=0, X2=9,
X3=9, X4=16, X5=26, X6=38
On variability of tasksC id 10 i d d k
-
7/28/2019 Set2_transport & Networks
141/155
.
141
Consider 10 independent tasks
each takes 1 unit of time on average the time it takes is uniformly distributed between 0and 2.
CPM (uses expected value) Modeling Randomness
The random schedule takes longer
On Incorporating Variability
-
7/28/2019 Set2_transport & Networks
142/155
.
142
Program Evaluation and Review Technique(PERT)
Attempts to incorporate variability in the durations
Assume mean, m, and variance, s2, of the durationscan be estimated
Simulation
Model variability using any distributionsimulate to see how long a schedule will take
PERTCPM assumes that the duration of each activity is
-
7/28/2019 Set2_transport & Networks
143/155
.
143
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 thisshortcoming 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 activitys duration under the mostfavorable conditions
b : estimate of the activitys duration under the leastfavorable conditions
m : most likely value for the activitys duration
Let Tij be the duration of activity (i,j). PERT requires
-
7/28/2019 Set2_transport & Networks
144/155
.
144
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 themean and variance ofTij may be approximated by
36
)(
var
64)(
2ab
T
bmaTE
ij
ij
PERT requires the assumption that the durations of all
-
7/28/2019 Set2_transport & Networks
145/155
.
145
activities are independent. Thus,
pathji
ijTE),(
)(
pathji
ijT),(
var
: expected duration of activities on any path
: variance of duration of activities on any path
Let CP be the random variable denoting the total
-
7/28/2019 Set2_transport & Networks
146/155
.
146
duration of the activities on a critical path found by
CPM. PERT assumes that the critical path found byCPM contains enough activities to allow us to invoke
the Central Limit Theorem and conclude that the
following is normally distributed:
thcriticalpaji
ijTCP),(
a, b and m for activities in Widgetco
-
7/28/2019 Set2_transport & Networks
147/155
.
147
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
According to the table on the previous slide:
)513(36135 2
-
7/28/2019 Set2_transport & Networks
148/155
.
1481
36
)915(var,12
6
48159)(
44.036
)812(var,106
40128)(
436
)113(var,7
6
28131)(
78.236
)313(
var,86
32133
)(
78.136
)210(var,6
6
24102)(
78.1
36
)513(var,9
6
36135)(
2
5656
2
4545
2
3434
2
3535
2
1313
2
1212
TTE
TTE
TTE
TTE
TTE
TTE
Of course, the fact that arc (2,3) is a dummy arc yields
E(T23)=varT23=0
-
7/28/2019 Set2_transport & Networks
149/155
.
149
E(T23) varT23 0
The critical path was B-D-E-F. Thus,
E(CP)=9+0+7+10+12=38
varCP=1.78+0+4+0.44+1=7.22
Then the standard deviation for CP is (7.22)1/2=2.69
And
13.0)12.1()69.2
3835
69.2
38()35(
ZP
CPPCPP
PERT implies that there is a 13% chance that the
-
7/28/2019 Set2_transport & Networks
150/155
.
150
project will be completed within 35 days.
More on Project Management CPM
-
7/28/2019 Set2_transport & Networks
151/155
.
151
CPM
Advantage of ease of useLays out the Gantt chart (nicely visual)
Identifies the critical path
Used in practice on large projects e.g., used for the big dig
Other issuesTasks take resources, which are limited
Task times are really random variables
Unpredictable things happen
Incorporating Resource
-
7/28/2019 Set2_transport & Networks
152/155
.
152
Constraints
Each task can have resources that it needs3 construction workers
1 craneetc
In scheduling, do not use more resourcesthan are available at any time
Makes the problem much more difficult tosolve exactly. Heuristics are used.
Dealing with the unknown
-
7/28/2019 Set2_transport & Networks
153/155
.
153
Dealing with the unknown
VERY hard to model
How does one model totally unforeseen
events?In the Big Dig, there is a leak in digging a
tunnel despite assurances it would not happen
In the Hubble telescope, a firm assures that themirrors are ground properly. By the time the
mistake is discovered, the telescope is in outer
space.
Project Management Software
-
7/28/2019 Set2_transport & Networks
154/155
.
154
Project Management Software
Explosive growth in software packages usingthese techniques
Cost and capabilities vary greatly Yearly survey inPM Network
Microsoft Project is most commonly used
package todayFree 60 day trial versions:
http://www.microsoft.com/office/98/project/
trial/info.htm
Summary
-
7/28/2019 Set2_transport & Networks
155/155
Project management Simple model: we use estimates of the timefor each task, and we use the precedence
constraints