QT HW1
QT HW1
Example 1.1
The Apex Television Company has to decide on the number of 27- and 20-inch
sets to be produced at one of its factories. Market research indicates that at most
40 of the 27-inch sets and 10 of the 20-inch sets can be sold per month. The
maximum number of work-hours available is 500 per month. A 27-inch set
requires 20 work-hours and a 20-inch set requires 10 work-hours. Each 27-inch set
sold produces a profit of $120 and each 20-inch set produces a profit of $80. A
wholesaler has agreed to purchase all the television sets produced if the numbers
do not exceed the maxima indicated by the market research.
Example 1.2
Dwight is an elementary school teacher who also raises pigs for supplemental
income. He is trying to decide what to feed his pigs. He is considering using a
combination of pig feeds available from local suppliers. He would like to feed the
pigs at minimum cost while also making sure each pig receives an adequate supply
of calories and vitamins. The cost, calorie content, and vitamin content of each feed
are given in the table below.
Contents Feed Type A Feed Type B
Calories (per pound) 800 1,000
Vitamins (per pound) 140 units 70 units
Cost (per pound) $0.40 $0.80
Each pig requires at least 8,000 calories per day and at least 700 units of vitamins.
A further constraint is that no more than one-third of the diet (by weight) can
consist of Feed Type A, since it contains an ingredient which is toxic if consumed in
too large a quantity.
(a) Formulate a linear programming model for this problem.
Let A and B be the quantity (pounds) of Feed Type A and Feed Type B,
respectively, used per day. Also let Z be the total daily cost of the feed per pig.
Then, the daily cost is
Z = $0.4 A + $0.8 B.
The constraints on the minimum daily requirements of calories and vitamins are
(b) Use the graphical method to solve this model. What is the resulting daily
cost per pig?
As shown below, the optimal solution is (A, B) = (20/7, 40/7). The resulting
daily cost per pig is Z = 40/7 = $5.71.
Example 1.3
A furniture store has set aside 800 square feet to display its sofas and chairs. Each
sofa utilizes 50 sq. ft. and each chair utilizes 30 sq. ft. At least five sofas and at least
five chairs are to be displayed.
a. Write a mathematical model representing the store's constraints.
b. Suppose the profit on sofas is $200 and on chairs is $100. On a given day, the
probability that a displayed sofa will be sold is .03 and that a displayed chair
will be sold is .05. Mathematically model each of the following objectives:
1. Maximize the total pieces of furniture displayed.
2. Maximize the total expected number of daily sales.
3. Maximize the total expected daily profit.
Solution:
Let s and c be the number of sofa and chair respectively.
a. 50s + 30c < 800
s> 5
c> 5
b. (1) Max s + c
(2) Max 0.03s + 0.05c
(3) Max 6s + 5c
Example 1.4
Maxwell Manufacturing makes two models of felt tip marking pens. Requirements
for each lot of pens are given below.
Fliptop Model Tiptop Model Available
Plastic 3 4 36
Ink Assembly 5 4 40
Molding Time 5 2 30
The profit for either model is $1000 per lot.
a. What is the linear programming model for this problem?
b. Find the optimal solution.
c. Will there be excess capacity in any resource?
Solution:
a. Let F = the number of lots of Fliptip pens to produce
Let T = the number of lots of Tiptop pens to produce
Max 1000F + 1000T
s.t. 3F + 4T < 36
5F + 4T < 40
5F + 2T < 30
F,T > 0
b.
15 T
10
0 F
0 5 10 15
The exact value of (x1, x2) for each of these corner-point solutions (A, B, ..., I)
can be identified by obtaining the simultaneous solution of the corresponding
two constraint boundary equations. The results are summarized as...
Corner-point
(x1, x2) Objective Value Z
feasible solutions
A (0, 5) 3*0+2*5 = 10
C (3, 4) 3*3+2*4 = 17
E (4, 2) 3*4+2*2 = 16
F (4, 0) 3*4+2*0 = 12
I (0, 0) 3*0+0*0 = 0
Since point C has the largest value of Z, (x1, x2) = (3, 4) must be an optimal
solution.
(c) Use the simplex method to get the solution and to identify which sequence of
CPF solutions would be examined by the simplex method to reach an
optimal solution.
Therefore, the sequence of CPF solutions examined by the simplex method would
be I → F→ E→ C.
Example 2.2
Consider the following linear programming model.
Maximize Z = x1 + 2x2,
subject to
6x1 - 2x2 ≤ 3
2x1 + 3x2 ≤ 6
x1 + x2 ≤ 3
and
x1 ≥ 0, x2 ≥ 0.
(a) Use graphical analysis to identify all the corner-point solutions for this model.
Label each as either feasible or infeasible.
(b) Calculate the value of the objective function for each of the CPF solutions. Use
this information to identify an optimal solution.
(c) Use the simplex method to get the solution and to identify which sequence of
CPF solutions would be examined by the simplex method to reach an optimal
solution.
Solution:
(a)
3
x1 + x2 = 3
6x1- 2x2 = 3
2
Feasible x1 + 2x2 =0
1
Region
2x1 + 3x2 = 6
0 x1
0 1 2 3
(a) (b)
corner-point feasibility obj. value
(0, 0) feasible 0
(0.5, 0) feasible 0.5
(21/22, 15/11) feasible 3.68
(0, 2) feasible 4
(c) 1st tableau
Max Cj 1 2 0 0 0
i cB xB x1 x2 sl1 sl2 sl3 bi i
1 cB1= 0 xB1= sl1 6 -2 1 0 0 3 -
2 cB2= 0 xB2= sl2 2 3 0 1 0 6 2
3 cB3= 0 xB3= sl3 1 1 0 0 1 3 3
fj 0 0 0 0 0 ∑icBibi= 0
Cj-fj 1 2 0 0 0
Management now wants to determine the most economic plan for shipping the iron
ore from the mines through the distribution network to the steel plant.
Example 3.2
Minimize f = -1x1 + 2x2 - 3x3 subject to
x 1 + x2 + x3 = 6
-1x1 + x2 + 2x3 = 4
2x2 + 3x3 = 10
x3 2
and x1, x2, x3 0
Find the optimal solution by big M and two phase methods.
Solution:
The first tableau of big M method:
Min Cj -1 2 -3 M M M 0
i cB xB x1 x2 x3 a1 a2 a3 s1 bi i
1 cB1= M xB1=a1 1 1 1 1 0 0 0 6
2 cB2= M xB2=a2 -1 1 2 0 1 0 0 4
3 cB3= M xB3=a3 0 2 3 0 0 1 0 10
4 cB4= 0 xB3=s1 0 0 1 0 0 0 1 2
fj 0 4M 6M M M M 0 ∑icBibi= 20M+2
Cj-fj -1 2-4M -3-6M 0 0 0 0
The first tableau of Phase I in two phase method:
Min C’j 0 0 0 1 1 1 0
i cB xB x1 x2 x3 a1 a2 a3 s1 bi i
1 cB1= 1 xB1=a1 1 1 1 1 0 0 0 6 6
2 cB2= 1 xB2=a2 -1 1 2 0 1 0 0 4 2
3 cB3= 1 xB3=a3 0 2 3 0 0 1 0 10 10/3
4 cB4= 0 xB3=s1 0 0 1 0 0 0 1 2 2
f’j 0 4 6 1 1 1 0 ∑icBibi= 20
C’j-f’j 0 -4 -6 0 0 0 0
C’j-f’j 0 0 0 2 2 0 0
**extra constraint
The first & also final tableau of Phase II in two phase method:
Min Cj -1 2 -3 0
i cB xB x1 x2 x3 s1 bi i
1 cB1= -1 xB1=x1 1 0 0 1/2 2
2 cB2= 2 xB2=x2 0 1 0 -3/2 2
4 cB4= -3 xB3=x3 0 0 1 1 2
fj -1 2 -3 -7/2 ∑icBibi= -4
Cj-fj 0 0 0 7/2
Example 3.3
A&C Distributors is a company that represents many outdoor products companies and
schedules deliveries to discount stores, garden centers, and hardware stores. Currently,
scheduling needs to be done for two lawn sprinklers, the Water Wave and Spring
Shower models. Requirements for shipment to a warehouse for a national chain of
garden centers are shown below.
Let Sij be the number of units of sprinkler i shipped in month j, where i = 1 or 2, and j
= 1, 2, or 3. Let Wij be the number of sprinklers that are at the warehouse at the end of
a month, in excess of the requirement.
(a.) Write the portion of the objective function that minimizes shipping costs.
(b.) An inventory cost is assessed against this ending inventory. Give the portion of
the objective function that represents inventory cost.
(c.) There will be three constraints that guarantee, for each month, that the total
number of sprinklers shipped will not exceed the shipping capacity. Write these
three constraints.
(d.) There are six constraints that work with inventory and the number of units shipped,
making sure that enough sprinklers are shipped to meet the requirements. Write
these six constraints.
Solutions
(a.) Min 0.3S11 + 0.25S21 + 0.40S12 + 0.30S22 + 0.50S13 + 0.35S23
(b.) Min 0.06W11 +0.05W21 +0.09W12 +0.06W22 +0.12W13 +0.07W23
(c.) S11 + S21 8000
S12 + S22 7000
S13 + S23 6000
(d.) S11 - W11 = 3000
S21 - W21 = 1800
W11 + S12 - W12 = 4000
W21 + S22 - W22 = 4000
W12 + S13 - W13 = 5000
W22 + S23 - W23 = 2000
Example 3.4
(a.) Find the optimal solution of (a.) in Example 3.3 by the big-M method.
(b.) Find the optimal solution of (b.) in Example 3.3 by the two phases method. (寫到
Phase II 的 1st tableau 就可以。)
fj M M M M M M 0 0 -M 0 0 -M 0 0 0 M M M M M M
0.3 0.4 0.5 0.25 0.3 0.35
Cj-fj 0 0 M 0 0 M 0 0 0 0 0 0 0 0 0
-M -M -M -M -M -M
Simplex 2nd tableau
Min Cj 0.3 0.4 0.5 0.25 0.3 0.35 0 0 0 0 0 0 0 0 0 M M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 0
Phase I : 4th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 -1 0 1 0 0 0 1 0 0 0 0 1 0 0 -1 0 -1 0 0 0 1000 -
fj 0 1 1 0 1 1 0 0 -1 0 0 -1 -1 0 0 1 1 1 1 1 1
Cj-fj 0 -1 -1 0 -1 -1 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0
Phase I : 5th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 0 1 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 0 5000 -
fj 0 0 0 1 1 1 0 0 0 0 0 -1 0 0 0 0 1 0 1 0 1
Cj-fj 0 0 0 -1 -1 -1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0
Phase I : 6th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 0 1 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 0 5000 -
fj 0 0 0 0 1 1 0 0 0 1 0 -1 0 0 0 0 0 0 1 0 1
Cj-fj 0 0 0 0 -1 -1 0 0 0 -1 0 1 0 0 0 1 1 1 0 1 0
Phase I : 7th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 0 1 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 0 5000 -
fj 0 0 1 0 0 0 0 0 -1 0 -1 -1 -1 -1 0 1 1 1 1 1 0
Cj-fj 0 0 -1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1
Phase I : 9th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 0 0 0 1 0 -1 1 0 0 0 0 0 1 0 0 0 -1 0 0 0 3000 3000
2 cB2=0 xB2=W21 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 -1 -1 0 0 0 0 3200 -
fj 0 0 0 0 1 0 -1 0 0 0 -1 0 -1 0 0 1 1 0 1 0 0
Cj-fj 0 0 0 0 -1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1
Phase I : 10th tableau
Min Cj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 a1 a2 a3 a4 a5 a6 bi i
1 cB1=0 xB1=W12 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 -1 -1 -1 -1 0 0 2200 -
fj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Cj-fj 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
(b.) Min 0.06W11 +0.05W21 +0.09W12 +0.06W22 +0.12W13 +0.07W23
Phase II : 1st tableau
Min Cj 0 0 0 0 0 0 0.06 0.09 0.12 0.05 0.06 0.07 0 0 0
i cB xB S11 S12 S13 S21 S22 S23 W11 W12 W13 W21 W22 W23 s1 s2 s3 bi i
1 cB1=0.09 xB1=W12 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 2200
Solution:
Change into canonical form:
-3x1 - x2 -4
-5x1 - 2x2 -10
x1 + 2x2 3
-x1 - 2x2 -3 and x1, x2 ≥ 0
Thus,
4 3 1
10 5 2
, c , and A =
6 3 5 1 1
b 8
, i.e., AT =
1 2 2 2
3 1 2
3 1 2
(a) Rewrite the linear programming model into its canonical form.
(b) Change into its dual form.
Example 5.2
Maximize f = 9 x1+12 x2
subject to
3x1+2x2 40
2x1+3x2 30
2x1+ x2 250
and x1, x2 0
The following table is the final table of the above model.
Max Cj 9 12 0 0 0
i cB xB x1 x2 s1 s2 s3 bi i
1 9 x1 1 0 3/5 -2/5 0 12
2 12 x2 0 1 -2/5 3/5 0 2
3 0 s3 0 0 -4/5 5/9 1 224
fj 9 12 3/5 18/5 0 132
Cj-fj 0 0 -3/5 -18/5 0
Under the concern of keeping the basic variables invariant, do the following
exercises
(a) Find the allowable range of coefficient’s values (say, c1 and c2) for x1 and x2.
(b) Find the allowable range of resource amount (say, b1 and b2) for 1st and 2nd
resources.
(c) Find the marginal values of 1st and 2nd resources.
Solution:
(a) -0.6c1+4.8 0;0.4c1-7.2 0 c1 8;c1 18
8 c1 18
-5.4+0.4c2 0;0.4-0.6c2 0 c2 1.35;c2 ⅔
⅔ c2 1.35
(b) 0.6 0.4 0 b1 0.6b1 12
0.4 0.6 0 30 0.4b1 18 0
0.8 5 1 250 0.8b1 266.67
9
0.6b1-12 0;-0.4b1+18 0;-0.8b1+266.67 0
b1 20;b1 45;b1 333.34 20 b1 45
(c) Let y1, y2 and y3 be the marginal values of 1st, 2nd and 3rd resources, then the
dual form of the original model is as follows:
Min Min
g = 40 y1+30 y2+250 y3 g = 40 y1+30 y2+250 y3+Ma1+Ma2
subject to subject to
3y1+2y2+2y3 9 3y1+2y2+2y3-s1+a1 = 9
2y1+3y2+ y3 12 2y1+3y2+ y3-s2+a2 = 12
y1, y2, y2 0 y1, y2, y2 s1, s2, a1, a2 0
Min Cj 40 30 250 0 0 M M
i cB xB y1 y2 y3 s1 s2 a1 a2 bi i
1 M a1 3 2 2 -1 0 1 0 9 3
2 M a2 2 3 1 0 -1 0 1 12 4
fj 5M 5M 3M -M -M M M
Cj-fj 40-5M 30-5M 250-3M M M 0 0
Min Cj 40 30 250 0 0 M M
i cB xB y1 y2 y3 s1 s2 a1 a2 bi i
1 40 y1 1 2/3 2/3 -1/3 0 1/3 0 3 4.5
2 M a2 0 5/3 -1/3 2/3 -1 -2/3 1 6 3.6
80/3+ 80/3 - -40/3 40/3 -
fj 40 5M/3 M/3 +2M/3 -M 2M/3 M
10/3- 670/3 40/3- -40/3
Cj-fj 0 5M/3 +M/3 2M/3 M +2M/3 0
Min Cj 40 30 250 0 0 M M
i cB xB y1 y2 y3 s1 s2 a1 a2 bi i
1 40 y1 1 0 0.4 -0.6 0.4 7/15 -0.4 0.6
2 30 y2 0 1 -0.2 0.4 -0.6 -0.2 0.6 3.6
fj 40 30 10 -12 -18 略 略
Cj-fj 0 0 240 12 18 略 略
Example 6.2
下表所示為三處倉庫與四位顧客間的供需關係表。陰影部份是各相關之運輸成本。
顧客
阿 彌 陀 佛 庫存量
倉庫
戒 7 8 11 10 30
定 10 12 5 4 45
慧 6 10 11 9 35
110
需求量 20 28 17 33
98
以 VAM 法求出其可行解,並計算該解之總運算成本。
Solution:
penalty 1 2 6 5 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
7 戒 30
7 8 11 10 0
4 定 45
10 12 5 4 0
6 慧 35
6 10 11 9 0
Request 20 28 17 33 12 110
penalty 1 2 6 5 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
12
17 戒 30 18
7 8 11 10 0
14 定 45
10 12 5 4 0
36 慧 35
6 10 11 9 0
Request 20 28 17 33 12 0 110
penalty 1 2 6 5 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
12
1 戒 18
7 8 11 10 0
17
61 定 45 28
10 12 5 4 0
3 慧 35
6 10 11 9 0
Request 20 28 17 0 33 0 110
penalty 1 2 6 51 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
12
1 戒 18
7 8 11 10 0
17 28
6 定 28 0
10 12 5 4 0
3 慧 35
6 10 11 9 0
Request 20 28 0 33 5 0 110
penalty 1 2 6 1 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
12
12 戒 18
7 8 11 10 0
17 28
6 定 0
10 12 5 4 0
20
31 慧 35 15
6 10 11 9 0
Request 20 0 28 0 5 0 110
penalty 1 2 6 1 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
18 12
2 戒 18 0
7 8 11 10 0
17 28
6 定 0
10 12 5 4 0
20
1 慧 15
6 10 11 9 0
Request 0 28 10 0 5 0 110
penalty 1 - 6 - 0
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
18 12
2 戒 0
7 8 11 10 0
17 28
6 定 0
10 12 5 4 0
20 10 5
1 慧 15 0
6 10 11 9 0
Request 0 10 0 0 50 0 110
Final penalty
顧客
阿 彌 陀 佛 D(slack) 庫存量
penalty 倉庫
18 12
戒 30
7 8 11 10 0
17 28
定 45
10 12 5 4 0
20 10 5
慧 35
6 10 11 9 0
Request 20 28 17 33 12 110
總運送成本: 20×6+18×8+10×10+17×5+28×4+5×9 = 606。