Simplex Method Final
Simplex Method Final
LINEAR
PROGRAMMING
A Mathematical Optimization Technique
WHAT IS LINEAR PROGRAMMING?
Definition:
A mathematical method for optimizing a linear objective function
subject to linear constraints.
Purpose:
To determine the best outcome, such as maximum profit or minimum
cost, given limited resources and specific requirements.
Linear programming provides a systematic approach to making
optimal decisions when facing constraints in business, engineering,
and scientific applications.
Example
A furniture company manufactures desks and chairs. Each desk requires 4 hours
of labor and 3 kg of wood. Each chair requires 2 hours of labour and 2 kg of wood.
The company has 300 labor hours and 175 kg of wood available per week. A desk
earns a profit of Rs. 4,000 and a chair earns Rs.2,[Link] many desks and chairs
should the company produce to maximize profit?
Profit (Rs) 40 25 ?
KEY COMPONENTS
The Simplex Method: A powerful algorithmic approach developed by George Dantzig that
systematically examines vertices of the feasible region to find the optimal solution. It
efficiently handles problems with many variables and constraints, making it the standard
method for large-scale linear programming problems.
Graphical Method
5 main steps for solving a linear programming problem, by using the graphical method
1. Place all the necessary information into a net and organized table
2. Find out what has to be maximized or minimized and in most cases it is the profit or cost. Then
write the profit/cost equation.
3. Find the variables of the problems and what parts can be controlled. These equation are known
as the constraints.
4. Once the contains have been established, plot them on a graph to find the vertices of the linear
functions
5. After the graph is drawn, the vertices of the graph will tell you the maximum or minimum of the
system by plugging them into the profit/cost function.
Worked Example 1
A magazine company sells two main types of magazines; Healthwise sells for $12 and Superteen sells for
$10. it costs the company $9 to produce Healthwise and $8 to produce Superteen. In a week publishing
company can print 200-300 copies of Healthwise and 100-250 copies of Superteen, but no more than 500
copies in total. How many of each type shoul be printed in order for the company to make maximum
profit.
Vertex Profit
Constraints :200 ≤ 𝑥 ≤ 300
(200,100) 800
100 ≤ 𝑦 ≤ 250 (200,250) 1100
(300,200) 1300
(300,100) 1100
Worked Example 2
A window manufacturing company makes two types of windows, regular and heavy-duty. Each regular
window takes approximately 2 hrs to cut and 1hour to finish. The heavy-duty windows take 1 hour to cut
and 3 hrs to finish. Each regular window makes net profit of $80 and the heavy-duty window makes a net
profit of $200. If 4 cutting and 3 finishing workers are used 10 hours per day, how many of each window
should be made for the company to make a maximumum profit?
Regular (x) Heavy-duty (y)
Cutting hrs 2 1
Finishing hrs 1 3
workers 4 3
Graphical Method
Variables : Regular 𝑥 , Heavy-duty (𝑦)
The objective is to find the maximum profit
Objective function: 𝑧 = 80𝑥 + 200𝑦
Vertex Profit
(0,0) 0
Constraints :2x + y ≤ 4 × 10
(0,10) 2000
x + 3y ≤ 3 × 10 (18,4) 2240
(20,0) 1600
Worked Example 3
The liquid potion of a diet is to provide at least 300 calories, 36 units of vitamin A, and 90 units of vitamin C
daily. A cup of dietary drink X provided 60 calories, 12 units of vitamin A and 10 units of vitamin C. A cup of
dietary drink Y provides 60 calories , 6 units of vitamin A, and 30 units of vitamin C. Now suppose that
dietary drink X costs $0.12 per cup and drink Y costs $0.15 per cup. How many cups each drink should be
consumed each day to minimize the cost and still mee the given daily requirement?
Worked Example 3
The liquid potion of a diet is to provide at least 300 calories, 36 units of vitamin A, and 90 units of vitamin C daily. A cup of dietary drink X provided 60 calories,
12 units of vitamin A and 10 units of vitamin C. A cup of dietary drink Y provides 60 calories , 6 units of vitamin A, and 30 units of vitamin C. Now suppose that
dietary drink X costs $0.12 per cup and drink Y costs $0.15 per cup. How many cups each drink should be consumed each day to minimize the cost and still
mee the given daily requirement?
X 60 12 10 0.12
Y 60 6 30 0.15
Minimum 300 36 90 ??
Requirement
Graphical Method Drink Calories Vitamin A Vitamin C Cost ($)
X 60 12 10 0.12
Variables : Drink 𝑋 𝑥 , Drink 𝑌 (𝑦)
Y 60 6 30 0.15
12𝑥 + 6𝑦 ≥ 36 ⇒ 2𝑥 + 𝑦 ≥ 6
10𝑥 + 30𝑦 ≥ 90 ⇒ 𝑥 + 3𝑦 ≥ 9
Graphical Method
Objective function: 𝑧 = 0.12𝑥 + 0.15𝑦
𝑥+𝑦 ≥5
(3,2) 0.66
(9,0) 1.08
THE SIMPLEX METHOD
The algorithm works by moving along the vertices (corner points) of the
feasible region, testing each for optimality. At each iteration, it identifies
an adjacent vertex with a better objective function value until the optimal
solution is found. This systematic approach guarantees finding the
optimal solution when one exists.
SLACK VARIABLES
Definition: Variables added to ≤ constraints to convert inequalities into equalities.
Purpose: Slack variables measure the amount of unused resources in a constraint. When
𝑠₁ = 0, the constraint is binding (fully utilized). When 𝑠₁ > 0, there is "slack" or leftover
capacity.
Key Insight: Slack represents the difference between what is available and what is used.
SURPLUS VARIABLES
𝑥 + 𝑦 + 𝑠1 = 4
2𝑥 + 𝑦 + 𝑠2 = 5
𝑧 − 3𝑥 − 2𝑦 = 0
PIVOTING
Choosing the pivot involves two steps:
Basi 𝒙 𝒚 𝒔𝟏 𝒔𝟐 RHS
Look at the objective row (usually the last row of the simplex tableau). 𝒛
𝒔𝟐 2 1 0 1 5
-3 -2 0 0 0
Select the column with the most negative coefficient in the objective row.
• Choosing the leaving variable (pivot row)
RHS
𝒔𝟐 2 1 0 1 5
The intersection cell of the above column and row is the pivot value 𝒛 -3 -2 0 0 0
PIVOTING
Basi 𝒙 𝒚 𝒔𝟏 𝒔𝟐 RHS
Divide the entire pivot row by the pivot value. s
𝒔𝟏 1 1 1 0 4
Basis 𝒙 𝒚 𝒔𝟏 𝒔𝟐 RHS 𝒔𝟐 2 1 0 1 5
𝒛 -3 -2 0 0 0
𝒔𝟏 1 1 1 0 4
𝒛 -3 -2 0 0 0 Basis 𝒙 𝒚 𝒔𝟏 𝒔𝟐 RHS
Eliminate all the other values from the pivot column 𝒙 1 0.5 0 0.5 2.5
𝒚 0 1 2 -1 3 𝒔𝟏 0 1 2 -1 3
𝒙 1 0 -1 1 1 𝒙 1 0.5 0 0.5 2.5
𝒛 0 0 1 1 9 𝒛 0 -0.5 0 1.5 7.5
Basis RHS
The Solution
𝒚 3
𝒙 1 𝑥 = 1, y=3
𝒛 9
A pottery company produces bowls 𝑥 and mugs 𝑦 from labor and clay. Let
the selling price of a bowl is 40 and mug is 50 in units ($,Rs. Etc) . A bowl
needs one hour of labor and 4Kg of clay while a mug needs 2 hour of labor and
3kg of clay. Suppose maximum labor hours per day is 40 and available clay is
120 Kg. Find the number of bowls and mugs to manufacture for the maximum
profit.
A pottery company produces bowls
Basis Bowl (𝒙) Mug Available
𝑥 and mugs 𝑦 from labor and clay. Let
the selling price of a bowl is 40 and mug (𝒚)
is 50 in units ($,Rs. Etc) . A bowl needs
one hour of labor and 2Kg of clay while a
Labor (hrs) 1 2 40
mug needs 2 hour of labor and 3kg of
Clay (Kg) 4 3 120
clay. Suppose maximum labor hours per
day is 40 and available clay is 120 Kg. Price (units) 40 50
Find the number of bowls and mugs to
manufacture for the maximum profit.
𝑥 ≥ 0, 𝑦 ≥ 0 𝑥 ≥ 0, 𝑦 ≥ 0
𝑥 + 2𝑦 + 𝑠1 = 40
4𝑥 + 3𝑦 + 𝑠2 = 120
𝑧 − 40𝑥 − 50𝑦 = 0
𝒔𝟏 1 2 1 0 40
𝒔𝟐 4 3 0 1 120
𝒛 -40 -50 0 0 0
Basis (𝒙) (𝒚) 𝒔𝟏 𝒔𝟐 RHS Basi (𝒙) (𝒚) 𝒔𝟏 𝒔𝟐 RHS
RHS s
𝒔𝟏 1 2 1 0 40 20 𝒔𝟏 1 2 1 0 40
𝒔𝟐 4 3 0 1 120 40 𝒔𝟐 4 3 0 1 120
𝒛 -40 -50 0 0 0
𝒛 -40 -50 0 0 0
𝑧 = 40 × 24 + 50 × 8
𝑠2 = 0, 𝑠1 = 0
𝒛 = 𝟏, 𝟑𝟔𝟎
Worked Example 3:
The following table is given the time allocation for each stage and the profit
earns by each sensor node.
Determine how many of each sensor node should be produce to obtain the
maximum profit
4𝑥1 + 2𝑥2 + 𝑥3 ≤ 60 (thousands) 4𝑥1 + 2𝑥2 + 𝑥3 + 𝑠1 = 60
𝑥1 + 3𝑥2 + 2𝑥3 ≤ 60 𝑥1 + 3𝑥2 + 2𝑥3 +𝑠2 = 60
𝑥1 + 𝑥2 + 𝑥3 ≤ 24 𝑥1 + 𝑥2 + 𝑥3 +𝑠3 = 24
𝑃𝑖𝑣𝑜𝑡 𝐶𝑜𝑙𝑢𝑚𝑛
BV 𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 𝑠3 RHS BV 𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 𝑠3 RHS
𝑠1 4 2 1 1 0 0 60 𝑠1 10/3 0 −1/3 1 -1/3 0 20
RHS
Both 𝑥1 and 𝑥3 can consider as entering 6
variables. Hence, choose either one 60
6
Answer: (8,000, 12,000, 4,000) or (6,000, 18,000, 0)
Example:
A Manufacture produces 3 types of plastic fixtures. The time required for
molding, timings and packaging is given below
Process Type (𝑨) Type (𝑩) Type (𝑪) Total Time available
Molding 1 2 3 12,000
2
Timing 2 2 1 4,600
3 3
Packaging 1 1 1 2,400
2 3 2
Profit ($) 11 16 15
How many of each type of fixture should be produced to obtain the maximum profit?
(600, 5,100, 800)
Worked Example 2: ( Using 𝑪𝒋 − 𝒁𝒋 tableau vales)
A pottery company produces bowls 𝑥 and mugs 𝑦 from labor and clay. Let
the selling price of a bowl is $40 and mug is $50 in units. A bowl needs one
hour of labor and 4Kg of clay while a mug needs 2 hour of labor and 3kg of clay.
Suppose maximum labor hours per day is 40 and available clay is 120 Kg. Find
the number of bowls and mugs to manufacture for the maximum profit.
Worked Example 2: ( Using 𝑪𝒋 − 𝒁𝒋 tableau vales)
The objective function is Initially both 𝑠1 and 𝑠2 are zero
𝑧 = 40𝑥 + 50𝑦 + 𝑠1 + 𝑠2
𝑪𝒋 40 50 0 0
Worked Example 2: ( Using 𝑪𝒋 − 𝒁𝒋 tableau vales)
Next, find 𝑍𝑗
𝑍𝑗 = 𝐶𝐵 × 𝐶𝑜𝑙𝑢𝑚𝑛 𝑒𝑛𝑡𝑟𝑖𝑒𝑠
Basis 𝑪𝑩 𝒙 𝒚 𝒔𝟏 𝒔𝟏 RHS
𝒔𝟏 0 1 2 1 0 40
𝒔𝟐 0 4 3 0 1 120
𝒁𝒋 0 0 0 0 0
𝑪𝒋 − 𝒁𝒋 40 50 0 0 0
Worked Example 2: ( Using 𝑪𝒋 − 𝒁𝒋 tableau vales)
To choose the entering variable, select the large positive 𝑪𝒋 − 𝒁𝒋 = 𝟓𝟎
𝑪𝒋 40 50 0 0
Basis 𝑪𝑩 𝒙 𝒚 𝒔𝟏 𝒔𝟏 RHS
𝒚 50 0.5 1 0.5 0 20
𝒙 40 2.5 0 -1.5 1 60
𝒁𝒋 25 50 25 0
𝑪𝒋 − 𝒁𝒋 15 0 -25 0
Worked Example 2: ( Using 𝑪𝒋 − 𝒁𝒋 tableau vales)
To choose the entering variable, select the large positive 𝑪𝒋 − 𝒁𝒋 = 𝟏𝟓
𝑪𝒋 40 50 0 0
Basis 𝑪𝑩 𝒙 𝒚 𝒔𝟏 𝒔𝟏 RHS
𝒚 50 0 1 4/5 -1/5 8
𝒙 40 1 0 -3/5 2/5 24
𝒁𝒋 40 50 16 6
𝑪𝒋 − 𝒁𝒋 0 0 -16 -6
Ingredient Fiber per scoop Protein per scoop Cost per scoop
Brand A Oats 3g 4g $3
Brand B Grain Powder 1g 3g $1
Worked example 4:
Ingredient Fiber per scoop Protein per scoop Cost per scoop
• surplus variables
• artificial variables
The constraints becomes
3𝑥 + 𝑦 − 𝑠1 + 𝑎1 = 3
4𝑥 + 3𝑦 − 𝑠2 + 𝑎2 = 6
The big M method
4𝑥 + 3𝑦 ≥ 6
𝑀 𝑎1 3 1 -1 0 1 0 3
𝑀 𝑎2 4 3 0 -1 0 1 6
𝑧 = 3𝑥 + 𝑦 + 𝑀𝑎1 + 𝑀𝑎2 Find 𝑍𝑗 = 𝐶𝐵 × 𝐶𝑜𝑙𝑢𝑚𝑛 𝑒𝑛𝑡𝑟𝑖𝑒𝑠
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑎1 𝑎2 RHS
𝐶𝑗 3 1 0 0 𝑀 𝑀
𝑀 𝑎1 3 1 -1 0 1 0 3
𝑀 𝑎2 4 3 0 -1 0 1 6
𝑍𝑗 3𝑀 + 4𝑀 𝑀+𝑀 −𝑀 −𝑀 𝑀 𝑀
𝐶𝑗 − 𝑍𝑗 3 − 7𝑀 1 − 2𝑀 𝑀 𝑀 0 0
To find the entering variable we use the most negative value
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑎1 𝑎2 RHS
𝑅𝐻𝑆
𝐶𝑗 3 1 0 0 𝑀 𝑀 𝑃𝑖𝑣𝑜𝑡 𝐶𝑜𝑙𝑢𝑚𝑛
𝑀 𝑎1 3 1 -1 0 1 0 3 1
𝑀 𝑎2 4 3 0 -1 0 1 6 3/2
𝑍𝑗 3𝑀 + 4𝑀 𝑀 + 𝑀 −𝑀 −𝑀 𝑀 𝑀
𝐶𝑗 − 𝑍𝑗 𝟑 − 𝟕𝑴 1 − 2𝑀 𝑀 𝑀 0 0
𝐶𝑗 3 1 0 0 𝑀 𝑀
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑎1 𝑎2 RHS
𝑅𝐻𝑆
𝐶𝑗 3 1 0 0 𝑀 𝑀 𝑃𝑖𝑣𝑜𝑡 𝐶𝑜𝑙𝑢𝑚𝑛
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑎1 𝑎2 RHS
𝐶𝑗 3 1 0 0 𝑀 𝑀
1
𝑅1 → 𝑅1 − 𝑅2
3
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑎1 𝑎2 RHS
𝐶𝑗 3 1 0 0 𝑀 𝑀
𝑍𝑗 3 1 −1 0 1 0
𝐶𝑗 − 𝑍𝑗 0 0 1 0 𝑀−1 𝑀
𝐶𝑗 3 1 0 0 𝑀 𝑀
𝑍𝑗 3 1 −1 0 1 0
𝐶𝑗 − 𝑍𝑗 0 0 1 0 𝑀−1 𝑀
3 6
𝑧=3 + =3
5 5
Therefore, the minimum cost for the breakfast is $3
Worked example 4:
A financial engineering firm manages investments in two types of assets:
𝑥1 = number of technology stock units (cost per unit is $80)
𝑥2 = number of green energy stock units. (cost per unit is $65)
The firm wants to minimize the total investment cost, while ensuring minimum expected
performance levels in terms of return stability, liquidity coverage, and risk control as
describe in the following table.
Constraint Type 𝑥1 𝑥2 Minimum
Requirement
Return stability index 3 units 2 units 180 units
𝑥1 + 3𝑥2 − 𝑠3 + 𝑎3 = 120
Using big M method
𝑀 𝑎3 1 3 0 0 -1 0 0 1 120
Find 𝑍𝑗 = 𝐶𝐵 × 𝐶𝑜𝑙𝑢𝑚𝑛 𝑒𝑛𝑡𝑟𝑖𝑒𝑠
𝑧 = 80𝑥 + 65𝑦 + 𝑀𝑎1 + 𝑀𝑎2 + 𝑀𝑎3
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑠3 𝑎1 𝑎2 𝑎3 RHS
𝑅𝐻𝑆
𝑪𝒋 80 65 0 0 0 𝑴 𝑴 𝑴 0 𝑃𝑖𝑣𝑜𝑡 𝐶𝑜𝑙𝑢𝑚𝑛
𝑀 𝑎1 3 2 -1 0 0 1 0 0 180 90
𝑀 𝑎2 2 4 0 -1 0 0 1 0 200 50
𝑀 𝑎3 1 3 0 0 -1 0 0 1 120 40
𝑍𝑗 6𝑀 9𝑀 −𝑀 −𝑀 −𝑀 𝑀 𝑀 𝑀
80 − 6𝑀 65 − 9𝑀
𝐶𝑗 − 𝑍𝑗 𝑀 𝑀 𝑀 −𝑀 −𝑀 −𝑀
𝐶𝐵 Basis 𝑥 𝑦 𝑠1 𝑠2 𝑠3 𝑎1 𝑎2 𝑎3 RHS
𝑪𝒋 80 65 0 0 0 𝑴 𝑴 𝑴 0
175
𝐶𝑗 − 𝑍𝑗 3
− 2𝑀 0 𝑀 𝑀 ….. −𝑀 −𝑀 …
𝑥 = 40
𝑦 = 40
Proceed until all the elements in 𝐶𝑗 − 𝑍𝑗 raw become positive