Professional Documents
Culture Documents
9 Formulation
m n
Min Z = c
i =1 j =1
ij xij
n
S.T. x
j =1
ij = s i , for i = 1, 2, , m
x
i =1
ij = d j , for j = 1, 2, , n
m n
In order to guarantee si = d j , we need a dummy destination to consume
i =1 j =1
9 If only one row or only one column remains under consideration, the procedure
is completed by selecting every remaining variable associated with that row or
column to be basic with the only feasible allocation. Otherwise, go back to the
first step.
Criteria one: Northwest corner rule
9 Begin with x11 (starting from the northwest corner).
9 If xi,j was the last basic variable selected, then next select xi,j+1 (move one
column to the right) if source i has any supply remaining.
9 Otherwise, next select xi+1,j (move one row down).
9 An Example (the distribution of water resources example)
Destination Supply ui
1 2 3 4 5
1 16 16 13 22 17 50
s
o 2 14 14 13 19 15 60
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 50
Demand 30 20 70 30 60 Z=
vj
Demand 30 20 70 30 60
Column diff.
Destination Row
1 2 3 4 5 Supply diff.
1 16 16 13 22 17 50
s
o 2 14 14 13 19 15 60
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 20
Demand 30 20 70 0 60
Column diff.
Destination Row
1 2 3 4 5 Supply diff.
1 16 16 13 22 17 50
s
o 2 14 14 13 19 15 60
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 0
Demand 30 20 70 0 40
Column diff.
Destination Row
1 2 3 4 5 Supply diff.
1 16 16 13 22 17 0
s
o 2 14 14 13 19 15 60
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 0
Demand 30 20 20 0 40
Column diff.
Destination Row
1 2 3 4 5 Supply diff.
1 16 16 13 22 17 0
s
o 2 14 14 13 19 15 20
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 0
Demand 30 20 20 0 0
Column diff.
Destination Row
1 2 3 4 5 Supply diff.
1 16 16 13 22 17 0
s
o 2 14 14 13 19 15 0
u
r 3 19 19 20 23 M 50
c
e 4(D) M 0 M 0 0 0
Demand 30 20 0 0 0
Column diff.
Demand 30 20 70 30 60
vj
1 22 19 M M M 19 M 23 M 45 = 2M x45=50
2 22 19 M 19 19 29 23 M 15 = 5M x15=10
3 22 19 M 19 19 29 23 13 = 29 x13=40
4 19 23 19 19 29 23 23 = 26 x23=30
5 19 23 19 19 23 21 = 24 x21=30
6 irrelevant x31=0
x32=20
x34=30
Z=2570
9 After obtaining ui and vj, calculate the value of cij-ui-vj for each nonbasic
variable.
Step 1 for an iteration transportation simplex (find the entering variable)
9 Since cij-ui-vj represents coefficients of nonbasic variables in row 0, the
entering basic variable must have a negative cij-ui-vj.
9 To choose between the candidates, select the one having the larger (in absolute
terms) negative value of cij-ui-vj.
9 Pick as the entering variable in this example.
Destination Supply ui
1 2 3 4 5
1 16 16 13 22 17 50 5
s +2 +2 40 +4 10
o 2 14 14 13 19 15 60 5
u 30 0 30 +1 2
r 3 19 19 20 23 M 50 0
c 0 20 +2 30 M22
e 4(D) M 0 M 0 0 50 22
M+3 +3 M+4 1 50
Demand 30 20 70 30 60 Z=2,570
vj 19 19 18 23 22
Step 2 for an iteration for transportation simplex (find the leaving variable)
9 Increasing the entering basic variable from zero sets off a chain reaction of
compensating changes in other basic variables, in order to continue satisfying
the supply and demand constraints.
9 The first basic variable to be decreased to zero then becomes the leaving basic
variable.
Destination
3 4 5 Supply
1 13 22 17
+
40 +4 10 -- 50
Source 2 13 19 15
--
30 +1 + 2 60
Demand 70 30 60
9 Cell (2, 5) and (1, 3) are the recipient cell (receiving allocation).
9 Cell (1, 5) and (2, 3) are the donor cell (giving allocation).
9 The donor cell that starts with the smallest allocation must reach zero first as the
entering basic variable is increased. So, is the leaving variable.
Step 3 for an iteration for transportation simplex (Find the new BF solution)
9 The new basic feasible solution is identified simply by adding the value of the
leaving basic variable to the allocation for each recipient cell and subtracting
this same amount from the allocation for each donor cell.
Destination Supply
3 4 5
1 13 22 17 50
50
Source 2 13 19 15 60
20 10
Demand 70 30 60
9 Iteration 2:
Destination Supply ui
1 2 3 4 5
1 16 16 13 22 17 50
s 50
o 2 14 14 13 19 15 60
u 20 40
r 3 19 19 20 23 M 50
c 30 20 0
e 4(D) M 0 M 0 0 50
30 20
Demand 30 20 70 30 60 Z=
vj
9 Iteration 3:
Destination Supply ui
1 2 3 4 5
1 16 16 13 22 17 50
s 50
o 2 14 14 13 19 15 60
u 20 40
r 3 19 19 20 23 M 50
c 30 20 0
e 4(D) M 0 M 0 0 50
30 20
Demand 30 20 70 30 60 Z=
vj
n
S.T. j =1
xij = 1 for i = 1, 2, , n
n
i =1
xij = 1 for j = 1, 2, , n
Plant 1 41 27 28 24 75
2 40 29 -- 23 75
3 37 30 27 21 45
Production rate 20 30 30 40
9 Option 1: Permit product splitting, where the same product can be produced in
more than one plant.
9 Option 2: Prohibit product splitting. Every plant should be assigned at lease one
of the products.
9 Formulation of option 1
Dummy demand = (75+75+45) (20+30+30+40) = 75.
Cost per Unit Distribution
Destination (Product) Supply
1 2 3 4
Source 1 41 27 28 24 75
(Plant) 2 40 29 M 23 75
3 37 30 27 21 45
Demand 20 30 30 40
The optimal solution is: x12=30, x13=30, x15=15, x24=15, x25=60, x31=20, and
x34=25. Total cost is $3,260.
9 Formulation of option 2
Each product must be assigned to just one plant.
One of the plants will need to be assigned two products.
By observation, plant 3 only has enough capacity to produce one product. So,
either plant 1 or plant 2 will take the extra product.
Plant 1 and 2 each are split into two assignees. Thus, there are five assignees.
A dummy task (product 5) needs to be introduced.
Notice that the cost entries are not the unit cost anymore. The cost cij is the
total cost associated with assignee i performing task j.
Example: total cost of assigning plant 1 to product 1
Task (Product)
1 2 3 4 5(D)
1a
Assignee 1b
(Plant) 2a
2b
3
The role of equivalent cost tables
9 We can add or subtract any constant from every element of a row or column of
the cost table without really changing the problem (i.e. the optimal solution
wont change).
The rationale of the Hungarian algorithm for the assignment problem
9 It converts the original cost table into a series of equivalent cost tables until it
reaches one where an optimal solution is obvious.
9 This final equivalent cost table is one consisting of only positive or zero
elements where all the assignments can be made to the zero element position.
9 Since the total cost cannot be negative, this set of assignments with a zero total
cost is clearly optimal.
Procedures of the Hungarian algorithm (part 1)
9 The algorithm begins by subtracting the smallest number in each row from
every number in the row.
9 This row reduction process will create an equivalent cost table that has a zero
element in every row.
9 If this cost table has any columns without a zero element, the next step is to
perform a column reduction process by subtracting the smallest number in each
such column from every number in the column.
9 Note that the individual rows and columns can be reduced in any order.
9 Our prototype example
1 2 3 4 1 2 3 4
1 13 16 12 11 1
2 15 M 13 20 2
3 5 7 10 6 3
4(D) 0 0 0 0 4(D)
1 2 3 4 5(D)
1a
1b
2a
2b
3
9 It now is possible to make four assignments to zero elements, but still not five
(Note that column 1 and 4 have only a single zero element and they both are in
the same row).
9 Repeat the same procedure to create more zeros.
9 Four lines (the same number as the maximum number of assignments) now are
the minimum needed to cover all zeros.
1 2 3 4 5(D)
1a 50 0 0 90 0
1b 50 0 0 90 0
2a 30 60 M 50 0
2b 30 60 M 50 0
3 0 120 0 0 M
9 The minimum element not covered by a line is again 30.
9 Subtract 30 from every uncovered element and add 30 to every doubly covered
element.
1 2 3 4 5(D)
1a
1b
2a
2b
3
9 This table actually has several ways of making a complete set of assignments to
zero element positions (several optimal solutions).
Summary of the Hungarian algorithm
9 Please refer to p. 362 of the text book.