Linear Programming
Linear Programming
*part of the lecture are adopted from OPC (IE5001) lecture note ISE dept NUS
Outline
Introduction
Concerned with the determination of the best allocation of scarce resource Special condition linearity
Linear expression
2x1 + 3x2 x3 + 5
Nonlinear expression
x1 + 3x2x3 - 2
A LP model
Maximize (minimize) : c1x1 + c2x2 + + cnxn (objective function) Subject to a11x1 + a12x2 + + a1nxn b1 a21x1 + a22x2 + + a2nxn b2
am1x1 + am2x2 + + amnxn bm x1, x2, , xn 0 Where xj, j = 1,2, , n decision variable bi, I = 1,2,,m resources, m of them cj, j = 1,2,,n cost/profit coefficients aij, I = 1,2,,m; j=1,2,,n resource requirement
Constraints
Four LP assumptions
1.
2.
3.
4.
Deterministic parameter values All values of aij, cj, and bi are known with 100% of accuracy and never change Proportionality The criterion and the constraints expand or contract proportionally to the level of each activities, i.e. no economies of scale Additivity The total contribution of all activities is identical to the sum of the contribution for each activity individually, i.e. the whole is equal to the sum of its parts (joint effects or interactions are nonexistent) Divisibility Fractional levels for the decision variables are permissible
FORMULATING LP MODEL
Soal 1
Pyrotec company memproduksi 3 produk elektronik; jam, radio, dan pemanggang roti. Produk-produk tersebut membutuhkan sumber daya sebagai berikut:
Kebutuhan sumber daya Produk Jam Radio Pemanggang roti Biaya/unit ($) 7 10 5 Waktu tenaga kerja/unit (jam) 2 3 2
Anggaran produksi harian sebesar $2,000 dan tenaga kerja yang tersedia sebanyak 600 jam. Permintaan pelanggan harian maksimum sebanyak 200 jam, 300 radio, dan 150 pemanggang roti. Jam dijual seharga $15, radio seharga $20, dan pemanggang roti seharga $12. Tentukan production mix yang optimal untuk memaksimumkan profit
Soal 2
Perusahaan barang tembikar memproduksi 2 jenis produk tiap hari yaitu cangkir dan mangkok. Perusahaan mempunyai 2 sumber daya yang terbatas jumlahnya untuk memproduksi produk produk tersebut yaitu tanah liat dan tenaga kerja. Dengan keterbatasan sumber daya tersebut perusahaan ingin mengetahui berapa banyak mangkok dan cangkir yang dapat diproduksi tiap hari yang akan memaksimumkan laba. Data kebutuhan sumber daya tiap produk terdapat dalam table berikut:
Tersedia 40 jam tenaga kerja dan 120 pon tanah liat setiap hari untuk produksi.
Soal 3
Perusahaan penerbit Agensi menerbitkan 2 jenis majalah bulanan, yaitu majalah Restoran dan Perumahan. Perusahaan mendistribusikan majalah-majalahnya secara gratis ke hotel-hotel, pertokoan di wilayah tertentu. Keuntungan perusahaan didapatkan sepenuhnya dari iklan di majalah tersebut. Setiap eksemplar majalah Restoran memberikan keuntungan $ 0,5. Sedangkan majalah Perumahan $ 0,75 per eksemplarnya. Majalah Perumahan mempunyai desain yang lebih mewah dengan biaya pencetakan $ 0,25 per eksemplar, sementara biaya pencetakan majalah Restoran $ 0,15 per eksemplar. Total anggaran bulanan perusahaan $ 4000. Kapasitas rak penyimpanan sementara di gudang adalah 18000 eksemplar/bulan. Sesuai perjanjian dengan pemasang iklan, sirkulasi tiap majalah harus dipertahankan minimal 8000 eksemplar per bulan. Perusahaan mencoba menghitung berapa banyak jumlah majalah harus dicetak tiap bulannya dengan tujuan memaksimalkan pendapatan. Formulasikan problem tersebut ke dalam bentuk Linear Programming.
Soal 4
A company has excess production capacity on three types of machines which can be used to make two products A and B Data
A Machining Boring Polishing Selling price Cost of material 25 units/hr 28 units/hr 35 units/hr $5/unit $2/unit B 40 units/hr 35 units/hr 25 units/hr $6/unit $3/unit Cost/hr 20 14 17.5
Soal 4 (contd)
Problems: 1. How should the excess capacity on machines be used to maximize profit?
2.
3.
Crude 1 2 3 4
Cost/barrel 3 6 4 5
Soal 5 (contd)
Blending requirements:
Oil A
Not more than 30% of 1 Not less than 40% of 2 Not more than 50% of 3 Not more than 50% of 1 Not less than 10% of 2 Not more than 70% of 1
Oil B
Oil C
Soal 5 (contd)
Selling price
Problem: what blends of crude should be used to make each grade of oil in order to maximize profit subject to quantities available and blending requirements?
Graphical solution
Find all pairs of (x1, x2) which satisfy each constraint separately Find all pairs of (x1, x2) which satisfy all constraints. That is, find set of feasible solutions Choose the one which gives the max value of objective function
There is no upper limit on the value which the objective function can assume Error in formulation
More than one combination of values of decision variables will result in the optimal solution for the objective function Choose one solution based on qualitative consideration Objective function parallel to one of the binding constraints
Simplex method
2.
Find some feasible corner points and calculate z While z can be improved by moving to an adjacent corner point
Select the adjacent corner point giving the greater rate of improvement in z Calculate the coordinates of the new point and new z value
3.
Stop
x1
-7 5 2
x2
-10 4 5
s1
0 1 0
s2
0 0 1
RHS
0 24 13
Ratio
24/4=6 13/5=2.6
X2
2/5
1/5
13/5
(13/5)/(2/5)=6.5
Gauss-Jordan Elimination
New value = old value (new value of element in the pivot row in the respective column)(old value of the pivot column in the respective row) Example: cell s1 x1 new value = 5 (2/5)(4) = 17/5
X1
X2
1
0
0
1
5/17
-2/17
-4/17
5/17
4
1
Since all the coefficients in Row (0) are now all non-negative, the current solution is optimal
Simplex summary
At each iteration, all variables are partitioned into 2 classes as shown below:
max
Subject to :
z cjxj
j 1
a x
j 1 ij
si bi j 1,...,n
i 1,2,...,m
x j 0,
If bi are all 0, then an initial feasible solution can be obtained as follows: xj = 0, j=1,,n si = bi, i=1,,m
r1
S2
5
2
4
5
-1
0
0
1
1
0
24
13
24/5=4.8
13/2=6.5
Iteration 2:
Basic Z x1 S2 x1 0 1 0 x2 0 4/5 17/5 s1 0 -1/5 2/5 s2 0 0 1 r1 1 1/5 -2/5 RHS 0 24/5 3.4
The solution to the Phase-I LP problem is now optimal. Hence we have obtained a basic feasible solution to the original LP problem
x1
S2
1
0
4/5
17/5
-1/5
2/5
0
1
4.8
3.4
4.8/0.8=6
3.4/3.4=1
x1
s1
1
0
5/2
17/2
0
1
5/2
6
17/2
Since all the coefficients in Row(0) are now all nonnegative, the current solution to the Phase-II LP problem is optimal.
Duality
Primal Problem: max z = 7x1+ 10x2 subject to y1: 5x1+ 4x2 24 y2: 2x1 + 5x2 13 x1 , x2 0 Dual Problem: min w = 24y1+ 13y2 subject to x1: 5y1+ 2y2 7 x2: 4y1 + 5y2 10 y1 , y2 0
xj 0
xj unrestricted
Mathematically very important Computationally One model (with fewer constraints) is easy to solve
Primal
Dual
3. Economic interpretation of the dual variable (shadow price) Shadow price of constraint I gives the rate of change in the objective function per unit change in the RHS value of the constraints. That is, Shadow price of constraints i = z/ bi = Dual variable yi
The value of the slack or artificial coefficient in the objective function row in the final optimal primal tableau gives the optimal value of the associated dual variable. Complementary slackness
Product of the jth decision variable and jth dual slack = 0 ith slack variable ith dual variable = 0 at optimal If si > 0 then yi = 0 If yi > 0 then si = 0
Sensitivity analysis
Sensitivity analysis is to answer the following question: How does the optimal solution change as a coefficient is varied from its given value? Why sensitivity analysis is important? Many coefficients are estimated Want to know the sensitivity of the optimal solution with respect to these coefficients.
Basic Z x1 s2
x1 0 1 0
x2 6 4/5 17/5
s1 4 1/5 -2/5
s2 0 0 1
Basic Z
x1 s2
x1 0
1 0
x2 6-
4/5 17/5
s1 4
1/5 -2/5
s2 0
0 1
RHS 96
24/5 17/5
Hence, the existing basic will remain optimal as long as 6 0 6 In other words, the solution will remain optimal as long as c2 16
If c2 > 16, then Row(0) coefficient for x2 becomes negative and x2 would enter the solution and s2 would become non-basic
Basic Z x1 s2
x1 0 1 0
x2 6 4/5 17/5
s1 4 1/5 -2/5
s2 0 0 1
It follows that
-17/5 or b2 9.6
For the type constraint: RHS + col of si For the type constraint: RHS - col of si For the = type constraint: RHS + col of ri
The range of can be determined by solving a set of simple linear inequalities associated with the new RHS values in rows 1 to m.