You are on page 1of 40

Lecture 8, 9, and 10 Material

Instructor: K. Gita Ayu


April 3, 2012
1 Network Models
Network problems are widely applicable cases of linear programming which are proven to be more tractable
due to specialized algorithms for specic type of problems. Network models have decision variables and
constraints have a form that can easily represented in a diagram (directed graphs or digraphs).
Lets begin with basic denition and terminology which are commonly used in network models:
Graph is a ow network and is dened by two sets of symbols:
Node or so called points or vertices.
Arc consists of an ordered pair of vertices and represents a possible direction of motion that may
occur between vertices.
Arc (j, k) is where node j is the initial node and node k is the terminal node.
A source is a node where the ow originates while a sink is a node where the ow terminates.
A chain is a sequence of arcs connecting such that every arc has exactly one vertex in common with
its predecessor in the sequence and no vertex is visited more than once.
A cycle or loop is a chain with the same beginning and ending vertex. Dicycles are cycles that have
all arcs oriented in the same direction.
Undirected graph has only edges (undirected links). Directed graph or digraph is a graph having only
arcs (directed links).
A path is a directed chain or by denition is a chain in which the terminal node of each arc is identical
to the initial node of the next arc. In other words, paths are chains that transmit all arcs in the forward
direction. Whether directed or not, a path will use the link no more than once because paths cannot
repeat nodes.
If there exist a chain connecting every pairs of nodes, it is called connected graph
Tree is a connected graph contains no cycles.
A spanning tree has (n-1) arcs that connects all nodes of the network and contains no cycles.
Thus, it can be dened that a minimum spanning tree is a spanning tree of minimum length in a
network.
Lets dene the cycle directions as follows,
x
ij
=
_
_
_
+1 if arc (i, j) is forward (with direction) in the cycle
1 if arc (i, j) is reverse (against direction) in the cycle
0 if arc (i, j) is not part of the cycle
1
c
ij
= cost from i to j which equals to if no arc actually exists.
b
j
= total ow at node j with values of > 0 (source), < 0 (sink), or = 0 (transshipment)
Now, for practice, write the LP of the network shown below:
Min z = 4x
12
+ 10x
13
+ 6x
23
+ 5x
24
+ 10x
25
+ 2x
34
+ 8x
43
+ 2x
45
(total cost)
s.t. x
12
+ x
13
= 100 (node 1)
x
12
+ x
23
+ x
24
+ x
25
= 0 (node 2)
x
13
x
23
+ x
34
x
43
= 20 (node 3)
x
24
x
34
+ x
43
+ x
45
= 10 (node 4)
x
25
x
45
= 70 (node 5)
x
ij
0, i, j
The characteristic of a network problem is there exists a +1 and 1 in each column of the LP.
1.1 Case 01: Transportation Problem
Among the simplest of classic network models are transportation problems, minimum cost network models
for which every node is either a pure supply node (all arcs are point out) or a pure demand node (all arcs
point in). To be called a transportation problem, it is necessary that ows go directly from sources to sinks.
A transportation problem consists of
A set of m supply points from which a good is shipped
A set of n demand points to which the good is shipped
Each unit produced at supply point i and shipped to demand point j incurs a variable cost of c
ij
Thus, the general form of transportation LP is:
2
Min z =
m

i=1
n

j=1
c
ij
x
ij
(transportation cost)
s.t.
n

j=1
x
ij
s
i
(supply constraint)
m

i=1
x
ij
d
j
(demand constraint)
x
ij
0, i, j (nonnegative)
Note that for a balanced transportation problem, all inequality become equality and it can be summaried in
a transportation tableau (see below).
Remarks:
If

supply =

demand, then the problem is said to be a balanced transportation problem.


If the total demand < total supply, then add dummy demand node with the c
ij
= 0 (no penalty, why?)
If the total demand > total supply, then add dummy supply node and put penalty into it, why?
1.1.1 Powerco Formulation, Winston p. 360
Powerco has three electric power plants that supply the needs of four cities. Each power plant can supply
the following numbers of kilowatt-hours (kWh) of electricity: plant 1, 35 million; plant 2, 50 million; plant
3, 40 million (see table below). The peak power demands in these cities, which occur at the same time (2
p.m.), are as follows (in kWh): city 1, 45 million; city 2, 20 million; city 3, 30 million; city 4, 30 million. The
cost of sending 1 million kWh of electricity from plant to city depend on the distance the electricity must
travel. Formulate an LP to minimize the cost of meeting each citys peak power demand.
To ($)
From City 1 City 2 City 3 City 4
Plant 1 8 6 10 9
Plant 2 9 12 13 7
Plant 3 14 9 16 5
Always check whether it is a balanced transportation model or not. If it is balanced, then all constraints are
binding and can be written in equality form. If it is not, it is advisable to transform it rst into a balanced
transportation problem because simplex pivots do not involve multiplication, additions, and subtractions.
3
Figure 1: Graphical Representation of Powerco Problem
The graphical representation of Powerco Problem can be seen in Figure 1 above. Prior writing the LP
of Powerco problem, we need to dene the variables.
Let: i = plant number = {1, 2, 3}
j = city = {1, 2, 3, 4}
c
ij
= cost of shipping 1 million kWh from plant i to city j = {8, 6, 10, 9, 9, 12, 13, 7, 14, 9, 16, 5}
s
i
= max available power in plant i (million kWh) = {35, 50, 40}
d
j
= power demand in city j (million kWh) = {45, 20, 30, 30}
x
ij
= # million kWh supplied from plant i to city j
The following is the linear formulation for Powerco,
Min z = 8x
11
+ 6x
12
+ 10x
13
+ 9x
14
+9x
21
+ 12x
22
+ 13x
23
+ 7x
24
+14x
11
+ 9x
12
+ 16x
13
+ 5x
14
(total transportation cost)
x
11
+ x
12
+ x
13
+ x
14
35 (max supply plant 1)
x
21
+ x
22
+ x
23
+ x
24
50 (max supply plant 2)
x
31
+ x
32
+ x
33
+ x
34
40 (max supply plant 3)
x
11
+ x
21
+ x
31
45 (demand city 1)
x
12
+ x
22
+ x
32
20 (demand city 2)
x
13
+ x
23
+ x
33
30 (demand city 3)
x
14
+ x
24
+ x
34
30 (demand city 4)
x
ij
0, i, j
4
In a more simplied form, the Powerco problem may be written as
Min z =
3

i=1
4

j=1
c
ij
x
ij
(total transportation cost)
4

j=1
x
ij
s
i
, i (max supply plant i)
3

i=1
x
ij
d
j
j (demand city j)
x
ij
0, i, j
Because Powerco problem is a balanced transportation problem, all inequality constraints can be written
as equality constraints as can be seen as follow and the transportation tableau can be seen in Table 1:
Min z =
3

i=1
4

j=1
c
ij
x
ij
(total transportation cost)
4

j=1
x
ij
= s
i
, i (max supply plant i)
3

i=1
x
ij
= d
j
j (demand city j)
x
ij
0, i, j
The optimal solution of Powerco is found to be
z = 1020, x
12
= 10, x
13
= 25, x
21
= 45, x
23
= 5, x
32
= 10, andx
34
= 30.
Table 1: Initial Transportation Tableau of Powerco Problem
5
Suppose the demand in city 1 were reduced to 40 million kWh. Reformulate the LP.
This slight revision in one of the demand nodes results in unbalanced transportation model because the

supply >

demand. Adding dummy demand with the amount of 5 million kWh will balance the un-
balanced Powerco problem (see Figure 2). Do not forget to set the cost to transfer power from plant i to
dummy equals to zero. Why?
Figure 2: Graphical Representation of Unbalanced Powerco Problem
Let: i = plant number = {1, 2, 3}
j = city = {1, 2, 3, 4, dummy}
c
ij
= cost of shipping 1 million kWh from plant i to city j
= {8, 6, 10, 9, 0, 9, 12, 13, 7, 0, 14, 9, 16, 5, 0}
s
i
= max available power in plant i (million kWh) = {35, 50, 40}
d
j
= power demand in city j (million kWh) = {40, 20, 30, 30, 5}
x
ij
= # million kWh supplied from plant i to city j
The following is the new linear formulation for the unbalanced Powerco problem and the transportation
tableau can be seen in Table 2,
Min z =
3

i=1
5

j=1
c
ij
x
ij
(total transportation cost)
5

j=1
x
ij
= s
i
, i (max supply plant i)
3

i=1
x
ij
= d
j
j (demand city j)
x
ij
0, i, j
6
The optimal solution of the unbalanced Powerco is found to be
z = 975, x
12
= 15, x
13
= 20, x
21
= 40, x
23
= 10, x
32
= 5, x
34
= 30, and x
35
= 5.
Table 2: Initial Transportation Tableau of Unbalanced Powerco Problem
Suppose plant 1 had only 30 million kWh of capacity. Reformulate the LP.
If you encounter a problem in which the total supply is less than the total demand, then the problem
has no feasible solution. However, it is sometimes desirable to allow the possibility of leaving some demand
unmet. In such situation, add a dummy supply and assign penalty cost for the unmet demand. For Powerco
problem, we add a dummy supply of 5 million kWh and set the cost from dummy plant to demand j equals
to a large value (typically M if the cost is undeterminable) as a penalty cost of not being able to fulll
the demand (see Figure 3). Prior writing the LP, redene the variables and its values.
Figure 3: Graphical Representation of Unbalanced Powerco Problem
Let: i = plant = {1, 2, 3, dummy}
j = city = {1, 2, 3, 4}
c
ij
= cost of shipping 1 million kWh from plant i to city j
= {8, 6, 10, 9, 9, 12, 13, 7, 14, 9, 16, 5, M, M, M}
s
i
= max available power in plant i (million kWh) = {30, 50, 40, 5}
d
j
= power demand in city j (million kWh) = {45, 20, 30, 30}
x
ij
= # million kWh supplied from plant i to city j
7
The following is the new linear formulation for the unbalanced Powerco problem. The respective transporta-
tion tableau can be seen in Table 3.
Min z =
4

i=1
4

j=1
c
ij
x
ij
(total transportation cost)
4

j=1
x
ij
= s
i
, i (max supply plant i)
4

i=1
x
ij
= d
j
j (demand city j)
x
ij
0, i, j
The optimal solution of the unbalanced Powerco is found to be
z = 975, x
12
= 15, x
13
= 20, x
21
= 40, x
23
= 10, x
32
= 5, x
34
= 30, and x
35
= 5.
Table 3: Initial Transportation Tableau of Unbalanced Powerco Problem
1.1.2 Handling Shortage
Three reservoirs are available to supply the water needs of ve nearby cities. Each reservoir can supply up
to 40 million gallons of water per day. Each city would like to receive 30 million gallons per day. For each
million gallons per day of unmet demand, there is a penalty. At city 1, the penalty is $20; at city 2, the
penalty is $25; at city 3, the penalty is $23; at city 4, the penalty is $25; and at city 5, the penalty is $21.
The cost of transporting 1 million gallons of water from each reservoir to each city can be seen in the table
below. Formulate a balanced transportation problem that can be used to minimize the sum of shortage and
transport costs.
To ($)
From City 1 City 2 City 3 City 4 City 5
Reservoir 1 12 8 10 9 8
Reservoir 2 9 8 7 12 10
Reservoir 3 10 10 9 7 9
For this problem,

supply = 3 reservoirs x 40 million gallon/day = 120 million gallons/day.

demand = 5 cities x 30 million gallon/day = 150 million gallons/day.


8
To balance the problem, add dummy supply having a supply of 150 120 = 30 million gallons/day. The
shipping cost from the dummy supply point to a city is equivalent to its penalty cost. See Table 4 for the
transportation tableau of the handling shortage problem.
Table 4: Initial Transportation Tableau of Handling Shortage
Let: i = reservoir = {1, 2, 3, dummy}
j = city = {1, 2, 3, 4, 5}
c
ij
= cost of shipping 1 million gallons of water from reservoir i to city j
= {12, 8, 10, 9, 8, 9, 8, 7, 12, 10, 10, 10, 9, 7, 9, 20, 25, 23, 25, 21}
s
i
= max supply of water from reservoir i (million gallons) = {40, 40, 40, 30}
d
j
= water demand in city j (million gallons) = {30, 30, 30, 30, 30}
x
ij
= # million gallons of water supplied from reservoir i to city j
The LP of the shortage problem can be written as
Min z =
4

i=1
5

j=1
c
ij
x
ij
(total shipping cost)
5

j=1
x
ij
= s
i
, i (max supply reservoir i)
4

i=1
x
ij
= d
j
j (water demand city j)
x
ij
0, i, j
1.1.3 Inventory Problem as Transportation Problem (Model Formulation problem revisited),
Winston, p. 366
Sailco Corp must determine how many sailboats should be produced during each of the next four quarters.
The demand during each of the next four quarters is as follows: rst quarter, 40 sailboats; second quarter,
60 sailboats; third quarter, 75 sailboats; fourth quarter, 25 sailboats. Sailco must meet demands on time.
The beginning of the rst quarter, Sailco has an inventory of 10 sailboats. At the beginning of each quarter,
Sailco must decide how many sailboats should be produced during that quarter. For simplicity, we assume
that sailboats manufactured during a quarter can be used to meet demand for that quarter. During each
quarter, Sailco can produce up to 40 sailboats with regular-time labor at a total cost of $400 per sailboat.
By having employees work overtime during a quarter, Sailco can produce additional sailboats with overtime
9
labor at a total cost of $450 per sailboat. At the end of each quarter (after production has occurred and
the current quarters demand has been satised), a carrying or holding cost of $20 per sailboat is incurred.
Formulate the balanced transportation problem.
Facts about Sailco Corp.:
Total demand for the next four quarters = 40 +60 + 75 + 25 = 200 sailboats
There is no limit on the max sailboats can be produced using overtime, thus what value should be
entered?
Given the fact that there is an initial inventory of 10 sailboats and maximum 40 sailboats can be produced
using regular-time, we can set the maximum sailboats can be produced using overtime labor, (total demand)
(beginning inventory) (max production using regular-time labor) which equals to 200 10 40 = 150
sailboats. The constraints can be further tighten by taken into consideration that no backordered is allowed
in this problem.
First quarter. Maximum 40 sailboats can be produced using regular-time labor and we have 10 sailboats
in the beginning of the rst quarter. As calculated previously, the total demand is 200 sailboats for the
next four quarters. Thus, max production in quarter 1 for using overtime labor is 200 10 40 = 150.
Second quarter. Similarly, maximum production using regular-time labor is 40 sailboats. Since sail-
boats produced in the second quarter cannot be used to fulll the rst quarter demand, the total
demand is now 200 40 = 160. The maximum sailboats can be produced using overtime labor is
160 40 = 120.
Third quarter. Again, since we cannot produce sailboats in quarter 3 to fulll demand in the previous
quarters, the total demand becomes 200 40 60 = 100. Thus, maximum production using overtime
labor in quarter 3 is 100 40 = 60.
Lastly, the fourth quarter. The total demand becomes 200406075 = 25 and the max production
in quarter 4 using overtime labor is 25 40 = none.
Note: we can drop the last supply point decision variable because the max #sailboats can be produced
is zero. This is not a balanced transportation problem because the total supply is greater than the total
demand (10 + 40(4) + 150 + 120 + 60 + 0 = 500 versus 200). Thus, we need to add a dummy demand with
value of 300. Next is to determine the cost of a sailboat which is (producing cost) + (carrying cost).
For production cost of the initial inventory (I) is 0. However, the holding cost varies depending on how
many quarters will this inventory be carried on
no carrying cost to quarter 1, thus the total cost is 0.
however, because it has to be carried on for one quarter (from quarter 1 to quarter 2), the total
cost to quarter 2 is 0 + 20 = $20
by the same token, the total cost to quarter 3, c
I3
= 0 + (2)(20) = $40
total cost to quarter 4 is c
I4
= 0 + (3)(20) = $60
total cost to dummy is 0
Quarter 1 using regular-time labor, the production cost is $400 per sailboat.
no carrying cost to quarter 1, thus the total cost is merely the production cost or $400
carrying cost to quarter 2 is (1)(20) = 20, thus total cost is 400 + 20 = $420
carrying cost to quarter 3 is (2)(20) = 40, thus total cost is 400 + 40 = $440
10
carrying cost to quarter 4 is (3)(20) = 60, thus total cost is 400 + 60 = $460
total cost to dummy is 0
Quarter 1 using overtime labor incurs production cost of $450 per sailboat.
no carrying cost to quarter 1, thus the total cost is merely the production cost or $450
carrying cost to quarter 2 is (1)(20) = 20, thus the total cost is 450 + 20 = $470
carrying cost to quarter 3 is (2)(20) = 40, thus the total cost is 450 + 40 = $490
carrying cost to quarter 4 is (3)(20) = 60, thus the total cost is 450 + 60 = $510
carrying cost to dummy is 0
Quarter 2 using regular-time labor, production cost of is $400 per sailboat.
carrying cost to quarter 1? CANNOT. Assign any big number, M.
no carrying cost to quarter 2, thus the total cost is merely the production cost or $400
carryingcost to quarter 3 is (1)(20) = 20, thus total cost is 400 + 20 = $420
carrying cost to quarter 4 is (2)(20) = 40, thus total cost is 400 + 40 = $440
carrying cost to dummy is 0
Use the similar pattern to calculate the total cost of the remaining possible combination.
Figure 4: Sailco Transportation Tableau
Last but not least, to ensure that no sailboats are used to meet demand during a quarter prior to their
production, a cost of M (any large positive number) is assigned to any cell that corresponds to using
production to meet demand for an earlier quarter. The transportation tableau of the Sailco problem can be
seen in Figure 4.
11
Let: i = production period = {I, Reg1, Over1, Reg2, Over2, Reg3, Over3, Reg4}
j = quarterly demand = {1, 2, 3, 4, dummy}
c
ij
= cost of producing 1 sailboat in period i to fulll demand quarter j
= {0, 20, 40, 60, 0, 400, 420, 440, 460, 0, . . . , M, M, 450, 0}
s
i
= #sailboats can be produced during i
th
= {10, 40, 150, . . . , 60, 40}
d
j
= #sailboats demand in period j (million gallons) = {30, 30, 30, 30, 30}
x
ij
= # sailboats produced in period i to fulll demand quarter j
The Sailco LP may be written as
Min z =
8

i=1
5

j=1
c
ij
x
ij
(total production and carrying cost)
5

j=1
x
ij
= s
i
, i (max sailboats can be produced)
8

i=1
x
ij
= d
j
j (sailboat demand in period j)
x
ij
0, i, j
1.1.4 Solving Transportation Problem
Remark: always balance the transportation problem prior solving it!
Simplex algorithm can be used to solve a transportation problem with slight modication yet simpler.
Recall that multiplications, additions, and subtractions are required when the pivot row was used to elimi-
nate the entering basic variable from the other constraints and row 0. In solving a transportation problem,
however, pivots only require additions and subtractions. Step by step how to do transportation simplex will
be explain in the following paragraphs.
Transportation Simplex:
1. Select (m + n 1) x
ij
s to form an initial bfs.
2. Find the current bfs [u
1
u
2
. . . u
m
v
1
v
2
. . . v
n
] by setting u
1
= 0 and u
i
+ v
j
= c
ij
.
3. Check whether the solution is optimal:
If u
i
+ v
j
c
ij
0, for all NBV, STOP! The solution is optimal
Else, go to step 4
4. Variable with the most positive u
i
+ v
j
c
ij
enters the basis using the pivoting procedure. Find the
new bfs.
5. Return to step 2
Pivoting
1. Determine the entering variable.
2. Find the loop involving the entering variable and some of the basic variables.
12
3. Counting only cells in the loop, label those that are an even number of cells away from entering variable
as even cells, and the odd number of cells as odd cells.
4. Find the odd cell whose variable assumes the smallest value say , as the leaving variable
Pivoting: Decrease the value of the odd cells and increase the value of the even cells by ;
Degeneracy: happens if = 0 or if there are more than one odd cell in the loop equals , arbi-
trarily choose one of these odd cells to leave the basis.
Why we have to alternate odd and even? Why not just compare all cells and nd the minimum? Because
we are in a balanced problem, if we subtract all, we will not end up with another bfs (remember that adding
in one cell need to be balanced out by reducing in another cell adjacent to it).
Pricing out the NBV and to determine which NBV should enter the basis?
1. Find the c
BV
B
1
by setting c
BV
B
1
a
ij
c
ij
= 0 for all BV.
2. Set u
1
= 0 and solve the m + n equations.
3. The most positive c
ij
shall enter the basis.
Remark:
Remember the coecient of the variable x
ij
in the tableaus row 0 is c
ij
= c
BV
B
1
a
ij
c
ij
where a
ij
is the column for x
ij
in the original LP (assuming that the rst supply constraint has been dropped).
Since this is a minimization problem, the current bfs is optimal if all c
ij
are nonpositive.
Dropping the rst constraint will result in m+n1 elements in c
BV
B
1
= [u
2
u
3
. . . u
m
v
1
v
2
. . . v
n
]
where u
2
, u
3
, . . . , u
m
corresponds to the m1 supply constraints, and v
1
, v
2
, . . . , v
n
correspond to the
n demands constraints.
Note that c
ij
= 0 for all BV, thus we can nd c
BV
B
1
by setting c
BV
B
1
a
ij
c
ij
.
The foremost step in transportation simplex is to nd the initial basic feasible solution. A balanced
transportation problem can be solved by omitting any one of the constraints and solve it as an LP with
m + n 1 constraints given the following important observation. If a set of values for the x
ij
s satises all
but one of the constraints of a balanced transportation problem, the values for the x
ij
s will automatically
satisfy the other constraint. However, this does not mean any collection of m + n 1 variables would yield
a basic solution. Three methods to nd the initial bfs will be introduced in this section, Northwest Corner,
Minimum Cost, and Vogels Methods.
Denition
A loop is an ordered sequene of at least four dierent cells with
Any two consecutive cells lie in either the same row or same column.
No three consecutive cells lie in the same row or column.
The last cell in the sequence has a row or column in common with the rst sequence.
The rst three paths in Figure 5 are loops: (1, 1) (1, 4) (4, 4) (4, 1); (1, 1) (1, 3) (5, 3) (5, 4)
(3, 4) (3, 1); (1, 1) (1, 4) (3, 4) (3, 3) (2, 3) (2, 1). While the remaining three does not represent a
loop because some cells are either lie or no lie in the same row or column with the previous cells.
(2, 1) (2, 3) (2, 5) (4, 5) (4, 1) is not a loop due to (2, 1), (2, 3), and (2, 5) all lie in the same row
13
The path (2, 1) (2, 3) (2, 4) (4, 3) (4, 2) does not represent a loop because of two things: rst
(2, 1), (2, 3), (2, 4) lie in the same row and second (2, 4), (4, 3) and (4, 2), (2, 1) do not lie in the same
row or column.
(1, 3)(1, 4)(3, 4)(3, 2) is also not a loop because (1, 3), (3, 2) do not lie in the same row or column.
Figure 5: Loops versus Paths
Theorem 1 in a balanced transportation problem with m supply points and n demand points, the cells
corresponding to a set of m + n 1 variables contain no loop IFF the m + n 1 vars yield a basic solution
Three methods that can be used to nd a bfs for a balanced transportation problem: Northwest Corner,
Minimum-Cost, and Vogels Methods.
Northwest Corner Method
Steps:
1. Start with the upper left (northwest) corner of the transportation tableau
2. Set the value as large as possible
3. Cross out the row or column if the value is the same as s
i
or d
i
4. Update, nd the most NW cell in the tableau that does not lie in a crossed-out row or column
5. Repeat until you come to a point where there is only once cell that can be assigned a value
6. STOP, the bfs has been obtained
14
Example: Find the bfs using northwest corner method for the transportation tableau below.
See Figure 6. The walkthrough is explained as follows.
Step 1: Begin with the upper left (or northwest) corner of the transportation tableau and set x
11
as large
as possible. The largest value for x
11
is the smallest number of s
1
and d
1
, which is 2. Thus, set x
11
= 2 = d
1
.
Because d
1
is fullled, cross out the rst column of the transportation tableau (we do not need to supply d
1
anymore). Revise the available supply s
1
to 5 2 = 3.
Step 2: Find the most northwest cell in the tableau and set x
12
as large as possible. The largest value
for x
12
is the smallest number of s
1
and d
1
, which is 3. Hence, set x
12
= 3 = s
1
. Now, supply s
1
is all used
up. Cross out the rst row of the transportation tableau because we no longer can supply to any demand
points. Change s
1
= 0 and d
1
to 4 3 = 1.
Step 3: Again, nd the most northwest cell in the tableau, x
22
. By the same token, the largest value for
x
22
is 1 (in this case, both s
1
and d
1
have the same value meaning we may cross out either row 2 or column
2). For no particular reason, we choose to cross out row 2. Then s
2
must be changed to 1 1 = 0.
Step 4 and 5: The most northwest available variable is now x
33
, so we set x
33
= min {3, 0} = 0. Cross
out column 2 and change s
3
to 3 0 = 3. Continue the procedure by nding the most northwest available
cell, x
33
and set its value as large as possible, which is min (2, 3) = 2.
Step 6: The only available cell is x
34
. Set its value to the smallest number of d
4
and s
3
which is 1. No
cells are available, so we are nished. The bfs is x
11
= 2, x
12
= 3, x
22
= 1, , x
32
= 0, x
33
= 2, x
34
= 1.
Why does northwest corner method yield a bfs?
The method ensures that all BV 0 and each supply and demand constraint is satised because eventually
every row and column must be crossed out (m + n). So m + n 1 variables are chosen The last variable
assigned a value results in a row and column being crossed out, cannot form a loop. Note that in northwest
corner method, we focus on fullling the demand from the available supply, we do not take into account the
shipping cost, thus it may lead into a bfs with an extremely high shipping cost. Nevertheless, northwest
method requires the least eort.
Minimum Cost Method
Steps:
1. Assign variable with the smallest shipping cost with the largest possible value
2. Cross out the row or column if the value is the same as s
i
or d
i
3. Update by nding a cell with the next smallest shipping cost in the tableau that does not lie in a
crossed-out row or column
4. Repeat until you come to a point where there is only once cell that can be assigned a value
5. STOP, the bfs has been obtained
15
Figure 6: Steps in Finding BFS using Northwest Corner Method
Example: Find the bfs using minimum cost method for the transportation tableau below.
See Figure 7. The walkthrough is explained as follows.
Step 1: Begin the minimum-cost method by nd the variable with the smallest shipping cost, x
22
with
shipping cost of 1. Set x
22
with the largest possible value equals to the smallest between d
1
and s
1
, which
is min {9, 15} = 9. Cross out the second column because d
2
is fullled and reduce s
2
= 15 9 = 6.
Step 2: Both, x
21
and x
32
, have the minimum shipping cost of 2. We choose x
21
and set its value to
x
21
= min {6, 20} = 6 because x
32
lies in a crossed-out column. Cross out the second row because no more
supply can come from s
2
. Reduce d
1
= 206 = 14. If we encounter a case where the min {s
i
, d
j
} = s
i
= d
j
,
we can only drop either column j or row i and set the other row i or column j, total value equals to zero.
Step 3: The next variable is x
31
. By the same token, set x
31
= min {15, 14} = 14, cross out column 1,
and reduce s
3
= 1.
Step 4: The minimum cost that does not lie in a crossed-out row or column is x
13
. Set x
13
= min {10, 5} =
5, cross out column 3, and reduce s
1
= 10 5 = 5.
16
Step 5: Following the same procedure, x
14
is the variable with the smallest shipping cost. Assign the
minimum value between d
1
= 6 and s
4
= 5 to x
14
and reduce the value of d
4
= 6 5 = 1.
Step 6: The only cell that we can choose it x
34
. Set x
34
= min {1, 1} and cross out both row 3 and
column 4. We have now obtained x
14
= 5, x
21
= 6, x
22
= 9, x
31
= 14, x
34
= 1.
Figure 7: Steps in Finding BFS using Northwest Corner Method
Remark: Minimum cost method will not always result in yielding a bfs with a relatively low total shipping
cost. The following example shows how minimum cost method is fooled into choosing a relatively high-cost
bfs.
17
Figure 8: Example of Minimum Cost Method Fails to Generate Relatively Low Cost bfs
If we apply the minimum cost method, we set x
11
= 15 (the minimum of s
1
= 15 and d
1
= 20) and
x
21
= 5 (the minimum of s
2
= 20 and d
1
= 5). This forces us to assign values to x
22
and x
23
, thereby
incurring their high shipping cost (see Figure 8). The total cost is 1090 (not really the minimum) because
we are forced to use the high shipping cost of 60 and 70. Thus, the minimum cost method for this particular
problem will yield a costly bfs. The following method, Vogels, generally avoid nding bfs with extremely
high shipping costs.
Vogels Method
Steps:
1. Compute each row (and column) penalty (the dierence between the two smallest costs in the row
(column)
2. Find the row or column with the largest penalty and nd the rst BV which has the smallest shipping
cost. Assign value to the variable as large as possible
3. Cross out the row or column if the value is the same as s
i
or d
i
4. Update and repeat the procedure until you come to a point where there is only one cell that can be
assigned a value
5. STOP, the bfs has been obtained
We illustrate Vogels method by nding a bfs of the previous example (see Figure 9).
Step 1: Begin by computing the penalty of each row (and column). Penalty equals to the dierence
between the two smallest costs in the row (column).
Step 2: Column 3 has the largest penalty = 62, so set x
23
= min {s
1
, d
3
} = {15, 5} = 5. x
23
is selected
because it has the smallest shipping cost within column 3. Cross out column 3 and reduce s
1
to 15 5 = 10.
Step 3: Recompute the new penalties. Row 2 has the largest penalty = 60. Variable that has the smallest
shipping cost within row 2 is x
21
. Set its value to the min {s
2
, d
1
} = min {20, 20} = 20. For no particular
18
reason, we choose to cross column 1 and reduce d
1
= 20 20 = 0. Note that if there are still at least two
costs in one row or column, penalty shall still be calculated.
Step 4: Again, recalculate the new penalties. Column 2 has the largest penalty of 53. By the same token,
nd the variable that has the smallest shipping cost within column 2 and set its value x
12
= min {10, 10} =
10. Cross out both column 2 and row 1 and our application of Vogels method is complete. The bfs is
x
12
= 10, x
13
= 5, x
21
= 20.
Figure 9: Vogels Method to Solve Transportation Problem
For exercise, lets revisit Powerco problem. Find the initial bfs using northwest corner, minimum cost, and
Vogels method.
Vogels method avoid the costly shipments due to the penalties (high shipping cost results in large
penalties) while northwest corner method requires the least eort. However, Vogels method requires the
19
most eort. Vogels method usually takes substantially fewer pivots that the other two methods [Glover et
al. (1974)] thus the other two methods are rarely used to nd the bfs of a large transportation problem.
Recall simplex algorithm requires pivoting with many multiplications. In solving a transportation prob-
lem, however, pivots require only additions and subtractions which simplies the original simplex. Revisit
Powerco problem with initial bfs calculated using northwest corner method and perform pivoting.
20
Steps to perform pivoting:
The initial bfs is x
11
= 35, x
21
= 10, x
22
= 20, x
23
= 20, x
33
= 10, and x
34
= 30.
Suppose the entering variable is x
14
.
The loop involving x
14
and some of the basic variables is x
14
x
34
x
33
x
23
x
21
x
11
.
Find the even and odd cells in the loop. Remember even cell if it is an even number of cell away
from the entering variable and vice versa. Cells highlighted in yellow represent even cells and cells
highlighted in green represent odd cells.
x
14
(0: even) x
34
(1st: odd) x
33
(2nd: even) x
23
(3rd: odd) x
21
(4th: even) x
11
(5th: odd)
Find the odd cell with the smallest value, = 20 which belongs to x
23
.
x
14
(even) x
34
(odd, 30) x
33
(even) x
23
(odd, 20) x
21
(even) x
11
(odd, 35)
Perform pivoting by decreasing the odd cells and increasing the even cells by = 20 to get the new
transportation tableau as follows:
Thus, we can conclude that the leaving variable is x
23
and the entering variable is x
14
with the new
bfs is x
14
= 20, x
34
= 10, x
33
= 30, x
21
= 30, x
22
= 20, x
21
= 30, and x
11
= 15 and all others equal to
zero.
Remark: in the pivoting procedure we only perform additions and subtractions, thus we can guarantee that
the transportation problem will have an optimal solution in which all the variables are integers. Therefore,
the divisibility assumption is directly justied.
21
Now we are ready to perform Transportation Simplex.
1. Start with the initial bfs obtained using northwest corner method with BV ={x
11
, x
21
, x
22
, x
23
, x
33
, x
34
}
Figure 10: Initial bfs of the Powerco Problem
2. Which NBV should enter the basis? Find the most positive coecients of the NBV in row 0.
Drop the rst constraint (rst row, u
1
).
Calculate the row 0 coecient of every NBV, c
ij
= c
BV
B
1
a
ij
c
ij
by setting c
BV
B
1
a
ij
c
ij
=
0 for all BV (note that basic variable shall have coecient one in one row and zero in the other
rows including row zero) to nd the c
BV
B
1
=
_
u
2
u
3
v
1
v
2
v
3
v
4

where u corresponds
to row and v corresponds to column number.
c
11
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
0
0
1
0
0
0
_

_
8 = v
1
8 = 0
a
ij
consists of u
i
and v
j
. Thus, the result of c
BV
B
1
a
ij
c
ij
will be u
i
+ v
j
c
ij
. Consid-
ering u
1
is dropped (rst constraint), we are left with v
j
c
ij
= v
1
8.
c
21
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
1
0
1
0
0
0
_

_
9 = u
2
+ v
1
9 = 0
c
22
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
1
0
0
1
0
0
_

_
12 = u
2
+ v
2
12 = 0
c
23
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
1
0
0
0
1
0
_

_
13 = u
2
+ v
3
13 = 0
22
c
33
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
0
1
0
0
1
0
_

_
16 = u
3
+ v
3
16 = 0
c
34
=
_
u
2
u
3
v
1
v
2
v
3
v
4

_
0
1
0
0
0
1
_

_
5 = u
3
+ v
4
5 = 0
From the above equations, we can conclude that for each basic variable x
ij
except those hav-
ing i = 1, the equation is reduced to c
ij
= u
i
+ v
j
.
To generalize it, dene u
1
= 0, we get u
i
+v
j
= c
ij
for all BV.
u
1
= 0; u
1
+ v
1
= 8; u
2
+ v
1
= 9; u
2
+ v
3
= 13
u
3
+ v
3
= 16; u
3
+ v
4
= 5; u
2
+ v
2
= 12
Solve the above quations to get: u
1
= 0, v
1
= 8, u
2
= 1, v
2
= 11, v
3
= 12, u
3
= 4, v
4
= 1.
Given the us and vs, nd the row 0 coecient for the NBV = {x
12
, x
13
, x
14
, x
24
, x
31
, x
32
}
c
12
= u
1
+ v
2
c
12
= 0 + 11 6 = 5, c
13
= u
1
+ v
3
c
13
= 0 + 12 10 = 2
c
14
= u
1
+ v
4
c
14
= 0 + 1 9 = 8, c
24
= u
2
+ v
4
c
24
= 1 + 1 7 = 5
c
31
= u
3
+ v
1
c
31
= 4 + 8 14 = 2, c
32
= u
3
+ v
2
c
32
= 4 + 11 9 = 6
Considering this is a minimization problem, nd the most positive value, x
32
as the entering
variable. Each unit of x
32
that is entered into the basis will decrease Powercos cost by $6.
3. Which BV should leave the basis?
The entering variable is x
32
, the loop involving x
32
and some of the basic variables is (3, 2)
0

(2, 2)
1
(2, 3)
2
(3, 3)
3
where the subscript represents the cell number and can be seen in the
transportation tableau below.
The odd cells are (2, 2) or x
22
= 20 and (3, 3) or x
33
= 10. Variable with the smallest value leaves
the basis, thus in this case, x
33
, leaves the basis.
4. Perform pivoting by reducing all odd cells by 10 and adding 10 to the even cells which results the
following tableau:
23
5. Is the current basis optimal? Optimal if all row 0 coecients of the NBV are all negative (minimization
problem).
BV = {x
11
, x
21
, x
22
, x
23
, x
32
, x
34
}
Find the u
i
s and v
j
s and dene u
1
= 0:
u
1
= 0, u
1
+ v
1
= 8, u
2
+ v
1
= 9, u
2
+ v
2
= 12
u
2
+ v
3
= 13, u
3
+ v
2
= 9, u
3
+ v
4
= 5
Solve the equation above to get:
u
1
= 0, v
1
= 8, u
2
= 1, v
2
= 11, v
3
= 12, u
3
= 2, v
4
= 7
NBV = {x
12
, x
13
, x
14
, x
24
, x
31
, x
33
}
Find its row 0 coecient:
c
12
= u
1
+ v
2
c
12
= 0 + 11 6 = 5, c
13
= u
1
+ v
3
c
13
= 0 + 12 10 = 2
c
14
= u
1
+ v
4
c
14
= 0 + 1 9 = 8, c
24
= u
2
+ v
4
c
24
= 1 + 7 7 = 1
c
31
= u
3
+ v
1
c
31
= 2 + 8 14 = 8, c
33
= u
3
+ v
3
c
33
= 2 + 11 16 = 7
Again, because this is a minimization problem, choose variable with the most positive value, x
12
,
as the entering variable. Each unit of x
12
enters the basis will decrease Powercos cost by $5.
6. Which BV should leave the basis?
The entering variable is x
12
, the loop involving x
12
and some of the basic variables is (1, 2)
0

(2, 2)
1
(2, 1)
2
(1, 1)
3
where the subscript represents the cell number and can be seen in the
transportation tableau below.
The odd cells are (2, 2) or x
22
= 10 and (3, 3) or x
11
= 35. Variable with the smallest value leaves
the basis, thus in this case, x
22
, leaves the basis.
7. Perform pivoting by reducing all odd cells by 10 and adding 10 to the even cells which results the
following tableau:
24
8. Is the current basis optimal? Optimal if all row 0 coecients of the NBV are all negative (minimization
problem).
BV = {x
11
, x
12
, x
21
, x
23
, x
32
, x
34
}
Find the u
i
s and v
j
s and dene u
1
= 0:
u
1
= 0, u
1
+ v
1
= 8, u
2
+ v
1
= 9, u
1
+ v
2
= 6
u
2
+ v
3
= 13, u
3
+ v
2
= 9, u
3
+ v
4
= 5
Solve the equation above to get:
u
1
= 0, v
1
= 8, u
2
= 1, v
2
= 6, v
3
= 12, u
3
= 3, v
4
= 2
NBV = {x
13
, x
14
, x
22
, x
24
, x
31
, x
33
}
Find its row 0 coecient:
c
13
= u
1
+ v
3
c
13
= 0 + 12 10 = 2, c
14
= u
1
+ v
4
c
14
= 0 + 2 9 = 7
c
22
= u
2
+ v
2
c
22
= 1 + 6 12 = 5, c
24
= u
2
+ v
4
c
24
= 1 + 2 7 = 4
c
31
= u
3
+ v
1
c
31
= 3 + 8 14 = 3, c
33
= u
3
+ v
3
c
33
= 3 + 12 16 = 1
Because this is a minimization problem, choose variable with the most positive value, x
13
, as the
entering variable. Each unit of x
13
enters the basis will decrease Powercos cost by $2.
9. Which BV should leave the basis?
The entering variable is x
13
, the loop involving x
13
and some of the basic variables is (1, 3)
0

(2, 3)
1
(2, 1)
2
(1, 1)
3
where the subscript represents the cell number and can be seen in the
transportation tableau below.
The odd cells are (2, 3) or x
23
= 30 and (1, 1) or x
11
= 25. Variable with the smallest value leaves
the basis, thus in this case, x
11
, leaves the basis.
10. Perform pivoting by reducing all odd cells by 25 and adding 25 to the even cells which results the
following tableau:
25
11. Is the current basis optimal? Optimal if all row 0 coecients of the NBV are all negative (minimization
problem).
BV = {x
12
, x
13
, x
21
, x
23
, x
32
, x
34
}
Find the u
i
s and v
j
s and dene u
1
= 0:
u
1
= 0, u
1
+ v
2
= 6, u
1
+ v
3
= 10, u
2
+ v
1
= 9
u
2
+ v
3
= 13, u
3
+ v
2
= 9, u
3
+ v
4
= 5
Solve the equation above to get:
u
1
= 0, v
2
= 6, u
2
= 3, v
1
= 6, v
3
= 10, u
3
= 3, v
4
= 2
NBV = {x
11
, x
14
, x
22
, x
24
, x
31
, x
33
}
Find its row 0 coecient:
c
11
= u
1
+ v
1
c
11
= 0 + 6 8 = 2, c
14
= u
1
+ v
4
c
14
= 0 + 2 9 = 7
c
22
= u
2
+ v
2
c
22
= 3 + 6 12 = 3, c
24
= u
2
+ v
4
c
24
= 3 + 2 7 = 2
c
31
= u
3
+ v
1
c
31
= 3 + 6 14 = 5, c
33
= u
3
+ v
3
c
33
= 3 + 10 16 = 3
Since all row 0 coecients of the NBV are negative, we have found the optimal solution:
x
12
= 10, x
13
= 25, x
21
= 45, x
23
= 5, x
32
= 10, and x
34
= 30 with z = 1020.
1.1.5 Sensitivity Analysis of Transportation Problem
Changing the Objective Function Coecient of an NBV
Remark: As long as the coecient of NBV, x
ij
, in the optimal row 0 is nonpositive (minimization problem),
the current basis remains optimal.
Lets revisit Powerco problem. For what range of values of the cost of shipping 1 million kWh of elec-
tricity from plant 1 to city 1 will the current basis remain optimal? Dene c
11
= 8 + . c
11
in the optimal
tableau is equivalent to u
1
+v
1
c
11
= 0 +6 (8 +) = 2 in which it should be 0. Thus, 2 ,
or it can be stated that c
11
8 2 = 6 for the basis to remain optimal.
Changing the Objective Function Coecient of a BV
Remark: As long as the coecient of all NBV, x
ij
, in the optimal row 0 is nonpositive (minimization
problem), the current basis remains optimal. Note that, we need to nd the new duals and use these values
to price out all NBV.
26
Lets revisit Powerco problem. For what range of values of the cost of shipping 1 million kWh of electricity
from plant 1 to city 3 will the current basis remain optimal? Dene c
13
= 10 + . First, nd the u
i
s and
v
j
s of the optimal tableau and dene u
1
= 0:
u
1
= 0, u
1
+ v
2
= 6, u
1
+ v
3
= 10 + , u
2
+ v
1
= 9
u
2
+ v
3
= 13, u
3
+ v
2
= 9, u
3
+ v
4
= 5
Solve the equation above, we get:
u
1
= 0, v
2
= 6, u
2
= 3 , v
1
= 6 + , v
3
= 10 + , u
3
= 3, v
4
= 2
Now, price out each NBV (row 0 coecients) = {x
11
, x
14
, x
22
, x
24
, x
31
, x
33
}. All row 0 coecients should
be nonpositive so the current basis remain optimal:
c
11
= u
1
+ v
1
c
11
= 0 + (6 + ) 8 = 2 + for 2
c
14
= u
1
+ v
4
c
14
= 0 + 2 9 = 7
c
22
= u
2
+ v
2
c
22
= (3 ) + 6 12 = 3 for 3
c
24
= u
2
+ v
4
c
24
= (3 ) + 2 7 = 2 for 2
c
31
= u
3
+ v
1
c
31
= 3 + (6 + ) 14 = 5 + for 5
c
33
= u
3
+ v
3
c
33
= 3 + (10 + ) 16 = 3 + for 3
Thus, the current basis remain optimal for 2 2 or 8 c
13
12.
Increase a Single Supply by and a Single Demand by
Why not increase only the supply or only the demand? We need to ensure the changes will not make
the transportation problem becomes imbalance.
Remark: an increase in the rhs equals to an increase in the dual. Thus, if the current basis remains optimal,
the new z-value = old z-value +u
i
+ v
j
.
There are two possibilities:
If x
ij
is a BV in the optimal solution then increase x
ij
by
If x
ij
is an NBV in the optimal solution,
Find the loop involving x
ij
and some of the BV
Find an odd cell in the loop that is in row i
Increase the value of this odd cell by and go around the loop, alternately increasing and then
decreasing current basic variables in the loop by
For illustration, lets revisit Powerco problem:
Case 1: suppose we want to increase s
1
and d
2
by 2. x
12
is basic variable, thus the new z-value
= 1020 + 2u
1
+ 2v
2
= 1032.
Case 2: suppose we want to increase both s
1
and d
1
by 1. x
12
is NBV,
Find the loop involving x
11
: (1, 1) (1, 3) (2, 3) (2, 1).
Find an odd cell in the loop that is in row 1 which is cell (1, 3). Increase its value by 1 and go
around the loop, alternately increasing and decreasing current BV in the loop by 1 to get the
following transportation tableau:
27
Figure 11: Powerco: Finding the Loop involving the x
11
Figure 12: Powerco: Increasing and Decreasing Current BV in the Loop
The optimal solution is found to be z = 1020 + u
1
+ v
1
= 1026.
What if we decided to increase both s
1
and d
1
by 6? The current basis would be infeasible, why?
Because x
23
< 0.
1.2 Case 02: Assignment Problem
Assignment problem is a more specic type of transportation problem and integer programming.
Characteristics of an assignment problem:
Balanced transportation problem
All supplies and demands are equal to 1
One-to-one function
All decision variables are binary
1.2.1 Machine Assignment Problem, Winston p. 393
Machineco has four machines and four jobs to be completed. Each machine must be assigned to complete
one job. The time required to set up each machine for completing each job is shown below. Machineco wants
to minimize the total setup time needed to complete the four jobs. Use linear programming to solve this
problem.
28
Time (hrs)
Machine Job 1 Job 2 Job 3 Job 4
1 14 5 8 7
2 2 12 6 5
3 7 8 3 9
4 2 4 6 10
Let i = machine number ={1, 2, 3, 4}
j = job number ={1, 2, 3, 4}
t
ij
= time (hours) required to nish job j using machine i = {14, 5, 8, 7, 2, . . . , 6, 10}
Decision variables:
x
ij
=
_
1 if machine i is assigned to do job j
0 otherwise
min z =
4

i=1
4

j=1
t
ij
x
ik
s.t.
4

i=1
x
ij
= 1, j (job constraints)
4

j=1
x
ij
= 1, i (machine constraints)
x
ij
= BIN, i, j
See the table below for the assignment problems matrix of costs which is commonly called as cost matrix.
Solving the assignment problem using transportation simplex often is inecient because it incurs a lot
of degeneracy due to the limitation to the decision variables must be a binary.
1.2.2 Brute-Force Algorithm
This algorithm solves the assignment problem by generating all independent sets of the matrix C, computing
the total costs of each assignment and a search of all assignment to nd a minimal-sum independent set.
Its complexity is driven by the number of independent assignments possible in an n x n matrix. There are
n choices for the rst assignment, n 1 choices for the second assignment and so on, giving n! possible
assignment sets (an exponential runtime complexity). Note that in this algorithm each assignment is chosen,
thus row and column are eliminated from consideration. The question is raised as to whether there is a
better algorithm which can reduce this complexity. In fact there exists a polynomial runtime complexity
algorithm.
29
1.2.3 Hungarian Method
For minimization problem:
1. Construct new matrix (reduced cost matrix) by:
Find the minimum element in each row of the m x m cost matrix
Subtracting from each cost the minimum cost in its row
Find the minimum element in each column of the new matrix
Subtracting from each cost the minimum cost in its column
2. Draw the minimum number of lines (horizontal, vertical, or both) that are needed to cover all the
zeroes in the reduced cost matrix
If m lines are required, optimal solution is available among the covered zeroes in the matrix
If < m lines are required, then go to step 3
3. Find the smallest nonzero element, k, in the reduced cost matrix that is uncovered by the lines drawn
in step 2. Subtract k from each uncovered element of the reduced cost matrix and add k to each
element that is covered by two lines. Return to step 2
Why can Hungarian method yield an optimal solution?
If a constant is added to each cost in a row (or column) of a balanced transportation problem, then
the optimal solution to the problem is unchanged
It ensures all cost remain non-negative by adding and subtracting the minimum value
Optimal when m lines are required to cover all zeroes in the cost matrix because each one can only be
assigned to one of the other set (one-on-one function)
Now, lets solve the Machineco problem using Hungarian method:
Find the minimum cost for each row and subtract from each cost the minimum cost in its row:
Find the minimum cost for each column and subtract from each cost the minimum cost in its column
to get the following reduced cost matrix:
30
Find the minimum number of lines to cover all zeroes. Min number of lines is found to be 3 which is
less than m = 4. Thus, the current reduced cost matrix is not optimum.
Find the minimum value of uncovered cells (value = 1) and subtract all uncovered cells by this value
(1), add this value(1) to the intersected cells:
Again, nd the minimum number of lines to cover all zeroes. Min number of lines = 4 = m, thus we
can conclude that the current reduced cost matrix is optimal.
Thus, the assignment is as follows (machine, job)(4, 1), (3, 3), (2, 4), (1, 2)
31
If we nd the minimum of each column rst then the minimum of each row, will it lead to the same optimal
solution? Yes, it will.
Find the minimum cost for each column and subtract from each cost the minimum cost in its column
to get the following reduced cost matrix:
Find the minimum cost for each row and subtract from each cost the minimum cost in its row:
Find the minimum number of lines to cover all zeroes. Min number of lines = 4 = m, thus we can
conclude that the current reduced cost matrix is optimal.
Thus, the assignment is as follows (machine, job)(3, 3), (2, 4), (4, 1), (1, 2)
Remarks:
For a maximization problem, either create an opportunity loss matrix subtracting all prots for each
job from the maximum p rot for that job or multiply the prot matrix by 1, and then solve it as a
minimization problem
32
If the number of workers does not equal the number of jobs, add dummy workers/jobs with 0 assignment
costs as needed
If worker i cannot do job j, assign c
ij
= +M
1.2.4 Real Estate Assignment Problem
An investor pays his contractors a xed fee plus mileage for work performed. On a given day the investor is
faced with three construction jobs. The distances between the contractors and the construction projects are
given in the table below. How should the contractors be assigned to minimize total costs?
Note: There are four subcontractors and three projects.
Construction Project
Contractor Peachtree Apartment Technology Square Fernwood Resort
Home Improvement 50 36 16
Atlanta Contractor 28 30 18
Rickys Roong 35 32 20
Healey Contractor 25 25 14
Because it is not a balanced transportation problem, we have to create a dummy construction project,
dummy, which will be assigned to one contractor (i.e. that contractor will remain idle). See gure 1.2.4 for
the balanced network representation of this problem.
Figure 13: Network of Real Estate Assignment Problem
The initial tableau of the transportation problem can be seen as follow. Note that Hungarian algorithm
requires m x m matrix (number of rows = number of columns), thus add a dummy column with value of
zero (why zero?).
33
Contractor Peachtree Tech Square Fernwood Dummy
Home 50 36 16 0
Atlanta 28 30 18 0
Ricky 35 32 20 0
Healey 25 25 14 0
Now, lets begin Hungarian algorithm to solve the contractor problem:
The rst step is to nd the minimum cost for each row and subtract from each cost the minimum cost
in its row. Since each row has a zero, we simply move to the next step, nd the minimum cost for each
column and subtract from each cost the minimum cost in its column to get the following reduced cost
matrix:
Find the minimum number of lines to cover all zeroes. Min number of lines is 2 < m, meaning the
current reduced cost matrix is not optimum. Find the minimum uncovered cell (value = 2) and subtract
all uncovered cells by this value (2) and add this value (2) to intersected cells:
Contractor Peachtree Tech Square Fernwood Dummy
Home 23 9 0 0
Atlanta 1 3 2 0
Ricky 8 5 4 0
Healey 0 0 0 2
Find the minimum number of lines to cover all zeroes. Min number of lines is 3 < m = 4, meaning the
current reduced cost matrix is not optimum.
Find the minimum uncovered cell (value = 1) and subtract all uncovered cells by this value (1) and
add this value (1) to intersected cells:
34
Contractor Peachtree Tech Square Fernwood Dummy
Home 23 9 0 1
Atlanta 0 2 1 0
Ricky 7 4 3 0
Healey 0 0 0 3
Find the minimum number of lines to cover all zeroes. Min number of lines = 4 = m, thus we can
conclude that the current reduced cost matrix is optimal.
Thus, the assignment is as follows HealeyTech Square (distance = 25), RickyDummy, Atlanta
Peachtree (distance = 28), HomeFernwood (distance = 16) with the total distance of 69.
1.3 Case 02: Transshipment Problem
Transshipment point by denition is a point through which goods can be transshipped on their journey from
a supply point to a demand point.
Denition:
Supply point: a point that can send goods only
Demand point: a point that can receive goods only
Transshipment point: a point that can both send and/or receive goods
1.3.1 Widgetco,Winston p. 400
Widgetco manufactures widgets at two factories: in Memphis and Denver. The Memphis factory can produce
as many as 150 widgets per day, 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 to rst y some widgets to
NY or Chicago and then y them to their nal destinations. The costs of ying a widget are shown below.
Widgetco wants to minimize the total cost of shipping the required widgets to its customers (this seems like
a logistic problem)
To
From Memphis Denver NY Chicago LA Boston
Memphis 0 - 8 13 25 28
Denver - 0 15 12 26 25
NY - - 0 6 16 17
Chicago - - - 0 14 16
LA - - - - 0 -
Boston - - - - - 0
35
How to nd the optimal solution for this transshipment problem?
First, given a transshipment problem, we create a balanced transportation problem. For this particular
problem,

supply = 150+200 = 350 does not equal to

demand = 130+130 = 260. Add a dummy


demand with the amount of 90 and shipping cost of 0 to balance the problem.
The cost to ship NYNY and ChicagoChicago equals to zero because there is no cost to fulll NY
demand using NY supply and similarly for Chicago.
Construct the transportation tableau with transshipment points supply equals to (points original
supply) + (total available supply) and a demand equals to (points original demand) + s.
The optimal solution is found to be:
36
Memphis can fulll LA demand in two ways: direct shipment (MemphisLA) or through transshipment
point (MemphisNYLA) with the associated cost as follows 25 and 8 + 16 = 24, respectively. The
minimum cost is through NY, the transshipment point, thus we choose to ship 130 units (supply =
150, demand = 130) using the following route: MemphisNYLA.
Denver can fulll LA demand in two ways: direct shipment (DenverBoston) or through transshipment
point (DenverChicagoBoston) with the associated cost as follows 25 and 12 +16 = 28, respectively.
The minimum cost is direct shipment, thus we choose to ship 130 units (supply = 200, demand = 130)
using the following route: DenverBoston.
Considering all demand are fullled, the remaining available units from supply will be used to fulll
the dummy demand. Now, we need to ensure the balance (supply and demand) for each transshipment
point. Because NY use only 130 units of its supply to fulll LA, the remaining amount (350130 = 220)
shall be assigned in NYNY cell because it will incur zero cost. Apply the same logic for the Chicago
transshipment point to get the ChicagoChicago cell value equals to 350.
1.4 Case 03: Shortest Path Problems
Goal: seek a path with minimum length between specied pairs of nodes in a network. There are many
variations, depending on the type of network and costs involved, and the pairs of nodes for which the solution
needs to be found.
1.4.1 Equipment Replacement,Winston p. 415
I have just purchased (at time 0) a new car for $12,000. The cost of maintaining a car during a year depends
on its age at the beginning of the year, as given in table below. To avoid the high maintenance costs
associated with an older car, I may trade in my car and purchase a new car. The price I receive on a trade-in
depends on the age of the car at the time of trade-in (see the table below). To simplify the computations,
we assume that at any time, it costs $12,000 to purchase a new car. My goal is to minimize the net cost
incurred during the next ve years. Formulate this problem as a shortest path problem.
Age of car (years) Annual Maintenance Cost ($) Trade=in Price
0 2,000 -
1 4,000 7,000
2 5,000 6,000
3 9,000 2,000
4 12,000 1,000
5 - 0
The network can be seen as follow in which node i = keep the car for i year(s):
37
Dene c
ij
= the cost of purchasing a new car in year i and keep in until the beginning of year j. Now
calculate its cost (purchasing + maintenance trade-in price):
c
01
= 12, 000 + 2, 000 7, 000 = 7, 000 (similarly for c
12
= c
23
= c
34
= c
45
)
c
02
= 12, 000 + (2, 000 + 4, 000) 6, 000 = 12, 000 (similarly for c
13
= c
24
= c
35
)
c
03
= 12, 000 + (2, 000 + 4, 000 + 5, 000) 2, 000 = 21, 000 (similarly for c
14
= c
25
)
c
04
= 12, 000 + (2, 000 + 4, 000 + 5, 000 + 9, 000) 1, 000 = 31, 000 (similar to c
15
)
c
05
= 12, 000 + (2, 000 + 4, 000 + 5, 000 + 9, 000 + 12, 000) 0 = 44, 000
The optimal solution can easily be found as 0 2 5.
1.4.2 Djikstras Algorithm
This algorithm can be used to nd the shortest path from a node to all other nodes with the main assumption
that all arc lengths are nonnegative. Below is the procedure of Djikstras Algorithm:
1. Find the shortest path from a node to all other nodes
2. Label the rst node with a permanent label of 0
3. Label each node i that is connected to the rst node by a single arc with a temporary label equals
to the length of the arc joining the rst node to node i. Each other node which is not connected will
have a temporary label of .
Suppose that node i just become the (k +1)
th
node to be given a permanent label. Then node i is the
k
th
closest node to node 1. At this point, the temporary label of any node,i

is the length of the short-


est path from node 1 to i

that passes only through nodes contained in the k1 closest nodes to node 1.
For each node j that now has a temporary label and is connected to node i by an arc, replace node ks
temporary label by
min =
_
node js current temporary label
node ith permanent label + length of arc (i, j)
4. Choose the node with the smallest temporary label and make this label permanent
5. Repeat until the rst node is connected to the last node
6. To nd the shortest path from node 1 to node j, work backward from node j by nding nodes having
permanent labels diering by exactly the length of the connecting arc
1.4.3 Powerco Example, Winston p. 414
Suppose that when power is sent from plant 1 (node 1) to city (node 6), it must pass through relay substations
(nodes 2-5). For any pair of nodes between which power can be transported, the distance (in miles) between
the nodes are show in Figure 14. Powerco wants the power sent from plant 1 to city 1 to travel the minimum
possible distance.
Find the shortest path from node 1 to all other nodes:
[0

4 3 ]
38
Figure 14: Powerco Network
Node 3 has the smallest temporary label, thus make node 3s label permanent and update the other
nodes temporary label for all nodes that are connected to node 3 by a single arc to obtain the following
labels:
[0

4 3

6 ]
Note that we update node 5 only because it is the only node connected directly from node 3. Update
the temporary label of node 5
= min {current temporary label of node 5, permanent label of node 3 + length of arc (3,5)}
= min {, 3 + 3} = 6
Node 2 has the smallest temporary label, thus make node 2s label permanent and update the other
nodes temporary label for all nodes that are connected to node 2 by a single arc to obtain the following
labels:
[0

7 6 ]
Note that we update node 4 and 5 because these are the two nodes connected directly from node 2.
Update the temporary label of node 4 = min {, 4 + 3} = 7 and node 5 = min {6, 4 + 2} = 6
Repeat the steps for the remaining nodes. Djikstras algorithm used to solve this Powerco problem can
be summarized in the following table:
Node 1 2 3 4 5 6
1 0* 4 3
3 0* 4 3* min {3 + 3} = 6
2 0* 4* 3* 4 + 3 = 7 min {6, 4 + 2} = 6
5 0* 4* 3* 7 6* min {, 6 + 2} = 8
4 0* 4* 3* 7* 6* min {8, 7 + 2} = 8
6 0* 4* 3* 7* 6* 8*
Backtrack to nd the path (nd nodes having labels dierence by exactly the length of the connecting
arc). We get the following paths: 6 5 3 1 or 6 5 2 1
Remark: the number of iteration equals to the number nodes.
39
1.4.4 Bellman-Form Algorithm: Repeated Evaluation Algorithm
The main issue in designing shortest path algorithms is how to compute functional equation solutions e-
ciently. Diculty comes from the existance of dicycle in the network. Dicycles introduce circular depen-
dencies in functional equations that preclude their solution by one-pass evaluation, even if the length of all
dicycles is nonnegative.
The notion of this algorithm is every major iteration of the search evlauates the functional equation for
using results from the preceding iteration. Stop only when no result changes.
Steps:
1. Find the shortest paths from a source to all possible destinations using only one link
2. Then using maximum two links by adding appropriate links to the paths of step 1
3. Then using maximum 3 links on top of paths with two links
4. So on until no improvement is gained by adding more links
40

You might also like