Upload
juliana-gibson
View
224
Download
0
Embed Size (px)
Citation preview
1. 数理計画法: Mathematical Programming- ( 最適化問題: Optimization)
目的関数 Objective function: Z(x1,x2,…,xn)制約条件式Constraints function(s): b1(x1,x2,…,xn)=0
…..bm1(x1,x2,…,xn)=0bm1+1(x1,x2,…,xn) 0≦ …..bm1+m2 (x1,x2,…,xn) 0≦
独立変数: Dependent variable: Z(x1,x2,…,xn)従属変数: Independent variable: x1,x2,…,xn
3. Combinational Optimization * Dynamic Programming * Relaxation Method * Branch and Bound Method
4. Probabilistic Methods * Queuing Theory * Game Theory * Markov Chains
Discrete Variable Continuous Variable (differentiable)
Constrained UnconstrainedLinear Function Non Linear FunctionDeterministic Probabilistic ・・・・・・・・・・ ・・・・・・・・・
数理計画法
<
<>>
1. Linear Programming
* Linear Programming
* Integer Linear Programming
2. Non Linear Programming
* Unconstrained Optimization
* Constrained Optimization
2.1 線形計画法: Linear Programming
Min. Z(xi) = Σ ai ・ xi
s.t. Σb1i ・ xi ≦ b01
……Σbmi ・ xi ≦ b0m
x1
x2
輸送問題: Transport Problem
輸送問題: Transport Problem
輸送問題: Transport Problem
xij [ton] : i 倉庫 から j 百貨店への輸送荷物量Cij [B/ton] : i 倉庫 から j 百貨店への単位重量あたり輸送コストSi [ton] : i 倉庫における在庫量 Cj [ton] : j 百貨店における消費量
目的関数 Min. Σ Σ Cij ・ xij
制約条件 s.t. Σ xij ≦ Si [ton] Σ xij >= Cj [ton]
線形計画問題の条件
1. 目的関数とすべての制約が線形関数2. 制約条件はすべて ≦ , , or = ≧3. 変数は連続変数
c.f. 整数計画法
線形計画法の解法
1. 図形解法 2. 代数解法3. シンプレックス法
Max. Z=60x1+80x2
s.t. x1 + x2 10≦
4x1 + 6x2 48≦
0 x≦ 1, 0 x≦ 2
[ 例 ]
x1 + x2 10≦
4x1 + 6x2 48≦
0 ≦ x1
0 ≦ x2
2.1.1 図形解法 (1)
0
8
10
0 10
x1 +x2=10
4x1 +6x2=48
x1 = 0
x2 = 012
x2
x1
Feasible Region
図形解法 (2)
0
8
10
0
x2
Feasible Region
Z=60x1+80x2
x2=-3/4x1+Z/80
x2=-3/4x1+Z4/80
x2=-3/4x1+Z2/80x2=-3/4x1+Z3/80
x2=-3/4x1+Z1/80
),(y
Z
x
ZZ
=(3,4)
x1 + x2=10
4x1 + 6x2=48
x1 =6x2 =4Z =680
端点: Corner Point(1)
0
8
10
0 10 12
x2
x1
(6,4)
Feasible Region
Corner Point
実行可能領域Feasible Region制約条件を全て満たす点の集合
端点 (2)(2)
x1
x2
xx3=tx=tx1+(1-t)x+(1-t)x2 S : Convex Set
For all t [0,1] and all xx1,xx2 S : Convex Set
1-t1-t
tt
x2x1 1-t t
端点 (3)
端点定理
線形計画問題の最適解は,端点で得られる
もし,端点以外で,最適解が得られるとすると, x0 =αx1 + βx2 α + β = 1 α≧ 0, β≧ 0 Z = f(x0)
= c x0
= c αx1 +c βx2
= αf(x1) + βf(x2)
= α ( f(x1)−f(x2) )+ f(x2)
= β ( f(x2)−(x1) )+ f(x1)
If f(x1) f(x≦ 2) then f(x1) f(x≦ 0) f(x≦ 2)
If f(x2) f(x≦ 1) then f(x2) f(x≦ 0) f(x≦ 1)
In either case, f(x0) is not a optimal solution.
端点 (4)
a11x1+a21x2=0a12x1+a22x2=0
a11x1+a21x2 + a31x3=0a12x1+a22x2 + a32x3 =0a13x1+a23x2 + a33x3 =0
凸領域凸領域
x1
x2
xx3=tx=tx1+(1-t)x+(1-t)x2 S
For all t [0,1] and all xx1,xx2 S
1-t1-t
tt
x1
x2
For all xx1,xx2 S
xx3= tx= tx1+ (1- t)x+ (1- t)x2 S
2.2.2 代数解法
スラック変数Slack Variable : x3, x4
Z=60x1+80x2
s.t. x1 + x2 10≦
4x1 + 6x2 48≦
0 x≦ 1, 0 x≦ 2
Z=60x1+80x2
s.t. x1 + x2 + x3 = 10
4x1 + 6x2 + x4 =48
0 x≦ 1, 0 x≦ 2 , 0 x≦ 3 , 0 x≦ 4
0
8
10
0 10
x1 +x2=10
4x1 +6x2=48
x1 = 0
x2 = 0
12
x2
x1(0, 0,10,48)
(x1 , x2 , x3 , x4 )
(10, 0, 0,8)
(12, 0,-2, 0)
(6, 4, 0, 0)
(0,10,0,-12)
(0,8,2,0)
x1 + x2 + x3 = 10
4x1 + 6x2 + x4 =48
標準系
xi = 0xj = 0
‥xk = 0
n
非基底解 : Non-Basic Solutions非基底変数: Non-Basic Variables
xi’ = c1
xj’ = c2
‥xk’ = cm
m
基底解 : Basic Solutions 基底変数 : Basic Variables
a 11x1 + a 12x2 + ‥‥ + a 1nxn + xn+1 = b 1
a 21x1 + a 22x2 + ‥‥ + a 2nxn + xn+2 = b2
‥‥ ‥‥
a m1x1 + a m2x2 + ‥‥ + a mnxn + xn+m = b m
0
8
10
0 10 12
x2
x1(0, 0,10,48) (10, 0, 0,8)
(12, 0,-2, 0)
(6, 4, 0, 0)
(0,10,0,-12)
(0,8,2,0)
X1 X2 X3 X4 Z① 0 0 10 48 0② 0 10 0 -12 800③ 0 8 2 0 640④ 10 0 0 8 600⑤ 12 0 -2 0 720⑥ 6 4 0 0 680
①
②
③
④ ⑤
⑥
非基底変数 xi =0基底変数 xi =c=0
x1 + x2 + x3 = 10
4x1 + 6x2 + x4 =48
2.2.3 シンプレックス法Simplex Method
シンプレックス法の概念
Z
Z(x11,x21,x31)
Z(x12,x22,x32)
≦
Z(x15,x25,x35)
隣接端点 (1)
a41x1+a42x2+a43x3-b1 =0
a31x1+a32x2+a33x3-b3=0a21x1+a22x2+a23x3-b2=0
a11x1+a12x2+a13x3-b1=0
a41x1+a42x2+a43x3-b1 =0
a21x1+a22x2+a23x3-b2=0a31x1+a32x2+a33x3-b3=0 a21x1+a22x2+a23x3-b2=0
a31x1+a32x2+a33x3-b3=0
a11x1+a12x2+a13x3-b1=0
(2)
(1)
(3)
(4)
隣接端点 (2)
(1) a21x1+a22x2+a23x3+x4 =b2
(2) a21x1+a22x2+a23x3 + x5 =b2
(3) a31x1+a32x2+a33x3 +x6 =b3
(4) a41x1+a42x2+a43x3 +x7 =b4
x1=a1
x2=a2
x3=a3
x4=a4
x5=0x6=0x7=0
x1=c1
x2=c2
x3=c3
x4=0x5=0x6=0
x7= c7
Basic Non-Basic Variables Variables
Basic Non-Basic Variables Variables
(2)
(1)
(3)
(4)
a21x1+a22x2+a23x3-b2=0
隣接端点 (3)
n dimensions * the number of non-basic variables at the corner points is n. * n-1 non-basic variables are common between the adjacent corner point
0
8
10
0 10 12
x2
x1(0, 0,10,48) (10, 0, 0,8)
(6, 4, 0, 0)
① ④
⑥
Non-Basic Variables xi =0Basic Variables xi =c=0
x1 + x2 + x3 = 10
4x1 + 6x2 + x4 =48
隣接端点 (4)
Basic VariablesNon-Basic Variables
xn+2 → Non-Basic Variables, x1 → Basic Variables
x1 + a12’x2 + + a‥‥ 1n’xn + xn+1 + a1n’xn+2 = b1 ’
(1) ’
a22’x2 + + a‥‥ 2n’xn + a1n’xn+2 = b2 ’ (2) ’
‥‥ ‥‥ am2’x2 + +a‥‥ mn’xn +a1n’xn+2 +xn+m= bm ’ (m) ’
a11x1 + a12x2 + + a‥‥ 1nxn + xn+1 = b1 (1)
a21x1 + a22x2 + + a‥‥ 2nxn + xn+2 = b2 (2)
‥‥ ‥‥am1x1 + am2x2 + + a‥‥ mnxn + xn+m = bm (m)
隣接端点 (5)
a11x1 + a12x2 + + a‥‥ 1nxn + xn+1 = b1 (1)
a21x1 + a22x2 + + a‥‥ 2nxn + xn+2 = b2 (2)
‥‥ ‥‥am1x1 + am2x2 + + a‥‥ mnxn + xn+m = bm (m)
(2)/a21
x1 + a12/a21x2 + + a‥‥ 1n /a21xn + 1 /a21xn+1 = b1 /a21 (2)’
(1) - a11×(2)’
0+(a22-a11a12/a21)x2 + + (a‥ 2n-a11a1n /a21)xn - a11 /a21xn+1 + xn+2 = b2 - a11b1 /a21 (1)’
(m) - am1×(1)’
‥
0+(am2-am1a12/a21)x2 + + (a‥ mn-am1a1n /a21)xn - am1 /a21xn+1 + xn+m = bm - am1b1 /a21 (m)’
a12’x2 + + a‥‥ 1n’xn + xn+1 + a1n’xn+2 = b1 ’ (1) ’
x1 + a22’x2 + + a‥‥ 2n’xn + a1n’xn+2 = b2 ’ (2) ’
‥‥ ‥‥
am2’x2 + +a‥‥ mn’xn +a1n’xn+2 +xn+m = bm ’ (m) ’
隣接端点 (6)
a12’x2 + + a‥‥ 1n’xn + xn+1 + a1n’xn+2 = b1 ’ (1) ’
x1 + a22’x2 + + a‥‥ 2n’xn + a1n’xn+2 = b2 ’ (2) ’
‥‥ ‥‥
am2’x2 + +a‥‥ mn’xn +a1n’xn+2 +xn+m = bm ’ (m) ’
Z=c1 x1+ c2 x2+ + cn xn
= c1(b2 ’ - a22’x2 - - a‥‥ 2n’xn - a1n’xn+2 ) + c2 x2+ + cn xn
= c1 b2 ’ +(c2 - a22’ ) x2 +(‥ c2 - a22’ ) xn - a1n’xn+2
例Z=60x1+80x2
s.t. x1 + x2 10≦4x1 + 6x2 48≦
0 x≦ 1, 0 x2≦
Z=60x1+80x2
s.t. x1 + x2 + x3 = 10 (1)
4x1 + 6x2 + x4 =48 (2)
0 x≦ 1, 0 x≦ 2 , 0 x≦ 3 , 0 x≦ 4
0
8
0①
(0, 0,10,48)
① x1 ,x2 x3 , x4
③ x1 , x4 x2 , x3
Non-Basic Variables Basic Variables
1/3x1 + x3 ー 1/6x4 = 2 (1’)
2/3x1 + x2 + 1/6x4 = 8 (2’)
(0,8,2,0)
③
1/3x1 + x3 ー 1/6x4 =2 (1’)(1’)=(1) - (2’)
Z=60x+80x2=60x1+80 (8-2/3x1-1/6x4)
(2’)=(2)/a22
2/3x1 + x2 + 1/6x4 =8 (2’)
Z = 20/3 x1 – 40/3x4 + 640
Simplex Method Phase I
n 次元 * ひとつの端点には, 個の隣接端点がある. どの端点を選ぶか? (どの変数が次の基底解になるか?)
Z
Z
),,,,()(21 ni x
ZxZ
xZ
xZ
xZ
),,,,(21 ni x
ZxZ
xZ
xZ
Max
Simplex Method Phase I (cont.)
0
8
0 10
x2
(0, 0,10,48) (10, 0, 0,8)
(0,8,2,0)
①
③
④
Z=60x1+80x2
)80,60(),()(21
xZ
xZ
xZ
80)80,60( Max
x2 is selected as a new basic variable
),(21 x
ZxZ
Z
Simplex Method Phase II
m個の制約条件式 * m 個の基底変数 . m 個の基底変数の内,どの基底変数が非基底変数になるか?
0
8
0 10
x2
(0, 0,10,48)
(0,8,2,0)
①
③
(0,10,0,-12)②x3, x4
x28 10
48
-12
0
10 x3
x4
x1 + x2 + x3 = 10
4x1 + 6x2 + x4 =48
x1 = 0
x2 + x3 = 10
6x2 + x4 =48
x4 is selected as a new non-basic variable ③ is selected as a corner point
シンプレックス法の解法手順
Step.1 初期実行可能解を求める .
Step.2 目的関数を改善する隣接端点を調べる無い場合:その点が最適解ある場合: Step 3 へ
Step.3 目的関数を最も改善する方向を決定する. (どの変数が次の基底解になるかを決める)
Step.4 制約条件を満たす中で,目的関数を最も改善する端点を決定する. (どの変数が次の非基底解になるかを決める) Step 2 へ
解なし[実行可能領域無し]
x2
x1 + x2 10≧2x1 + x2 8≦0 x≦ 1
0 x2≦
4 10
10
8
x1
How to solve LP with Excel?
Spread Sheet
Example
A company produces two products P1 and P2 with three materials M1, M2, and M3. 1kg of M1, 2kg of M2, and 3 kg of M3 are used to produce 1 kg of P1. Similarly, 7kg of M1, 4kg of M2, and 2 kg of M3 are used to produce 1 kg of P2. However, they have only 140kg of M1, 100kg of M2, and 120 kg of M3. Obtain the best combination of product P1 and P2, when the benefits of 1kg of P1
and that of P2 are 3US$ and 5US$ respectively?
Z=3x1+5x2
s.t. x1 + 7x2 140≦
2x1 + 4x2 100≦
3x1 + 2x2 120≦
0 x≦ 1, 0 x≦ 2
Z=3x1+5x2
s.t. x1 + 7x2 + x3 =140
2x1 + 4x2 + x4 =100
3x1 + 2x2 + x5 =120
0 x≦ 1, 0 x≦ 2 ,0 x≦ 3, 0 x≦ 4 , 0 x≦ 5
Simplex Table(1)
Z=3x1+5x2
s.t. x1 + 7x2 + x3 =140
2x1 + 4x2 + x4 =100
3x1 + 2x2 + x5 =120
0 x≦ 1, 0 x≦ 2 ,0 x≦ 3, 0 x≦ 4 , 0 x≦ 5
Marginal
B.V. Z x1 x2 x3 x4 x5
(1) Z 0 1 -3 -5 0 0 0
I (2) x3 140 0 1 7 1 0 0 140/7 = 20
(3) x4 100 0 2 4 0 1 0 100/4 = 25
(4) x5 120 0 3 2 0 0 1 120/2=60
Variable
Z - 3x1 - 5x2 =0
Simplex Table(2)
Marginal
Z x1 x2 x3 x4 x5
(1) Z 0 1 -3 -5 0 0 0
I (2) x3 140 0 1 7 1 0 0 140/7 = 20
(3) x4 100 0 2 4 0 1 0 100/4 = 25
(4) x5 120 0 3 2 0 0 1 120/2=60
(5) Z 100 1 -16/7 0 5/7 0 0 (1) - (6)× (-5)
II (6) x2 20 0 1/7 1 1/7 0 0 20/ (1/7) = 140 (2)÷7
(7) x4 20 0 10/7 0 -4/7 1 0 20/ (10/7) =14 (3)-(6)×4
(8) x5 80 0 19/7 0 -2/7 0 1 80/ (19/7)≒ 30 (4)-(6)×2
Variable
Variable
Basic
Simplex Table(3)
Marginal
Z x1 x2 x3 x4 x5
(5) Z 100 1 -16/7 0 5/7 0 0 (1) - (6)× (-5)
II (6) x2 20 0 1/7 1 1/7 0 0 20/ (1/7) = 140 (2)÷7
(7) x4 20 0 10/7 0 -4/7 1 0 20/ (10/7) =14 (3)-(6)×4
(8) x5 80 0 19/7 0 -2/7 0 1 80/ (19/7)≒ 30 (4)-(6)×2
(9) Z 132 1 0 0 -1/5 8/5 0 (5) - (11)×(-16/7)
III (10) x2 18 0 0 1 1/5 -1/10 0 18/ (1/5) =90 (6) - (11)×1/7
(11) x3 14 0 1 0 -2/5 7/10 0 (7) ÷10/7
(12) x5 42 0 0 0 4/5 -19/10 1 42/ (4/5) = 52.5 (8)-(11)×19/7
(13) Z 142.5 1 0 0 0 9/8 1/4 (9)-(16)×(-1/5)
IV (14) x2 7.5 0 0 1 0 3/8 -1/4 (10)-(16)×1/5
(15) x1 35 0 1 0 0 -1/4 1/2 (11) - (16)×(-2/5)
(16) x3 52.5 0 0 0 1 -19/8 5/4 (12)÷ 4/5
Variable
VariableBasic
1
Shadow Price (Marginal Value)
Z=3x1+5x2
s.t. x1 + 7x2 + x3 =140
2x1 + 4x2 + x4 =100
3x1 + 2x2 + x5 =120
0 x≦ 1, 0 x≦ 2 ,0 x≦ 3, 0 x≦ 4 , 0 x≦ 5
(x*, x2*, x3
*, x4 *, x5
*)=(35,7.5, 52.5, 0, 0)
Transport Problem
Transport Problem
Transport Problem (3 depots(i=1..3) & 4 customers(j=1..4))
xij [ton] : Amount of Transported Cargo from i warehouse to j department
Cij [B/ton] : Transport Cost per ton from i warehouse to j department
Si [ton] : Amount of Stock at i warehouse Cj [ton] : Amount of Consumption at j department
Transportation Cost Cij
1 2 3 41 2 1 1 32 1 1 2 33 1 2 3 1
j(S1 , S2 , S3 )=(100,200,150)(C1 , C2 , C3 , C4 )=(100,60,50,80)
Transport Problem (3 depots(i=1..3) & 4 customers(j=1..4))
Total Cost ΣCij xij= 2x11 +x12 +x13 +3x14
+x21 +x22 +2x23 +3x24
+x31 +2x32 +3x33 +x34
x11 +x21 +x31 C≧ 1 = 100x12 +x22 +x32 ≧ C2 = 60x13 +x23 +x33 ≧ C3 = 50x14 +x24 +x34 ≧ C4 = 80
x11 +x12 +x13 +x14 S≦ 1 =100
x21 +x22 +x23 +x24 S≦ 2 = 200
x31 +x32 +x33 +x34 S≦ 3 = 150
0 50 50 030 10 0 070 0 0 80
xij
Transport Problem
xij [ton] : Amount of Transported Cargo from i warehouse to j department
Cij [B/ton] : Transport Cost per ton from i warehouse to j department
Si [ton] : Amount of Stock at i warehouse Cj [ton] : Amount of Consumption at j department
Min. Σ Σ Cij ・ xij
s.t. Σ xij ≦ Si [ton] Σ xij C≦ j [ton]
DP is a mathematical technique used for the optimization of multistage decision process. In this technique, the decisions that affect the process are optimized in stage rather than simultaneously. This is done by dividing the original decision problem into small sub-problems that can be handled much more efficiently from a computational standpoint. DP is a systematic procedure for determining the combination of decisions that maximizes overall effectiveness or minimizes overall disutility. It is based on the principle of optimality enunciated by Bellman(1957).
Dynamic Programming(1)
Bellman's Principle of Optimality: An optimal policy has the property that whatever the
initial state and the initial decisions are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision.
Dynamic Programming(2)
○D.P. can be applied to problems that are ・ are non-linear. ・ have non-convex feasible region. ・ have discontinuous variables.
×D.P. is limited to dealing with problems with relatively few constraints
Example: Shortest Path
OD
DP complements LP
Queuing Theory(1)
Arrival ServiceAverage Arrival Rate λ Average Arrival Rate μProbability of k arrivals Probability of k services in t hours in t hours
Demand vs. Supply
Pn: Probability that there are n customers in the system Pn= (1- λ/μ)(λ/μ) n
Lq: Average number of customers in the queue Lq= λ 2/(μ(μ- λ))
Wq: Average time a customer spends in the queueWq= λ/(μ(μ- λ))
Pw: Probability that an arriving customer must for services
Pw= λ /μ
!
et)( λtk
k
!
et)( tk
k
Queuing Theory(2)
Arrival ServiceAverage Arrival Rate λ Average Arrival Rate μProbability of k arrivals Probability of k services in t hours in t hours
Demand vs. Supply
Pn: Probability that there are n customers in the system Pn= (1- λ/μ)(λ/μ) n
Lq: Average number of customers in the queue Lq= λ 2/(μ(μ- λ))
Wq: Average time a customer spends in the queueWq= λ/(μ(μ- λ))
Pw: Probability that an arriving customer must for services
Pw= λ /μ
!
et)( λtk
k
!
et)( tk
k
0
10
20
30
40
50
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Lq
λ /μ
Queuing Theory(3)
0
1
2
3
4
5
6
7
8
9
10
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
λ /μ
Lq
Convex Function(Strictly Convex Function)
0 dx
Z(x)d 3.
)z(x )x-(xdx
)dZ(x) Z(x2.
])Z[x-(1]Z[x ])x-(1x Z[1.
2
3131
1
2121
0 3.
)z( )-(dx
)dZ() Z(2.
])Z[-(1]Z[ ])-(1 Z[1.
t
3131
1
2121
xx
xxxx
x
xxxx
2
2
2
2
1
2
1
2
22
2
12
21
2
21
2
21
2
2 )(
MMM
M
M
x
Z
xx
Z
xx
Z
xx
Z
x
Z
xx
Z
xx
Z
xx
Z
x
Z
Z
x
Hessian Matrix
a. One variable
b. Multi variables
Report
1. Make a transportation problem on the condition that each number of shippers and customers is more than 3.
2. Solve it with Excel.
3. Make “what-if ” analysis.
By the dead line, 25th July.
Assignment