Business Maths..Linear Programming 2
Business Maths..Linear Programming 2
Business Maths..Linear Programming 2
• Maximize/Minimize
(Objective Function )
Subject to
Constraints
(equalities,inequalities)
Constraints
1. Limitations of Funds
2. quantity of raw materials
available,
3. the level of demand for the
products,
4. the equipment productive
Capacity
Time Period
A further element is the time period being
used. The duration may be either long
term or short term. Although time is an
important element, it is one that has
flexibility so that the time horizon may
be changed as long as the restrictions
are compatible with the periods under
consideration.
Non Negative Constraints
• Some elements which will remain non
negative. e.g
– Cricket Stadium
– Buses in transport
– Furniture ( Like Chairs) etc.
Feasible Solution
• Any solution that satisfy all the
constraints of the model constitute
a feasible solution.
Example 1
• The Decent China Company produces
two products daily; plates and mugs.
The company has limited amounts of
two resources used in the production of
these products. i.e. clay and labor. Given
these limited resources, the company
desires to know how many plates and
mugs are required to produce each day,
in order to Maximize the profit
Cont…
Products Labor Clay Profit
Hrs/unit lbs/unit Rs / unit
Plates 1 4 4
Mugs 2 3 5
6 x1 + 4 x2 <= 24
x1 + 2 x2 <= 6
- x1 + x2 <= 1
x2 <= 2
X1, X2 >= 0
Example2 Cont…
• The Final Model is:
Maximize the profit
Z = 5 x1 + 4 x2
Subject to
6 x1 + 4 x2 <= 24
x1 + 2 x2 <= 6
- x1 + x2 <= 1
x2 <= 2
X1, X2 >= 0
Example 3 - Ingredients Mixing
• ALICO produces a cereal SUNFLOWER which they
advertise as meeting the minimum daily
requirements for vitamins A and D. The mixing
department of the company uses three main
ingredients in making the cereal-wheat,
oats(cholestrol-fighting soluble fibre) , and rice.
All three of which contain amounts of vitamin A
and D. Given that each box of cereal must contain
minimum amounts of vitamin A and D, the
company has instructed the mixing department
determine how many ounces of each ingredient
should go into each box of cereal in order to
minimize total cost.
Ingredients Mixing Cont…
• Each ingredient has the following vitamin
contribution and requirement per box.
• Also each ingredient contributes a number
of milligrams of the vitamin to the cereal.
• The cost of one ounce of wheat is Rs 0.4, oats
is Rs 0.6, rice is Rs 0.2
A 10 20 08 100
D 07 14 12 70
Ingredients Mixing Cont…
• Decision variables
– Let
X1 = ounces of wheat
X2 = ounces of oats
X3 = ounces of rice
• Objective Function
Min Cost
Z = Rs. 0.4X1 + 0.6X2 + 0.2X3
Ingredients Mixing Cont…
• Constraints
The constraint for vitamin A is
• Decision Variable
X1 = No. of soldiers produced/week
X2 = No. of trains produced/week
• Objective Function
Z = 3X1 + 2X2
Giapetto’s Woodcarving Cont…
• Constraints
2 X1 + X2 <= 100 (Finishing contrain)
X1 + X2 <= 80 (carpentry)
X1 <= 40
X1, X2 >= 0
Giapetto’s Woodcarving Cont…
• Final Mathematical Model:
• Maximize Objective Function
Z = 3X1 + 2X2
Subject to constraints
2 X1 + X2 <= 100 (Finishing contrain)
X1 + X2 <= 80 (carpentry)
X1 <= 40
X1, X2 >= 0
Giapetto’s Woodcarving Cont…
Trains 1 1 2
Graphical Solution to LP Models
For two variables only:
2) Finding feasible Solution Space
• Convert all inequalities into equations
• Name the axes in coord. Plane as decision
variables
• Draw these equations one by one in 2D plane.
• Each equation will divide the coord. Plane in
two halves.
• Select reference point in 2D plane, moslty
origin (0, 0).
Graphical Solution to LP Models Cont…
• Test the reference point into inequality, if
satisfied, then the half containing ref. Point will
be the feasible side, otherwise opposite side will
be feasible space.
• If line passes through origin, select any other
point as reference.
1) Compute corner points of solution space
• As every point is an intersection of two
equations.
Graphical Solution to LP Models Cont…
1) Finding Optimum Solution
• Draw isoprofit/isocost line by choosing
atleast two points in feasible region and
compute its Z-value.
• It will indicate the direction of Z, either
increasing or decreasing
• Draw all isoprofit lines by moving parallel to
it in the increasing/decreasing direction of Z.
• Keep moving isoprofit line untill we reach at
corner point, beyond which any further
increase in Z will put us outside the optimum
solution space
Graphical Solution to LP Models Cont…
Trucks 40 50 300
Alter. optimal Solution cont…
• Max Z = 300 X1 + 200 X2
(for paint shop)
Since, 60 cars produced = 1 day
1 car produced = 1 / 60 days
(fraction of day)
similarly,
40 trucks produced = 1 day
1 truck produced = 1 / 40 days
(fraction of day)
Alter. optimal Solution cont…
(for body assembly shop)
Since, 50 cars produced = 1 day
1 car produced = 1 / 50 days
(fraction of day)
similarly,
50 trucks produced = 1 day
1 truck produced = 1 / 50 days
(fraction of day)
Alter. optimal Solution cont…
• Constraints
1 / 40 X1 + 1 / 60 X2 <= 1
(Paint shop constraint)
1 / 50 X1 + 1 / 50 X2 <= 1
(Body assembly shop constraint)
Alter. optimal Solution cont…
• Final Model is:
Max Z = 300 X1 + 200 X2
Subject to
3 X1 + 2 X2 <=120
(Paint shop constraint)
1 X1 + 1X2 <= 50
(Body assembly shop constraint)
X1 >= 0
X2 >= 0
Alter. optimal Solution cont…
2. Infeasible LP
• Feasibility Condition
– For both the max. and min. problems, the
leaving variable is the basic variable associated
with the smallest non-negative ratio (with
strictly positive denominator)
– Ties are broken arbitrarily.
The Simplex Algorithm
1) Convert the LP to standard form and then into
tableau form.
2) Find the starting basic feasible solution.
3) Determine whether the current bfs is
optimal(using optimality condition select an
entering variable). Stop, if there is no entering
variable; last solution is optimal.
4) Select a leaving variable using the feasibility
condition.
5) Determine the new basic solution by using
appropriate Gauss-Jordan computations.
6) Go To step 3.
Example: Simplex Algorithm
• Reddy Mikks Paints: Interior and Exterior
• Maximize Z = 5x1 + 4x2
Subject to
6x1 + 4x2 <= 24
x1 + 2x2 <= 6
-x1 + x2 <= 1
x2 <= 2
x1 >= 0
x2 >= 0
Example: Simplex Algorithm Cont…
• Standard form of Reddy Mikks model is:
• Maximize Z=5x1+4x2+0s1+0s2+0s3+0s4
Subject to
6x1 + 4x2 + s1 = 24
x1 + 2x2 + s2 = 6
-x1 + x2 + s3 = 1
x2 + s4 = 2
x1, x2,s1,s2,s3,s4 >= 0
NBV(zero):{x1,x2} ; BV:{s1,s2,s3,s4}
Example: Simplex Algorithm Cont…
• Tableau form:
Basi Z X1 X2 S1 S2 S3 S4 Solu Ratio
c .
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24 4
S2 0 1 2 0 1 0 0 6 6
S3 0 -1 1 0 0 1 0 1 -1
S4 0 0 1 0 0 0 1 2 infinit
Example: Simplex Algorithm Cont…
• NBV ={s1,x2} ; BV={x1,s1,s2,s3}
basic Z X1 X2 S1 S2 S3 S4 Sol. ratio
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4 4
S2 0 0 4/3 -1/6 1 0 0 2 6
S3 0 0 5/3 1/6 0 1 0 5 -1
S4 0 0 1 0 0 0 1 2 Inf.
Example: Simplex Algorithm Cont…
basi Z X1 X2 S1 S2 S3 S4 Sol. ratio
c
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4 6
S2 0 0 4/3 -1/6 1 0 0 2 1.5
S3 0 0 5/3 1/6 0 1 0 5 3
S4 0 0 1 0 0 0 1 2 2
Example: Simplex Algorithm Cont…
Z 1 0 0 3/4 ½ 0 0 21
X1 0 1 0 ¼ -1/2 0 0 3
X2 0 0 1 -1/8 ¾ 0 0 3/2
S3 0 0 0 3/8 -5/4 1 0 5/2
S4 0 0 0 1/8 -3/4 0 1 ½
Alternative Optimal Solutions in Simplex Algorithm
• Maximize Z = 60x1+35x2+20x3
Subject to
8x1+6x2+x3 <= 48
4x1+2x2+1.5x3 <= 20
2x1+1.5x2+0.5x3 <= 8
x2 <= 5
x1,x2,x3 >= 0
Basic and Non Basic Variables
• After the Gauss Jordan method has been
applied to any linear system, a variable that
appears with a coefficient of 1 in a single
equation and a coefficient of 0 in all other
equations is called a basic variable.
• Any variable that is not basic is called Non-
basic variable.
Alternative Optimal Solutions in Simplex Algorithm
• Maximize Z = 60x1+35x2+20x3
Subject to
8x1+6x2+x3+S1 = 48
4x1+2x2+1.5x3+S2 = 20
2x1+1.5x2+0.5x3+S3 = 8
x2 +S4= 5
x1,x2,x3,S1,S2,S3,S4 >= 0
Alternative Optimal Solutions in Simplex Algorithm
• BV={S1,S2,S3,S4} NBV={X1,X2,X3}
BV={S1,S2,X1,S4} NBV={S3,X2,X3}
Bas Z X1 X2 X3 S1 S2 S3 S4 Sol Rat
Z 1 0 10 -5 0 0 30 0 240
S1 0 0 0 -1 1 0 -4 0 16
S2 0 0 -1 .5 0 1 -2 0 4
X1 0 1 .75 .25 0 0 .5 0 4
S4 0 0 1 0 0 0 0 1 5
Alternative Optimal Solutions in Simplex Algorithm
BV={S1,S2,X1,S4} NBV={S3,X2,X3}
Z 1 0 10 -5 0 0 30 0 24
0
S1 0 0 0 -1 1 0 -4 0 16 -16
S2 0 0 -1 .5 0 1 -2 0 4 8
X1 0 1 .75 .25 0 0 .5 0 4 16
S4 0 0 1 0 0 0 0 1 5 Inf.
Alternative Optimal Solutions in Simplex Algorithm
BV={S1,X3,X1,S4} NBV={S3,X2,S2}
Bas Z X1 X2 X3 S1 S2 S3 S4 Sol Rat
Z 1 0 0 0 0 10 10 0 280
S1 0 0 -2 0 1 2 -8 0 24
X3 0 0 -2 1 0 2 -4 0 8
X1 0 1 1.25 0 0 -0.5 1.5 0 2
S4 0 0 1 0 0 0 0 1 5
Alternative Optimal Solutions in Simplex Algorithm
Question
• How to determine, there exist a unique solution?
Answer
• If there is no non-basic variable with a zero
coefficient in row 0 of the optimal tableau then
the LP has a unique optimal solution.
– Even if there is non-basic variable with zero
coefficient in row 0 of the optimal tableau, it is
possible that the LP may not have alternative optimal
solutions.
Alternative Optimal Solutions in Simplex Algorithm
BV={S1,X3,X1,S4} NBV={S3,X2,S2}
Z 1 0 0 0 0 10 10 0 280
S1 0 0 -2 0 1 2 -8 0 24
X3 0 0 -2 1 0 2 -4 0 8
X1 0 1 1.25 0 0 -0.5 1.5 0 2 1.6
S4 0 0 1 0 0 0 0 1 5 5
Alternative Optimal Solutions in Simplex Algorithm
BV={S1,X3,X2,S4} NBV={S3,X1,S2}
Bas Z X1 X2 X3 S1 S2 S3 S4 Sol Rat
Z 1 0 0 0 0 10 10 0 280
Z 1 -36 -30 3 4 0 0 0
S1 0 1 1 -1 0 1 0 5 5
S2 0 6 5 0 -1 0 1 10 5/3
Unbounded LPs with Simplex Cont…
• BV={S1, X1} NBV = {S2, X2, X3, X4 }
Z 1 0 0 3 -2 0 6 60
Z 1 0 0 3 -2 0 6 60
Z 1 0 2 -9 0 12 4 100
X4 0 0 1 -6 1 6 -1 20 Neg
X1 0 1 1 -1 0 1 0 5 Neg
Unbounded LPs with Simplex Cont…