END 395 Lecture 5 Handout
END 395 Lecture 5 Handout
LECTURE 5 HANDOUT
EX1. A compressor company has plants in three locations: Cleveland, Chicago, and Boston.
During the past week the total production of a special compressor unit out of each plant has been
35, 50, and 40 units, respectively. The company wants to ship 45 units to a distribution center
(DC) in Dallas, 20 to Atlanta, 30 to San Francisco, and 30 to Philadelphia. The unit production
and distribution costs from each plant to each DC are given in the following table. What is the
best strategy to follows?
Distribution Centers (DCs) Available units
Plants 1 2 3 4 (Supply)
1 8 6 10 9 35
2 9 12 13 7 50
3 14 9 16 5 40
Requirement units 45 20 30 30
(Demand)
Table 1. Unit production and shipping costs
Transportation Simplex
1. Balance the problem.
2. Find an initial basic feasible solution using a heuristic approach, for example with
northwest corner rule.
3. Note that in the optimal solution of a minimization problem, the reduced cost (i.e. row-0
coefficient of 𝑥𝑖𝑗 ) 𝑐̅ᵢⱼ = 0 for all basic variables and 𝑐̅𝑖𝑗 ≤ 0 for all non-basic variables.
For all basic variables use 𝑐̅𝑖𝑗 = 𝑢ᵢ + 𝑣ⱼ − 𝑐𝑖𝑗 = 0 to calculate 𝑢ᵢ and 𝑣ⱼ.
For all non-basic variables calculate 𝑐̅𝑖𝑗 = 𝑢ᵢ + 𝑣ⱼ − 𝑐𝑖𝑗 .
If 𝑐̅𝑖𝑗 ≤ 0, the current basic feasible solution is optimal. STOP.
Otherwise, choose the variable with the most positive 𝑐̅𝑖𝑗 as the entering variable.
4. Obtain a new basic feasible solution using loop pivoting, and go to step 3.
1
EX2. Machineco has 4 machines and 4 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 in
the following table. Machineco wants to minimize the total setup time needed to complete the four
jobs. Use linear programming to solve this problem.
Jobs
Machine 1 2 3 4
1 14 5 8 7
2 2 12 6 5
3 7 8 3 9
4 2 4 6 10
Table 2. Setup times for Machineco
Hungarian Method
Step 1. Find the minimum element in each row of the 𝑚𝑥𝑚 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 each column. Construct a new matrix
(called the reduced cost matrix) by subtracting from each cost the minimum cost in its
column.
Step 2. Draw the minimum number of lines (horizontal, vertical, or both) that are needed to
cover all the zeros in the reduced cost matrix.
If 𝑚 lines are required, then an optimal solution is available among the covered zeros in
the matrix. STOP.
If fewer than 𝑚 lines are needed, then proceed to step 3.
Step 3. Find the smallest nonzero element (call its value 𝑘) in the reduced cost matrix that is
uncovered by the lines drawn in step 2. Subtract 𝑘 from each uncovered element of the
reduced cost matrix and add 𝑘 to each element that is covered by two lines.
Return to step 2.
2
EX3. Assignment problem with a maximization objective:
A pharmaceutical company has 4 branches, one each at city A, B, C, and D. A branch manager has
to be assigned to each city, out of 4 candidates 1, 2, 3, and 4. The monthly business depends upon
the city and the effectiveness of the branch manager in that city. The following table provides the
estimated amount of monthly business for each branch manager at each city. “-”s in the table
indicate that the corresponding manager cannot be assigned to the corresponding city. Which
manager should be assigned to which city so as to get the maximum total monthly business.
City
Branch Manager A B C D
1 10 12 5 8
2 15 9 - 17
3 6 3 10 5
4 - 8 7 12
Table 3. Estimated amount of monthly business for each branch manager at each city
3
EX5. Transshipment Problem
Two car plants, P1 and P1, are linked to three dealers, D1, D2, and D3 through using two transit
centers, T1 and T2, according to the network shown below. The supply amounts at plants P1 and
P2 are 1000 and 1200 cars, respectively, and the demand amounts at dealers D1, D2, and D3, are
800, 900, and 500 cars, respectively. The shipping costs per car (in hundreds of dollars) between
pairs of nodes are shown on the connecting links (or arcs) of the network. The existence of arrows
between two nodes means that transporting cars between these two nodes is permissible including
the possibility of transporting between dealers or transit centers. Find the optimal solution that
minimizes the total cost and meets the demand.
1
1 3
10
2 9
3 6
0 4
7
2 4
2
4
The pseudocode of Dijkstra’s Algorithm