You are on page 1of 53

Linear Equation

▪ In one variable can be written in the form,


ax + b=0 , where a and b are real
numbers, where a≠ 0.
Example:
Solve and sketch the graph
1. 5x+20 =45
2. –y = -3y +8
3. 3x+6 = 4( 2x+3)
Linear Equation

In two variables can be


written in the form,
ax + by = c, where a, b and
c are constants and
a and b≠ 0.
Example:

Solve and sketch the graph of


1. 4x + 3y = 12.
2. (10x-15y)/5 = 30

( Hint : use intercept method)


ACTIVITY TIME!!!!
Linear Programming
Objectives
✓ Demonstrate understanding and skills in analyzing linear
programming problems.

✓ Formulate linear programming models (LP model) for a


given type of linear programming problems.

✓ Solve and obtained optimal solutions for a linear


programming model.

✓ Develop confidence and accuracy in dealing with the


process of solving linear programming problems.
What is Linear Programming?
Linear Programming

• Linear programming deals with problems


such as maximizing profits, minimizing
costs or ensuring you make the best use
of available resources.
What is Linear Programming?
A mathematical tool for
maximizing or minimizing a
quantity (usually profit or cost
of production), subject to
certain constraints.

Of all computations and


decisions made by
management in business, 50-
90% of those involve linear
programming.
Typical areas of problems
• Determining optimal schedules
• Establishing locations
• Identifying optimal worker-job assignments
• Determining optimal diet plans
• Identifying optimal mix of products in a
factory (!!!)
• etc.
What is Linear Programming?
Say you own a 500 square acre farm. On
this farm you can grow wheat, barley, corn or
some combination of the 3. You have a limited
supply of fertilizer and pesticide, both of which
are needed (in different quantities) for each crop
grown. Let’s say wheat sells at $7 a bushel,
barley is $3, and corn is $3.50.

So, how many of each crop should


you grow to maximize your profit?
Background on
Linear Programming
• Developed by Leonid Kantorovich
around the time of WWII
• Further developed over following
decades
• Today, easily the most commonly used
field for optimization
• Economics, business management,
transportation, technology, planning, production, …

the list goes on…


Mixture Problems
• Goal: to find a feasible solution that maximizes
profit

• Mixture Problems consist of…


1. Resources
2. Products
3. Recipes
4. Profit
5. Objective
Mixture Problems
• An Optimal Production Policy, giving optimal
number of each product to produce where:
1. It is possible to produce this number of products &
2. This policy gives yields maximum profit
Mixture Problems
Problem where a limited
number of resources Production of…
are used to produce a
combination of
Example:
products in a fashion
that maximizes profit • Skateboards & Dolls
from the sale of these
products
Setting Up Mixture Problems
Example 1: Toy manufacturer can produce
skateboards and dolls. Both require the
precious resource of plastic, of which there are
60 units available. Skateboards take five units
of plastic and make $1 profit. Dolls take two
units of plastic and make $0.55 profit.
What is the number of dolls and skateboards the
company can produce to maximize profit?
Setting Up Mixture Problems
First identify components of the problem:
1. Resources – Plastic (60 available)
2. Products – Skateboards & Dolls
3. Recipes – Skateboards (5 units), Dolls (2 units)
4. Profits – Skateboards ($1.00), Dolls $0.55)
5. Objective – Maximize profit

Second, make a mixture chart:


Resources Profit
Plastic (60)

Skateboards 5 $1.00
Products

(x units)
Dolls 2 $0.55
(y units)
Translate Mixture Chart into Formulas
Resources Profit
Plastic (60)

Skateboards 5 $1.00
Products
(x units)
Dolls 2 $0.55
(y units)

2 Groups of Equations:
- Objective Equation (profit equation)
- Constraints (minimum constraints, resource constraints…)

Objective Equation - total profit given number of units produced


P = 1x + 0.55y
Constraints – usually inequalities
5x + 2y ≤ 60

With these, create Feasible Region


Mixture Problems
Feasible Region – region which consists of all possible
solution choices for a particular problem

Using the constraint equation we get the following graph:

Constraints:
5x + 2y ≤ 60
Corner Point Principle
Which point is optimal?
• Any point in feasible region will ( 0, 30 )

satisfy constraint equation, but


which will maximize profit
equation?

Corner Point Principle


In LP problem, the maximal value ( 12, 0 )

for profit always corresponds to a ( 0, 0 )

corner point on feasible region


Corner Point Principle
Plug in corner points to profit
formula:
( 0, 30 )
Point Calculation of Profit Formula
$1.00x + $0.55y = P
(0, 0) $1.00 (0) + $0.55 (0) = $0.00

(0, 30) $1.00 (0) + $0.55 (30) = $16.50

(12, 0) $1.00 (12) + $0.55 (0) = $12.00

Corner point (0,30) is the optimal point ( 12, 0 )

( 0, 0 )
Therefore the optimal solution would be
to produce 0 skateboards and 30 dolls
Quick Practice
A clothing company has 100 yards of cloth and produces shirts (x units) and
vests (y units). Shirts require 10 units and have profit value of $5, while
vests require 4 units and have profit value of $4.
What is the optimal production solution?
Step 1 & 2: Steps 3 & 4:
Identify Components & Mixture Chart Feasible Region & Corner Points
1. Resources – Cloth (100) ( 0, 25 )
2. Products – Shirts & Vests
3. Recipes – Shirts (10), Vests (4)
4. Profits – Shirts ($5), Vests ($4)
5. Objective – Maximize profit
Resources Profit
Cloth (100)
Shirts 10 $5.00
Products

(x units)
( 10, 0 )
Vests 4 $4.00
(y units) ( 0, 0 )

10x + 4y ≤ 100 Point Calculation of Profit Formula


$5.00x + $4.00y = P
$5.00x + $4.00y = P
(0, 0) $5.00 (0) + $4.00 (0) = $0.00

(0, 25) $5.00 (0) + $4.00 (25) = $100.00

(10, 0) $5.00 (10) + $4.00(0) = $50.00


Quick Practice
What if the company decides to also put a
“non-zero constraint” on all production?
Must produce at least 3 shirts and 10 vests.
Constraints become:
10x + 4y ≤ 100 …
x≥3
y ≥ 10

Feasible Region becomes:

( 3, 17.5 )

( 6, 10 )

( 3, 10 )

Great Job!
Practice 3!!
A small factory produces two types of toys: trucks and
bicycles. In the manufacturing process two machines are
used: the lathe and the assembler. The table shows the
length of time needed for each toy: The lathe can be
operated for 16 hours a day and there are two assemblers
which can each be used for 12 hours a day. Each bicycle
gives a profit of £16 and each truck gives a profit of £14.
Formulate and solve a linear programming problem so that
the factory maximizes its profit.
• Formulate the problem
Let x be number of bicycles made
Let y be number of trucks made.

• Objective Function:
Maximize: P = 16x + 14y
• Subject to constraints Graphical
solution
2x + y ≤ 16 Lathe
2x + 3y ≤ 24 Assembler
x, y ≥ 0
Graphical Solution
Interpret the solution

Optimal solution is to make 6


bicycles and 4 trucks. Profit £152
YOUR TURN!!
1. A clock maker makes two types of wood clock to
sell at various malls. It takes him three(3) hours to
assemble a pine clock, which requires two(2) oz of
varnish. It takes four(4) hours to assemble a
molave clock, which takes four(4) oz of varnish. He
has eight(8) oz of varnish available in stock and he
can work 12 hours. If he makes Php 100 profit on
each pine clock and Php 120 on each molave
clock, how many of each type should he make to
maximize his profits?
Solution:

Objective function:
Maximize : P = 100x + 120y

Constraints:
Varnishing : 3x + 4y ≤ 12
Processing Time: 2x + 4y ≤ 16
x≥0
y≥0
Your turn!
• A small business enterprise makes dresses and
trousers. To make a dress requires 1/2 hour of
cutting and 20 minutes of stitching. To make a
trousers requires 15 minutes of cutting and 1/2
hour of stitching. The profit on a dress is Php. 40
and Php. 50 for trousers. The business operates
for a maximum of 8 hours per day.

• Determine how many dresses and trousers


should be made to maximize profit and what the
maximum profit is.
• Substitute each of the ordered pairs of the
vertices of the feasible region,
• excluding (0;0) , ie. (0;16) , (16;0) and
(12;8) into profit equation .

• (i) P = 40(0) + 50(16)


• (ii) P = 40(16) + 50(0)
• (iii) P = 40(12) + 50(8)

• The maximum profit is Php. 880 for x = 12


and y = 8 .
THANK YOU!!!!
Simplex Method
• Real world problems not as simple as previous examples
• Some involve millions of “corner points” in feasible region
– Would take fast computers days to compute.

• Simplex method – developed to help solve large, real


world linear programming problems
– Ant crawling on edges of feasible region, from corner to corner
– Ant would do better if given temperature range (hotter, colder)

• Start with any point and evaluate profit at neighboring


points. Move to neighbor with higher profit and repeat.
Transportation Problem
Example:
Supermarket stores get bread delivered from a bakery
chain. Each store needs a certain amount per day, and
the bakery only ever bakes the exact number needed.
There are also shipping costs involved in delivering
bread to stores.

How many breads should be shipped from each bakery


to each store in order to minimize cost?
Transportation Problem
Store (Demand)
S1 (3) S2 (7) S3 (1)
(Supply)
Bakery

B1 (8) 8 9 3
B2 (1) 15 1 12
B3 (2) 1 3 5

The above table shows the various shipping costs from


bakeries (Bi) to stores (Sk)
To find the optimal solution we first create a Tableau

Tableau – special table showing costs and rim conditions


(supply & demand) for transportation problems
Transportation Problem
Stores
These numbers represents
Breads made The shipping cost to each store
S1 S2 S3
(supply):
8 9 3
B1 8
Bakeries

B2 15 1 12 1 Rim Conditions

1 3 5
B3 2

Breads needed 3 7 1 11 Equal Totals from both


(demand): sets of rim conditions

Number of breads sent


from B3 to S3
Rim Conditions
Transportation Problem
How to Solve the Problem using a Tableau
• Guess work…obviously not reliable, takes longer
• Northwest Corner Rule

Northwest Corner Rule


1. Locate the highest and leftmost cell in table that isn’t filled in.
Choose the smallest rim value, s, for this cell and fill cell with it.
2. Reduce other rim value by s, and eliminate row or column that
had rim value s. If more cells remain, repeat 1-2.
3. When there is a sole cell left, both its rim values will be the
same, and this will be the value for the cell.
Transportation Problem
Initial Tableau:
Stores
1. Locate highest,
S1 S2 S3 Breads made
leftmost cell and fill (supply):
with smallest rim 8 9 3
value B1 8
5
3
2. Decrement other rim
Bakeries

B2 15 1 12
value by s 1
3. Eliminate row or
1 3 5
column associated B3 2
with s
Breads needed 3 7 1 11
(demand):
Transportation Problem
New Tableau:
Stores
1. Locate highest,
S2 S3 Breads made
leftmost cell and fill (supply):
with smallest rim 9 3
value B1 5
2. Decrement other rim Bakeries
B2 1 12
value by s 1
3. Eliminate row or
3 5
column associated B3 2
with s
4. Repeat Breads needed 7 1 11
(demand):
Transportation Problem
Tableau:
Stores
1. Locate highest,
S2 S3 Breads made
leftmost cell and fill (supply):
with smallest rim 9 3
value B1 5
5
2. Decrement other rim Bakeries
B2 1 12
value by s 1
3. Eliminate row or
3 5
column associated B3 2
with s
4. Repeat Breads needed 2
7 1 11
(demand):
Transportation Problem
Tableau:
Stores
1. Locate highest,
S2 S3 Breads made
leftmost cell and fill (supply):
with smallest rim 1 12
value B2

Bakeries
1 1
2. Decrement other rim 3 5
value by s B3
2
3. Eliminate row or
column associated Breads needed 11
(demand): 2
1 1
with s
4. Repeat
Transportation Problem
Tableau:
Stores
1. Locate highest,
S2 S3 Breads made
leftmost cell and fill (supply):
with smallest rim 3 5

Baker
value B3
ies 1 2
1
2. Decrement other rim
Breads needed 11
value by s
(demand): 1 1
3. Eliminate row or
column associated
with s
4. Repeat
Transportation Problem
Tableau:
Store
s
1. Locate highest,
S3 Breads made
leftmost cell and fill (supply):
with smallest rim 5

Baker
B3

ies
value 1 1
2. Decrement other rim
Breads needed 11
value by s (demand): 1
1
3. Eliminate row or
column associated
with s
4. Repeat
Transportation Problem
Final Tableau:
Stores

S1 S2 S3 Breads made
(supply):
8 9 3
B1 8
3 5
Bakeries

B2 15 1 12
1 1

1 3 5
B3 2
1 1

Breads needed 3 7 1 11
(demand):
Problems with Northwest Corner Rule?

• Only gives a feasible solution, not an optimal solution

• Does not take shipping accounts into account


– In long run, this will not produce the optimal solution, because
these costs play an important role in optimal cost

• How to get Optimal Solution?


– Alter the feasible solution using indicator values
Improving Feasible Solution
• Indicator Value – for a cell (not filled in) is the cost
change associated with increasing or decreasing the
amounts shipped in a circuit of cells starting at this
empty cell.
Stores
One example would be the
S1 S2 S3 Breads made indicator value of (B1, S3). By
(supply): increasing (B1, S3), we must
8 9 3 decrease (B1, S2), decrease
B1 8 (B3, S3), and increase (B3, S2).
3 5
- +
Bakeries

B2 15 1 12 So the cost of this move is:


1 1
+3–9+3–5=-8
1 3 5
B3 2 Want moves to have negative
1 1
+ - value (decreasing cost)
Breads needed 3 7 1 11
(demand):
Improving Feasible Solution
• Indicator Value – for a cell (not filled in) is the cost
change associated with increasing or decreasing the
amounts shipped in a circuit of cells starting at this
empty cell.
Stores
One example would be the
S1 S2 S3 Breads made indicator value of (B1, S3). By
(supply): increasing (B1, S3), we must
8 9 3 decrease (B1, S2), decrease
B1 8 (B3, S3), and increase (B3, S2).
3 4 1
Bakeries

B2 15 1 12 So the cost of this move is:


1 1
+3–9+3–5=-8
1 3 5
B3 2 Want moves to have negative
2
value (decreasing cost)
Breads needed 3 7 1 11
(demand):
Improving Feasible Solution
Stores
Next, we can look cell (B3, S1)
S1 S2 S3 Breads made and its indicator value:
(supply):
8 9 3
B1 8 + 1 – 3 + 9 – 8 = -1
3 4 1
- +
Bakeries

B2 15 1 12 A negative value, so the move


1 1
should be performed.
1 3 5
B3 2 Since the minimum of the filled
2
+ - numbers in the cell with a
Breads needed 3 7 1 11 negative label is 2, then we can
(demand): make this move twice
Improving Feasible Solution
Stores

S1 S2 S3 Breads made
By examining all other indicator
(supply):
values for remaining empty
8 9 3
B1 8 cells, we find that they all yield
1 6 1
a positive cost change.
Bakeries

B2 15 1 12
1 1 This means we have found an
optimal solution.
1 3 5
B3 2
2

Breads needed 3 7 1 11
(demand):
Applications
• Aviation fuel
• Store management
• Planning airline routes
• Scheduling work crews
• Energy efficiency
• Telecommunications
• Chex Mix

You might also like