You are on page 1of 4

30-Mar-20

❖ To solve problems
▪ Finance, Planning, Control, Design, Management, Resourcing
▪ To HELP
• Maximise profits, or
MTES3113 • Minimise costs
❖ Decision variables
▪ Number of each things that can be varied
❖ Objection function:
Linear Programming/ -aim of the problem
Pengaturcaraan Linear -2 parts
• Maximise/ minimise
• Algebraic expression as an equation
❖ Constraints
▪ Each constraint will give rise to one inequality

@DL IPGKPP 2020 @DL IPGKPP 2020

1 2

❖ If you find values for the decision variables that


satisfy each constraint you have a FEASIBLE
solution
▪ Graphical method give you a REGION that contains ALL the
feasible solutions which is known as the FEASIBLE REGION
▪ Optimal solution is the feasible solution that meets the
objective (maximise or minimise) ❑ L1: Let f be the number of fruit cakes
▪ Might be more than one optimal solution c be the number of chocolate cakes
❖ Formulate a problem as a LP problem ❑ L2: Maximise P = 3.5f + 5c
1) Define the decision variables (x, y, z, etc) subject to:
2) State the objective function (there are 2 parts) ❑ L3: f+2c ≤ 36 Eggs constraint
Flour constraint-
3) Write the constraints as inequalities 250f + 250c ≤ 7000
unit must be the same
4) Non-negativity rule 200f + 300c ≤ 6000 throughout
Sugar constraint

❑ L4: f, c ≥ 0
@DL IPGKPP 2020 @DL IPGKPP 2020

3 4

Let f be the number of fruit cakes


c be the number of chocolate cakes
Maximise P = 3.5f + 5c
subject to:
f+2c ≤ 36
f + c ≤ 28 Biar f bilangan kek buah-buahan Let x be the number of children
2f + 3c ≤ 60 c bilangan kek coklat y be the number of adults
f, c ≥ 0 Maksimumkan P = 3.5f + 5c Maximise P = 50x + 100y
Tertakluk kepada: subject to:
f+2c ≤ 36 x+y ≤ 90
f + c ≤ 28 y ≤ 40
2f + 3c ≤ 60 7x + 5y ≤ 600
f, c ≥ 0 2x + 6y ≤ 300
x, y ≥ 0
@DL IPGKPP 2020 @DL IPGKPP 2020

5 6

1
30-Mar-20

Biar x bilangan orang kanak-kanak Biar a bilangan produk A


y bilangan orang dewasa b bilangan produk B
Maksimumkan P = 3.5f + 5c c bilangan produk C
Tertakluk kepada: Maksimumkan Z = 3a + 5b + 4c
x+y ≤ 90 Tertakluk kepada:
y ≤ 40 2a+3b ≤8
7x + 5y ≤ 600 3a+2b+4c ≤ 15
2x + 6y ≤ 300 2b+5c ≤ 10
x, y ≥ 0 a, b, c ≥ 0
@DL IPGKPP 2020 @DL IPGKPP 2020

7 8

❖ Meant for only 2 decision variables ❖ The convention:


❖ All the constraints inequality are converted to linear ▪ Shade the region that does NOT satisfy the inequality
equation to form straight lines. ▪ The feasible region, R, will therefore be the one left unshaded (satisfying
several inequalities)
❖ Straight lines MUST be drawn with a ruler
❖ Each straight line has THREE region
R

❖ Locate the optimal point in a feasible region


▪ 2 methods
▪ Method 1-Using the objective line(ruler) method
▪ Identify the feasible region, R, using line graphs and shading
▪ R are all potential solutions to the linear problem
▪ Maximum point, look for the last point covered by an objective line as it leaves
Inequalities using < or > are represented by a dotted line the feasible region
❖ Meaning the line itself is NOT included ▪ Minimum point, look for the first point covered by an objective line as it enters
the feasible region
Inequalities using ≥ or ≤ are represented by a solid line
❖ Meaning the line itself IS included @DL IPGKPP 2020
@DL IPGKPP 2020

9 10

❖ Objective line method:


▪ Ruler is kept parallel to an objective line Let f be the number of fruit cakes
▪ Use two straight edges c be the number of chocolate cakes
Maximise P = 3.5f + 5c
subject to:
f+2c ≤ 36
f + c ≤ 28 Biar f bilangan kek buah-buahan
2f + 3c ≤ 60 c bilangan kek coklat
f, c ≥ 0 Maksimumkan P = 3.5f + 5c
Tertakluk kepada:
f+2c ≤ 36
❖ Vertex testing method f + c ≤ 28
▪ 2nd method
2f + 3c ≤ 60
• Find coordinates of each vertex of the feasible region
• Evaluate the objective function at each of these points f, c ≥ 0
• Select the vertex that gives the optimal value of the objective function

@DL IPGKPP 2020


@DL IPGKPP 2020

11 12

2
30-Mar-20

❖ Graphical method only suitable for 2 variables 2. Use slack variables


❖ For more than 2 variables we use simplex method ✓ Transform inequalities into EQUATIONS

1. Formulate as a linear programming Let f be the number of fruit cakes


problem c be the number of chocolate cakes
✓ Example
Let f be the number of fruit cakes Maximise P - 3.5f - 5c = 0
c be the number of chocolate cakes subject to:
Maximise P = 3.5f + 5c f+2c + r = 36
subject to: f + c + s = 28
f+2c ≤ 36 2f + 3c + t = 60
f + c ≤ 28 f, c, r, s, t ≥ 0
2f + 3c ≤ 60
3. Solve LP using tableaux
f, c ≥ 0

2. Use slack variables


Inequalities to equations
@DL IPGKPP 2020
@DL IPGKPP 2020

13 14

4. Tableau 1 Tableau 2
Basic f c r s t Value θ Row
Basic f c r s t Value θ Row Variable operations
Variable operations

❑ Use the pivot row to eliminate the pivot’s variable from the other row. (This means
that the pivot column now contains one 1 and zeros)
5. Look along the objective row for the most negative ❑ REPEAT until no more NEGATIVE numbers in the objective row (what you get is
entry and this indicate the PIVOT column Let f be the number of fruit cakes then the optimal tableau)
❑ Calculate θ for each row, c be the number of chocolate
cakes
❑ Θ = (the term in value column) ÷ Maximise P - 3.5f - 5c = 0
subject to:
Basic f c r s t Value θ Row
(the term in the pivot column) f+2c + r = 36 Variable operations
f + c +s = 28
❑ Select the row with the smallest, positive values to 2f + 3c + t = 60
r 1 2 1 0 0 36 36/2=18 R1÷2
f, c, r, s, t ≥ 0
becomes the pivot row
s 1 1 0 1 0 28 28/1=28
❑ The element in the pivot row and pivot column is the pivot (in this case pivot is 2)
❑ Divide the row by the pivot and change the basic. This is now the pivot row t 2 3 0 0 1 60 60/3=20
@DL IPGKPP 2020
P -3.5 -5 0 0 0 0 @DL IPGKPP 2020

15 16

Tableau 4
Basic f c r s t Value θ Row Basic f c r s t Value θ Row
Variable operations Variable operations

Tableau 3

❑ No more NEGATIVE numbers in the objective row.


❑ Optimal solution is Maximum P =104, c = 4 dan f =24
❑ (i.e. 4 chocolate cake and 24 fruit cake)

Basic f c r s t Value θ Row Basic f c r s t Value θ Row


Variable operations Variable operations
c 1/2 1 1/2 0 0 18 18÷1/2 c 0 1 2 0 -1 12 12/2
s 1/2 0 -1/2 1 0 10 10÷1/2 s 0 0 1 1 -1 4 4/1 R2 x 1
t 1/2 0 -3/2 0 1 6 6÷1/2 R3÷ 1/2 f 1 0 -3 0 2 12 --
P -1 0 5/2 0 0 90 @DL IPGKPP 2020 P 0 0 -1/2 0 2 102 @DL IPGKPP 2020

17 18

3
30-Mar-20

1. Big-M method
2. Two Phase Simplex

❑ When to use it?


❑ How to use it?

@DL IPGKPP 2020

19

You might also like