Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 98

Introduction to Linear

Programming
Source:

1. Operations Research: Applications & Algorithms,


4th edition, by Wayne L. Winston

2. Jim Orlin PowerPoint presentation

1
What Is a Linear Programming Problem?
Example
Giapetto’s, Inc., manufactures wooden
soldiers and trains.
Each soldier built:
• Sell for $27 and uses $10 worth of raw materials.
• Increase Giapetto’s variable labor/overhead costs by $14.
• Requires 2 hours of finishing labor.
• Requires 1 hour of carpentry labor.
Each train built:
• Sell for $21 and used $9 worth of raw materials.
• Increases Giapetto’s variable labor/overhead costs by $10.
• Requires 1 hour of finishing labor.
• Requires 1 hour of carpentry labor.
2
What Is a Linear Programming Problem?

Each week Giapetto can obtain:


• All needed raw material.
• Only 100 finishing hours.
• Only 80 carpentry hours.
Also:
• Demand for the trains is unlimited.
• At most 40 soldiers are bought each week.

Giapetto wants to maximize weekly profit (revenues – expenses).


Formulate a mathematical model of Giapetto’s situation that can
be used maximize weekly profit.

3
What Is a Linear Programming Problem?

The Giapetto solution model incorporates the characteristics shared by


all linear programming problems.

x1 = number of soldiers produced each week


Decision Variables
x2 = number of trains produced each week

Objective Function In any linear programming model, the


decision maker wants to maximize (usually revenue or profit) or
minimize (usually costs) some function of the decision variables.
This function to maximized or minimized is called the objective
function. For the Giapetto problem, fixed costs are do not depend
upon the the values of x1 or x2.

4
What Is a Linear Programming Problem?

Giapetto’s weekly profit can be expressed in terms of the decision


variables x1 and x2:

Weekly profit =
weekly revenue – weekly raw material costs – the weekly variable costs

Weekly revenue = 27x1 + 21x2


Weekly raw material costs = 10x1 + 9x2
Weekly variable costs = 14x1 + 10x2

Weekly profit =
(27x1 + 21x2) – (10x1 + 9x2) – (14x1 + 10x2 ) = 3x1 + 2x2

5
What Is a Linear Programming Problem?

Giapetto’s objective is to chose x1 and x2 to maximize 3x1 + 2x2.


We use the variable z to denote the objective function value of any
LP. Giapetto’s objective function is:

Maximize z = 3x1 + 2x2

“Maximize” will be abbreviated by max and “minimize”


by min. The coefficient of an objective function
variable is called an objective function coefficient.

6
What Is a Linear Programming Problem?

Constraints: As x1 and x2 increase, Giapetto’s objective function grows


larger. For Giapetto, the values of x1 and x2 are limited by the following
three restrictions (often called constraints):

Constraint 1 Each week, no more than 100 hours of finishing time may be used.
Constraint 2 Each week, no more than 80 hours of carpentry time may be used.
Constraint 3 Because of limited demand, at most 40 soldiers should be produced.

These three constraints can be expressed mathematically by


the following equations:
Constraint 1: 2 x1 + x2 ≤ 100
Constraint 2: x1 + x2 ≤ 80

Constraint 3: x1 ≤ 40

7
What Is a Linear Programming Problem?

For the Giapetto problem model, combining the sign restrictions x1 ≥ 0


and x2 ≥ 0 with the objective function and constraints yields the following
optimization model:

Max z = 3x1 + 2x2 (objective function)


Subject to (s.t.)
2 x1 + x2 ≤ 100 (finishing constraint)
x1 + x2 ≤ 80 (carpentry constraint)
x1 ≤ 40 (constraint on demand for soldiers)

x1 ≥0 (sign restriction)

x2 ≥0 (sign restriction)

8
What Is a Linear Programming Problem?

Concepts of linear function and linear inequality:

Linear Function: A function f(x1, x2, …, xn of x1, x2, …, xn is a linear


function if and only if for some set of constants, c1, c2, …, cn,

f(x1, x2, …, xn) = c1x1 + c2x2 + … + cnxn.

For example, f(x1,x2) = 2x1 + x2 is a linear function of x1 and x2, but


f(x1,x2) = (x1)2x2 is not a linear function of x1 and x2.

For any linear function f(x1, x2, …, xn) and any number b, the
inequalities inequality f(x1, x2, …, xn)  b and f(x1, x2, …, xn)  b are
linear inequalities.

9
What Is a Linear Programming Problem?

A linear programming problem (LP) is an optimization problem for which


we do the following:

1. Attempt to maximize (or minimize) a linear function (called the


objective function) of the decision variables.

2. The values of the decision variables must satisfy a set of constraints.


Each constraint must be a linear equation or inequality.

3. A sign restriction is associated with each variable. For each variable


xi, the sign restriction specifies either that xi must be nonnegative (xi ≥
0) or that xi may be unrestricted in sign.

10
What Is a Linear Programming Problem?
Proportionality and Additive Assumptions

The objective function for an LP must be a linear function of the


decision variables has two implications:

1. The contribution of the objective function from each decision variable is


proportional to the value of the decision variable. For example, the
contribution to the objective function for 4 soldiers is exactly fours times
the contribution of 1 soldier.

2. The contribution to the objective function for any variable is independent


of the other decision variables. For example, no matter what the value of
x2, the manufacture of x1 soldiers will always contribute 3x1 dollars to the
objective function.

11
What Is a Linear Programming Problem?

Each LP constraint must be a linear inequality or linear equation has two


implications:

1. The contribution of each variable to the left-hand side of each


constraint is proportional to the value of the variable. For example, it
takes exactly 3 times as many finishing hours to manufacture 3
soldiers as it does 1 soldier.

2. The contribution of a variable to the left-hand side of each constraint is


independent of the values of the variable. For example, no matter
what the value of x1, the manufacture of x2 trains uses x2 finishing
hours and x2 carpentry hours

12
What Is a Linear Programming Problem?

Divisibility Assumption

The divisibility assumption requires that each decision variable be


permitted to assume fractional values. For example, this assumption
implies it is acceptable to produce a fractional number of trains. The
Giapetto LP does not satisfy the divisibility assumption since a
fractional soldier or train cannot be produced. The use of integer
programming methods necessary to address the solution to this
problem.

The Certainty Assumption

The certainty assumption is that each parameter (objective function


coefficients, right-hand side, and technological coefficients) are known
with certainty.

13
What Is a Linear Programming Problem?
Feasible Region and Optimal Solution

The feasible region of an LP is the set of all points satisfying all


the LP’s constraints and sign restrictions.

x1 = 40 and x2 = 20 are in the Giapetto Constraints


feasible region since they satisfy 2 x1 + x2 ≤ 100 (finishing constraint)
all the Giapetto constraints. x1 + x2 ≤ 80 (carpentry constraint)
On the other hand, x1 = 15, x2 = x1 ≤ 40 (demand constraint)
70 is not in the feasible region x1 ≥0 (sign restriction)
because this point does not
x2 ≥ 0 (sign restriction)
satisfy the carpentry constraint
[15 + 70 is > 80].

14
What Is a Linear Programming Problem?
For a maximization problem, an optimal solution to an LP is a point in the
feasible region with the largest objective function value. Similarly, for a
minimization problem, an optimal solution is a point in the feasible region
with the smallest objective function value.

Most LPs have only one optimal solution. However, some LPs
have no optimal solution, and some LPs have an infinite number
of solutions. The optimal solution to the Giapetto LP is x1 = 20 and
x2 = 60. This solution yields an objective function value of:

z = 3x1 + 2x2 = 3(20) + 2(60) = $180

When we say x1 = 20 and x2 = 60 is the optimal solution, we are


saying that no point in the feasible region has an objective function
value (profit) exceeding 180.
15
More Linear Programming Models

16
個案研究:          
       超級穀物公司廣告
組合問題
 目標:設計公司新產品「美好的一天」促銷活動。
 三種最有效果的廣告媒體如下:
• 每週六早上兒童節目的電視廣告。
• 食品及家庭相關雜誌的廣告。
• 星期日報紙副刊的廣告。
 此問題的限制資源為:
• 廣告預算( 400 萬美元)
• 規劃預算( 100 萬美元)
• 5 則電視商業廣告
 目標為測量每一項目的預估曝光量。
 

問題
  如何廣告「美好的一天」在此三種媒體的呈現?
17
成本及曝光量資料
表 4.1

成本

成本類型 每則電視廣告 每則雜誌廣告 每則週日廣告

廣告預算 $300,000 $150,000 $100,000

規劃預算 90,000 30,000 40,000

預估曝光量 1,300,000 600,000 500,000

18
圖 4.1
試算表模式
  B C D E F G H
3   電視廣告 雜誌廣告 副刊廣告      
4 每種廣告曝光量 1,300 600 500      
5 ( 千單位 )            
6         預算   可用
每種廣告成本 ( 千美
7
    元)   花費   預算
8 廣告預算 300 150 100 4,000 ≤ 4,000
9 規劃預算 90 30 40 1,000 ≤ 1,000
10              
11             總曝光量
12   電視廣告 雜誌廣告 副刊廣告     ( 千單位 )
13 廣告量 0 20 10     17,000
14   ≤          
15 最多電視廣告時段數 5          

19
代數模式
令 TV = 電視廣告時段數量
M = 雜誌廣告的數量
SS = 週日副刊廣告的數量

最大化曝光量 = 1,300TV + 600M + 500SS


受限於
廣告預算: 300TV + 150M + 100SS ≤ 4,000 ( 千美元 )
規劃預算: 90TV + 30M + 30SS ≤ 1,000 ( 千美元 )
可用的電視時段數: TV ≤ 5

TV ≥ 0    M ≥ 0    SS ≥ 0

20
久大公司資本預算問題
 久大發展公司主要投資於商業不動產。
 目前有機會參與三項大型營建專案:
• 建造高層辦公大樓
• 建造飯店
• 建造購物中心
 每一項專案皆要參與的夥伴在不同時點進行投資,除了需立即
支付的金額外,另外在接下來的一、二及三年各需投資固定的
金額。

  久大應如何盡可能投資部分或全部的專案?
問題

21
久大發展公司對於各計畫的財務資料

表 4.2

     投資資本要求   (單位:百萬)
年 辦公大樓 飯店 購物中心
0 $40 $80 $90
1 60 80 50
2 90 80 20
3 10 70 60
淨現值 $45 $70 $50

22
試算表模式
圖 4.2

  B C D E F G H
3   辦公大樓 飯店 購物中心      
4 淨現值 45 70 50      
5 ( 百萬美元 )       累積   累積
6 資本 可用
7    所需資本累積(百萬美元) 支出   資本
8 目前 40 80 90 25 ≤ 25
9 第 1 年底 100 160 140 44.76 ≤ 45
10 第 2 年底 190 240 160 60.58 ≤ 65
11 第 3 年底 200 310 220 80 ≤ 80
12              
( 百萬美
14
  辦公大樓 飯店 購物中心     元)
15 參與股份 0.00% 16.50% 13.11%     6500.00

23
代數模式
令 OB = 辦公大樓的參與股份
H = 飯店的參與股份
SC = 購物中心的參與股份

最大化 NPV = 45OB + 70H + 50SC


受限於
目前總投資金額: 40OB + 80H + 90SC ≤ 25 ( 百萬美元 )
1 年內總投資金額: 100OB + 160H + 140SC ≤ 45 ( 百萬美元 )
2 年內總投資金額: 190OB + 240H + 160SC ≤ 65 ( 百萬美元 )
3 年內總投資金額: 200OB + 310H + 220SC ≤ 80 ( 百萬美元 )

且 OB ≥ 0   H ≥ 0   SC ≥ 0
24
聯盟航空人員排班
 聯盟航空準備增加中樞機場的航班,所以需要雇用更多額
外的客服人員。
 每位客服人員八小時為一輪班,核准的五個輪班班次為:
•第 1 輪班: 6:00 AM ~ 2:00 PM
•第 2 輪班: 8:00 AM ~ 4:00 PM
•第 3 輪班: 中午 ~ 8:00 PM
•第 4 輪班: 4:00 PM ~ 午夜
•第 5 輪班: 10:00 PM ~ 6:00 AM

問題
  每一輪班班次需要多少客服人員?

25
排班問題的摘要
表 4.4

每個輪班時間區域
每工作時段所需
的輪班人員
時間區域 1 2 3 4 5
6 AM ~ 8 AM ˇ 48
8 AM ~ 10 AM ˇ ˇ 79
10 AM ~ 中午 ˇ ˇ 65
中午 ~ 2 PM ˇ ˇ ˇ 87
2 PM ~ 4 PM ˇ ˇ 64
4 PM ~ 6 PM ˇ ˇ 73
6 PM ~ 8 PM ˇ ˇ 82
8 PM ~ 10 PM ˇ 43
10 PM ~ 午夜 ˇ ˇ 52
午夜 ~ 6 AM ˇ 15
每位客服人員
$170 $160 $175 $180 $195
的每日津貼
26
試算表模式
  B C D E F G H I J 圖 4.3
3   6am-2pm 8am-4pm 中午 -8pm 4pm- 午夜 10pm-6am      
4   時段 時段 時段 時段 時段      
每一輪班成
5 本 $170 $160 $175 $180 $195      
6 總 最低
7      輪班時段 (1=yes,0=no)   人數    需求 
8 6am-8am 1 0 0 0 0 48 ≥ 48
9 8am-10am 1 1 0 0 0 79 ≥ 79
10 10am- 12pm 1 1 0 0 0 79 ≥ 65
11 12pm-2pm 1 1 1 0 0 118 ≥ 87
12 2pm-4pm 0 1 1 0 0 70 ≥ 64
13 4pm-6pm 0 0 1 1 0 82 ≥ 73
14 6pm-8pm 0 0 1 1 0 82 ≥ 82
15 8pm-10pm 0 0 0 1 0 43 ≥ 43
16 10pm-12am 0 0 0 1 1 58 ≥ 52
17 12am-6am 0 0 0 0 1 15 ≥ 15
18                  
19   6am-2pm 8am-4pm 中午 -8pm 4pm- 午夜 10pm-6am      
20   時段 時段 時段 時段 時段     總成本
21 員工人數 48 31 39 43 15     $30,610 27
代數模式
令 Si = 輪班班次的人數( i = 1 至 5 )

最小化 成本 = $170S1 + $160S2 + $175S3 + $180S4 + $195S5


受限於
6am ~ 8am 的總客服人數: S1         ≥ 48
8am ~ 10am 的總客服人數: S1 + S2       ≥ 79
10am ~ 12pm 的總客服人數: S1 + S2       ≥ 65
12pm ~ 2pm 的總客服人數: S1 + S2 + S3     ≥ 87
2pm ~ 4pm 的總客服人數: S2 + S3     ≥ 64
4pm ~ 6pm 的總客服人數:    S3 + S4   ≥ 73
6pm ~ 8pm 的總客服人數:    S3 + S4   ≥ 82
8pm ~ 10pm 的總客服人數: S4   ≥ 43
10pm ~ 12am 的總客服人數:    S4 + S5 ≥ 52
12am ~ 6am 的總客服人數: S5 ≥ 15 28
且 Si ≥ 0 ( i = 1 至 5 )
大 M 公司配銷網路問題
 大 M 公司在二間工廠生產不同種類的重機械,
產品之一為旋盤車床。
 目前已獲得三位客戶對旋盤車床的下個月訂單。

問題 每間工廠應各配送多少車床給每位客戶?

29
大 M 公司配銷網路問題的相關資料

表 4.5

每台車床運送成本

運送至 顧客 1 顧客 2 顧客 3

由 輸出量

工廠 1 $700 $900 $800 12 台車床

工廠 2 800 900 700 15 台車床

訂購量 10 台車床 8 台車床 9 台車床

30
大 M 公司之配銷網路

圖 4.4

台車

台車床







台車床

台車

31
大 M 公司試算表模式
圖 4.5

  B C D E F G H
3 運送成本            
4 ( 每台車床 ) 客戶 1 客戶 2 客戶 3      
5 工廠 1 $700 $900 $800      
6 工廠 2 $800 $900 $700      
7            
8         總    
9         運送    
10 運送單位 客戶 1 客戶 2 客戶 3 數量   輸出量
11 工廠 1 10 2 0 12 = 12
12 工廠 2 0 6 9 15 = 15

13 客戶需求數量 10 8 9      
14   = = =     總成本
15 訂購量 10 8 9     $20,500

32
大 M 公司代數模式
令 Sij = 從 i 到 j 運送車床的數量( i = F1, F2 ; j = C1, C2, C3 )

最小化 成本 =
$700SF1-C1 + $900SF1-C2 + $800SF1-C3 + $800SF2-C1 + $900SF2-C2 + $700SF2-C3

受限於
工廠 1 : SF1-C1 + SF1-C2 + SF1-C3 = 12
工廠 2 :       SF2-C1 + SF2-C2 + SF2-C3 = 15
客戶 1 : SF1-C1            + SF2-C1 = 10
客戶 2: SF1-C2        + SF2-C2 = 8
客戶 3:       SF1-C3            + SF2-C3 = 9

Sij ≥ 0 ( i = F1, F2 ; j = C1, C2, C3 ) 33
繼續超級穀物公司個案研究

 大衛和克萊兒推斷試算表模式應納入一些額外的考量並進行
修正。
 因此他們鎖定二個目標族群--兒童與兒童父母。
 二個新目標:
•廣告至少 500 萬名兒童收看。
•廣告至少讓 500 萬名兒童父母收看。
 而且,有 1,490,000 美元的年度餘額可皆配到折價券的支出。

34
廣告組合問題的效益與定量需求的資料
表 4.6

每個目標族群的收看人數(百萬人)

最少可接
目標族群 每則電視商業廣告 每則雜誌廣告 每則週日廣告 受人數
兒童 1.2 0.1 0 5

兒童父母 0.5 0.2 0.2 5

表 4.7

每種廣告媒體對於折價金額的貢獻度

要求的總
要求 每則電視商業廣告 每則雜誌廣告 每則週日廣告 折價金額
折價金額 0 $40,000 $120,000 $1,490,000
35
圖 4.6
超級穀物公司試算表模式
  B C D E F G H
3   電視廣告 雜誌廣告 副刊廣告      
4 每種廣告曝光量 1,300 600 500      
5 ( 千單位 )            
6    每種廣告成本 ( 千元 ) 預算花費   可用預算
7 廣告預算 300 150 100 3,775 ≤ 4,000
8 規劃預算 90 30 40 1,000 ≤ 1,000
9              
10   每種廣告媒體所吸引人數 ( 百萬人 )   總收看人數   最少可接受人數
11 兒童 1.2 0.1 0 5 ≥ 5
12 兒童的父母 0.5 0.2 0.2 5.85 ≥ 5
13              
14   電視廣告 雜誌廣告 副刊廣告 總折價金額   要求的總折價金額
15 每種廣告媒體折價金額 0 40 120 1,490 = 1,490
16 ( 千美元 )            
17             總曝光量
18   電視廣告 雜誌廣告 副刊廣告     ( 千單位 )
19 廣告量 3 14 7.75     16,175
20   ≤          
21 最多電視廣告時段數 5           36
超級穀物公司代數模式
令 TV = 電視廣告時段數量
M = 雜誌廣告的數量
SS = 週日副刊廣告的數量

最大化 曝光量 = 1,300TV + 600M + 500SS


受限於
廣告預算: 300TV + 150M + 100SS ≤ 4,000 ( 千美元 )
規劃預算: 90TV + 30M + 30SS ≤ 1,000 ( 千美元 )
已用電視時段: TV ≤ 5

總兒童收看人數: 1.2TV + 0.1M ≥ 5 ( 百萬 )


總父母收看人數: 0.5TV + 0.2M + 0.2SS ≥ 5 ( 百萬 )

總折價金額: 40M + 120SS = 1,490 ( 千美元 )

且 TV ≥ 0    M ≥ 0    SS ≥ 0 37
函數限制式類型
表 4.8

類型 格式 * 解釋 使用範圍

針對每種資源, 資源配置問題 & 混


資源限制式 LHS ≤ RHS
已用數量 ≤ 可用數量 合型問題

針對每種效益, 成本效益取捨問題 &


效益限制式 LHS ≥ RHS
達成程度 ≥ 可接受程度 混合型問題

針對某些數量,
配銷網路問題 & 混合
定量需求限制式 LHS = RHS 供應的數量 = 需求的數
型問題

* LHS = 左邊( SUMPRODUCT 函數)


RHS = 右邊(常數)

38
節約公司回收固體廢棄物
• 節約公司經營一家回收中心,主要蒐集四種不同類型
的固體廢棄物,經過處理後再進行混合(處理與混合
為二種不同程序),最後變成可販賣的產品。
• 產品依據混合的材料可分成 A 、 B 、 C 三種不同的等
級。

問題
如何以四種不同類型的固體廢棄物,生產三種等級不
同的產品?

39
節約公司的產品資訊
表 4.9

等級 規格 每磅混合費用 每磅的售價
材料 1 :不超過全部的 30%
材料 2 :不少於全部的 40%
A $3.00 $8.50
材料 3 :不超過全部的 50%
材料 4 : 等於全部的 20%
材料 1 :不超過全部的 50%
B 材料 2 :不少於全部的 10% 2.50 7.00
材料 4 :等於全部的 10%

C 材料 1 :不超過全部的 70% 2.00 5.50

40
節約公司固體廢棄物的材料資料
表 4.10

每週可得數量
材料 (磅) 每磅處理成本 額外限制
1 3,000 $3.00 1. 針對每種材料,每週
至少蒐集及處理一半的
2 2,000 6.00 量。
3 4,000 4.00
2. 每週 30,000 美元的經
4 1,000 5.00 費應使用於處理材料。

41
節約公司試算表模式
  B C D E F G H I J K L M

3   A級 B級 C級                

4 單位混合成本 $3.00 $2.50 $2.00       總處理成本 $30,000    

5 單位賣價 $8.50 $7.00 $5.50           =    

6 單位利潤 $5.50 $4.50 $3.50       可用經費 $30,000    

7                        

8                        

9     材料配置     單位       全部    

10 ( 每種產品等級所使用的材料磅數 )   處理   最少需   處理   可用

11   A級 B級 C級   成本   處理數量   數量   數量

12 材料 1 412.3 2,587.7 0   $3   1,500 <= 3,000 <= 3,000

13 材料 2 859.6 517.5 0   $6   1,000 <= 1,377 <= 2,000

14 材料 3 447.4 1,552.6 0   $4   2,000 <= 2,000 <= 4,000

15 材料 4 429.8 517.5 0   $5   500 <= 947 <= 1,000

16 生產總量 2,149.1 5,175.4 0                

17                        

18           混合規格     混合比例

A 級 , 材料
19             1 412.3 <= 644.74 30% A級

A 級 , 材料
20   總利潤 $35,110       2 859.6 >= 859.6 40% A級

A 級 , 材料
21             3 447.4 <= 1,074.6 50% A級

A 級 , 材料
22             4 429.8 = 429.8 20% A級

23                        

B 級 , 材料 42
24             1 2,587.7 <= 2,587.7 50% B級

B 級 , 材料
節約公司代數模式
令 xij = 每磅材料 j 每週分配到產品 i 的數量 (i = A, B, C ; j = 1, 2, 3, 4)
最大化  利潤 =
5.5(xA1 + xA2 + xA3 + xA4) + 4.5(xB1 + xB2 + xB3 + xB4) + 3.5(xC1 + xC2 + xC3 + xC4)

受限於  組合規格: xA1 ≤ 0.3 (xA1 + xA2 + xA3 + xA4)


xA2 ≥ 0.4 (xA1 + xA2 + xA3 + xA4)
xA3 ≤ 0.5 (xA1 + xA2 + xA3 + xA4)
xA4 = 0.2 (xA1 + xA2 + xA3 + xA4)
xB1 ≤ 0.5 (xB1 + xB2 + xB3 + xB4)
xB2 ≥ 0.1 (xB1 + xB2 + xB3 + xB4)
xB4 = 0.1 (xB1 + xB2 + xB3 + xB4)
xC1 ≤ 0.7 (xC1 + xC2 + xC3 + xC4)
可用材料: xA1 + xB1 + xC1 ≤ 3,000
xA2 + xB2 + xC2 ≤ 2,000
xA3 + xB3 + xC3 ≤ 4,000
xA4 + xB4 + xC4 ≤ 1,000
處理數量限制: xA1 + xB1 + xC1 ≥ 1,500
xA2 + xB2 + xC2 ≥ 1,000
xA3 + xB3 + xC3 ≥ 2,000
xA4 + xB4 + xC4 ≥ 500
43
處理成本限制: 3(xA1 + xB1 + xC1) + 6(xA2 + xB2 + xC2)
+ 4(x + x + x ) + 5(x + x + x ) = 30,000
Scheduling Postal Workers
• Each postal worker works for 5 consecutive days, followed by 2 days off, repeated
weekly.

Day Mon Tues Wed Thurs Fri Sat Sun

Demand 17 13 15 19 14 16 11

• Minimize the number of postal workers (for the time being, we will permit
fractional workers on each day.)

44
Formulating as an LP

• Select the decision variables


– Let x1 be the number of workers who start working on
Monday, and work till Friday
– Let x2 be the number of workers who start on Tuesday

– Let x3, x4, …, x7 be defined similarly.

45
The linear program
Day Mon Tues Wed Thurs Fri Sat Sun

Demand 17 13 15 19 14 16 11

Minimize z = x1 + x2 + x3 + x4 + x5 + x6 + x7

subject to x1 + x4 + x5 + x6 + x7  17
x1 + x2 + x5 + x6 + x7  13
x1 + x2 + x3 + x6 + x7  15
x1 + x2 + x3 + x4 + x7  19
x1 + x2 + x3 + x4 + x5  14
x2 + x3 + x4 + x5 + x6  16
x3 + x4 + x5 + x6 + x7  11
xj  0 for j = 1 to 7 46
Minimize
z = x1 + x2 + x3 + x4 + x5 + x6 + x7

subject to x1 + x4 + x5 + x6 + x7 - s1 = 17
x1 + x2 + x5 + x6 + x7 - s2 = 13
x1 + x2 + x3 + x6 + x7 - s3 = 15
x1 + x2 + x3 + x4 + x7 - s 4 = 19
x1 + x2 + x3 + x4 + x5 - s5 = 14
x2 + x3 + x4 + x5 + x6 - s6 = 16
x3 + x4 + x5 + x6 + x7 - s7 = 11
xj  0 , sj  0 for j = 1 to 7
47
A non-linear objective that often can be made linear .

Suppose that one wants to minimize the


maximum of the slacks, that is
minimize z = max (s1, s2, …, s7).

This is a non-linear objective.


But we can transform it, so the problem becomes
an LP.

48
Minimize z

z  sj for j = 1 to 7.
subject to x1 + x4 + x5 + x6 + x7 - s1 = 17
x1 + x2 + x5 + x6 + x7 - s2 = 13
x1 + x2 + x3 + x6 + x7 - s3 = 15
x1 + x2 + x3 + x4 + x7 - s4 = 19
x1 + x2 + x3 + x4 + x5 - s5 = 14
x2 + x3 + x4 + x5 + x6 - s6 = 16
x3 + x4 + x5 + x6 + x7 - s7 = 11
xj  0 , s j  0 for j = 1 to 7

The new constraint ensures that z  max (s1, …, s7)


49
The objective ensures that z = sj for some j.
Non-linear objective that often can be made linear.

Suppose that the “goal” is to have dj workers on


day j. Let yj be the number of workers on day j.

Suppose that the objective is


minimize i | yj – dj |

This is a non-linear objective.


But we can transform it, so the problem becomes an
LP.
50
Minimize j zj
zj  dj - yj for j = 1 to 7.
zj  yj - dj for j = 1 to 7.
subject to x1 + x4 + x5 + x6 + x7 = y1
x1 + x2 + x5 + x6 + x7 = y2
x1 + x2 + x3 + x6 + x7 = y3
x1 + x2 + x3 + x4 + x7 = y4
x1 + x2 + x3 + x4 + x5 - = y5
x2 + x3 + x4 + x5 + x6 = y6
x3 + x4 + x5 + x6 + x7 = y7
xj  0 , yj  0 for j = 1 to 7

The new constraints ensure that zj  | yj – dj | for each j.


51
The objective ensures that zj = | yj – dj | for each j.
A ratio constraint:

Suppose that we need to ensure that at least 30% of the


workers have Sunday off.
How do we model this?

(x1 + x2 )/x1 + x2 + x3 + x4 + x5 + x6 + x7  .3

(x1 + x2 )  .3 x1 + .3 x2 + .3 x3 + .3 x4 + .3 x5 + .3 x6 + .3 x7

-.7 x1 - .7 x2 + .3 x3 + .3 x4 + .3 x5 + .3 x6 + .3 x7 <= 0

52
Cost per Ounce and Dietary Requirements for
Diet Problem

53
Example
Example4-2
4-2Diet
DietProblem
Problem

54
Example
Example4-3
4-3Blending
BlendingProblem
Problem
Formulate the appropriate model for Solution
the following blending problem: Variable definitions
The sugar content of three juices— O = quantity of orange juice in quarts
orange, banana, and pineapple—is B = quantity of banana juice in quarts
10, 15, and 20 percent, respectively. P = quantity of pineapple juice in quarts
How many quarts of each must be
mixed together to achieve one
gallon (four quarts) that has a sugar
content of at least 17 percent to
minimize cost? The cost per quart is
20 cents for orange juice, 30 cents
for banana juice, and 40 cents for
pineapple juice.

55
Example
Example4-5
4-5Media
MediaSelection
Selection
The Long Last Appliance Sales Company is in the business of selling
appliances such as microwave ovens, traditional ovens, refrigerators,
dishwashers, washers, dryers, and the like. The company has stores in the
greater Chicagoland area and has a monthly advertising budget of $90,000.
Among its options are radio advertising, advertising in the cable TV
channels, newspaper advertising, and direct-mail advertising. A 30-second
advertising spot on the local cable channel costs $1,800, a 30-second radio ad
costs $350, a half-page ad in the local newspaper costs $700, and a single
mailing of direct-mail insertion for the entire region costs $1,200 per mailing.
The number of potential buying customers reached per advertising medium
usage is as follows:
Radio 7,000
TV 50,000
Newspaper 18,000
Direct mail 34,000
Due to company restrictions and availability of media, the maximum number
of usages of each medium is limited to the following:
Radio 35
TV 2 5
Newspaper 30
Direct mail 18

56
Example
Example4-5
4-5(cont’d)
(cont’d)
The management of the company has met and decided that in order to ensure a
balanced utilization of different types of media and to portray a positive image
of the company, at least 10 percent of the advertisements must be on TV. No
more than 40 percent of the advertisements must be on radio. The cost of
advertising allocated to TV and direct mail cannot exceed 60 percent of the
total advertising budget.
What is the optimal allocation of the budget among the four media? What is the
total maximum audience contact?

57
Example
Example4-5
4-5(cont’d)
(cont’d)

58
Marketing
MarketingResearch
Research

• Stages of marketing research study development:


– Design study.
– Conduct marketing survey.
– Analyze data and obtain results.
– Make recommendations based on the results.

59
Example
Example4-6
4-6Market
MarketResearch
Research
Market Facts Inc. is a marketing research firm that works with client
companies to determine consumer reaction toward various products and
services. A client company requested that Market Facts investigate the
consumer reaction to a recently developed electronic device.
Market Facts and the client company agreed that a combination of telephone
interviews and direct-mail questionnaires would be used to obtain the
information from different type of households.
The households are divided into six categories:
1. Households containing a single person under 40 years old and without children
under 18 years of age.
2. Households containing married people under 40 years old and without children
under 18 years of age.
3. Households containing single parents with children under 18 years of age.
4. Households containing married families with children under 18 years of age.
5. Households containing single people over 40 years old without children under
18 years of age.
6. Households containing married people over 40 years old without children under
18 years of age.

60
Example
Example4-6
4-6(cont’d)
(cont’d)
Restrictions
1. At least 60 percent of the phone interviews must be conducted at
households with children.
2. At least 50 percent of the direct-mail questionnaires must be mailed to
households with children.
3. No more than 30 percent of the phone interviews and mail-in questionnaires
must be conducted at households with single people.
4. At least 25 percent of the phone interviews and mail-in questionnaires must
be conducted at households that contain married couples.

61
Example
Example4-6
4-6(cont’d)
(cont’d)
Problem formulation

62
Example
Example4-6
4-6(cont’d)
(cont’d)
Problem solution

63
Financial
Financial Applications
Applications

• Planning Problems for Banks


– Linear programming can be very beneficial in banking decisions.
– Financial planning: bankers must decide how a bank wants to
allocate its funds among the various types of loans and investment
securities.
– Portfolio management: decisions are based on maximizing annual
rate of return subject to state and federal regulations, and bank
policies and restrictions.

64
Example
Example4-7
4-7Financial
FinancialPlanning
Planning
First American Bank issues five types of loans. In addition, to
diversify its portfolio, and to minimize risk, the bank invests in risk-
free securities. The loans and the risk-free securities with their annual
rate of return are given in Table 4-3.

Table 4-3 Rates of Return for Financial Planning Problem


Type of Loan or Security Annual Rate of Return (%)
Home mortgage (first) 6
Home mortgage (second) 8
Commercial loan 11
Automobile loan 9
Home improvement loan 10
Risk-free securities 4

65
Example
Example4-7
4-7Financial
FinancialPlanning
Planning(cont’d)
(cont’d)
The bank’s objective is to maximize the annual rate of return on
investments subject to the following policies, restrictions, and
regulations:
1. The bank has $90 million in available funds.
2. Risk-free securities must contain at least 10 percent of the total
funds available for investments.
3. Home improvement loans cannot exceed $8,000,000.
4. The investment in mortgage loans must be at least 60 percent
of all the funds invested in loans.
5. The investment in first mortgage loans must be at least twice as
much as the investment in second mortgage loans.
6. Home improvement loans cannot exceed 40 percent of the
funds invested in first mortgage loans.
7. Automobile loans and home improvement loans together may
not exceed the commercial loans.
8. Commercial loans cannot exceed 50 percent of the total funds
invested in mortgage loans.

66
Example
Example4-7
4-7Financial
FinancialPlanning
Planning(cont’d)
(cont’d)

67
Example
Example4-7
4-7Financial
FinancialPlanning
Planning(cont’d)
(cont’d)

68
Example
Example4-8
4-8Portfolio
PortfolioSelection
Selection
A conservative investor has $100,000 to invest. The investor has
decided to use three vehicles for generating income: municipal
bonds, a certificate of deposit (CD), and a money market account.
After reading a financial newsletter, the investor has also identified
several additional restrictions on the investments:
1. No more than 40 percent of the investment should be in bonds.
2. The proportion allocated to the money market account should be
at least double the amount in the CD.

The annual return will be 8 percent for bonds, 9 percent for


the CD, and 7 percent for the money market account. Assume the
entire amount will be invested.
Formulate the LP model for this problem, ignoring any
transaction costs and the potential for different investment lives.
Assume that the investor wants to maximize the total annual
return.

69
Example
Example4-8
4-8Portfolio
PortfolioSelection
Selection(cont’d)
(cont’d)

70
Production
Production Applications
Applications

• Linear programming in production management in


manufacturing:
– Multiperiod production scheduling
– Workforce scheduling
– Make-or-buy decisions.

71
Example
Example4-9
4-9 Multiperiod
MultiperiodProduction
ProductionScheduling
Scheduling
Morton and Monson Inc. is a small manufacturer of parts for the aerospace industry.
The production capacity for the next four months is given as follows:

Production Capacity in Units


Month Regular Production Overtime Production
January 3,000 500
February 2,000 400
March 3,000 600
April 3,500 800

The regular cost of production is $500 per unit and the cost of overtime production is
$150 per unit in addition to the regular cost of production. The company can utilize
inventories to reduce fluctuations in production, but carrying one unit of inventory costs
the company $40 per unit per month. Currently there are no units in inventory.
However, the company wants to maintain a minimum safety stock of 100 units of
inventory during the months of January, February, and March. The estimated demand
for the next four months is as follows:
Month January February March April
Demand 2,800 3,000 3,500 3,000

72
Example
Example4-9
4-9 Multiperiod
MultiperiodProduction
ProductionScheduling
Scheduling(cont’d)
(cont’d)

Continued on next slide.


73
Example
Example4-9
4-9 Multiperiod
MultiperiodProduction
ProductionScheduling
Scheduling(cont’d)
(cont’d)

74
Example
Example4-9
4-9 Multiperiod
MultiperiodProduction
ProductionScheduling
Scheduling(cont’d)
(cont’d)

75
Radiation Therapy Overview

• High doses of radiation (energy/unit mass) can kill cells and/or prevent them
from growing and dividing
– True for cancer cells and normal cells
• Radiation is attractive because the repair mechanisms for cancer cells is less
efficient than for normal cells

76
Conventional Radiotherapy

Relative Intensity of Dose Delivered

77
Conventional Radiotherapy

Relative Intensity of Dose Delivered

78
Conventional Radiotherapy

• In conventional radiotherapy
– 3 to 7 beams of radiation
– radiation oncologist and physicist work together to determine a set of
beam angles and beam intensities
– determined by manual “trial-and-error” process

79
Goal: maximize the dose to the tumor while minimizing dose to
the critical area

Critical Area

Tumor area

With a small number of beams, it is difficult to


achieve these goals. 80
Tomotherapy: a diagram

81
Radiation Therapy: Problem Statement

• For a given tumor and given critical areas

• For a given set of possible beamlet origins and angles

• Determine the weight of each beamlet such that:


– dosage over the tumor area will be at least a target level
L .
– dosage over the critical area will be at most a target
level U.

82
Display of radiation levels

83
Linear Programming Model

• First, discretize the space


– Divide up region into a 2D (or 3D) grid of pixels

84
More on the LP

• Create the beamlet data for each of


p = 1, ..., n possible beamlets.

• Dp is the matrix of unit doses delivered by beam p.

Dijp = unit dose


delivered to pixel (i,j)
by beamlet p

85
Linear Program

• Decision variables w = (w1, ..., wp)

• wp = intensity weight assigned to beamlet p


for p = 1 to n;

• Dij = dosage delivered to pixel (i,j)

Dij   p1 D w p
n p
ij

86
An LP model
took 4 minutes to
minimize  (i, j)
Dij
solve.

Dij   p1 D w p
n p
ij

Dij   L for ( i , j )  T
Dij   U for ( i , j )  C
wp  0 for all p
In an example reported in the paper, there were more than
63,000 variables, and more than 94,000 constraints (excluding
upper/lower bounds) 87
What to do if there is no feasible solution
• Use penalties: e.g., Dij  L – yij
and then penalize y in the objective.

• Consider non-linear penalties (e.g., quadratic)

• Consider costs that depend on damage rather than on


radiation

• Develop target doses and penalize deviation from the


target

88
Optimal Solution for the LP

89
An Optimal Solution to an NLP

90
Homework

91
Example
Example4-10
4-10 Workforce
WorkforceScheduling
Scheduling

92
Example
Example4-11
4-11 Make-or-Buy
Make-or-BuyDecisions
Decisions

93
Example
Example4-12
4-12 Agriculture
AgricultureApplications
Applications
A farm owner in Des Moines, Iowa, is interested in determining how to divide the
farmland among four different types of crops. The farmer owns two farms in
separate locations and has decided to plant the following four types of crops in
these farms: corn, wheat, bean, and cotton. The first farm consists of 1,450 acres
of land, while the second farm consists of 850 acres of land. Any of the four
crops may be planted on either farm. However, after a survey of the land, based
on the characteristics of the farmlands, Table 4-7 shows the maximum acreage
restrictions the farmer has placed for each crop.

94
95
96
97
98

You might also like