You are on page 1of 54

Linear Programming

Linear programming is a process that is used to determine the best outcome of a linear function. It is
the best method to perform linear optimization by making a few simple assumptions. The linear
function is known as the objective function. Real-world relationships can be extremely complicated.
However, linear programming can be used to depict such relationships, thus, making it easier to
analyse them.

Linear programming is used in many industries such as energy, telecommunication, transportation,


and manufacturing. This article sheds light on the various aspects of linear programming such as the
definition, formula, methods to solve problems using this technique, and associated linear
programming examples.

What is Linear Programming?

Linear programming, also abbreviated as LP, is a simple method that is used to depict complicated
real-world relationships by using a linear function. The elements in the mathematical model so
obtained have a linear relationship with each other. Linear programming is used to perform linear
optimization so as to achieve the best outcome.

Linear Programming Definition

Linear programming can be defined as a technique that is used for optimizing a linear function in
order to reach the best outcome. This linear function or objective function consists of linear
equality and inequality constraints. We obtain the best outcome by minimizing or maximizing
the objective function.

Linear Programming Examples

Suppose a postman has to deliver 6 letters in a day from the post office (located at A) to different
houses (U, V, W, Y, Z). The distance between the houses is indicated on the lines as given in the
image. If the postman wants to find the shortest route that will enable him to deliver the letters as
well as save on fuel then it becomes a linear programming problem. Thus, LP will be used to get the
optimal solution which will be the shortest route in this example.
Linear Programming Formula

A linear programming problem will consist of decision variables, an objective function, constraints,


and non-negative restrictions. The decision variables, x, and y, decide the output of the LP problem
and represent the final solution. The objective function, Z, is the linear function that needs to be
optimized (maximized or minimized) to get the solution. The constraints are the restrictions that are
imposed on the decision variables to limit their value. The decision variables must always have a
non-negative value which is given by the non-negative restrictions. The general formula of a linear
programming problem is given below:

Objective Function: Z = ax + by

Constraints: cx + dy ≤ e, fx + gy ≤ h. The inequalities can also be "≥"

Non-negative restrictions: x ≥ 0, y ≥ 0

How to Solve Linear Programming Problems?

The most important part of solving linear programming problem is to first formulate the problem
using the given data. The steps to solve linear programming problems are given below:

 Step 1: Identify the decision variables.

 Step 2: Formulate the objective function. Check whether the function needs to be minimized
or maximized.

 Step 3: Write down the constraints.

 Step 4: Ensure that the decision variables are greater than or equal to 0. (Non-negative
restraint)

 Step 5: Solve the linear programming problem using either the simplex or graphical method.

Let us study about these methods in detail in the following sections.


Linear Programming Methods

There are two main methods available for solving linear programming problem. These are the
simplex method and the graphical method. Given below are the steps to solve a linear programming
problem using both methods.

Linear Programming by Simplex Method

The simplex method in lpp can be applied to problems with two or more decision variables. Suppose
the objective function Z = 40x1x1 + 30x2x2 needs to be maximized and the constraints are given as
follows:

x1x1 + x2x2 ≤ 12

2x1x1 + x2x2 ≤ 16

x1x1 ≥ 0, x2x2 ≥ 0

Step 1: Add another variable, known as the slack variable, to convert the inequalities into equations.
Also, rewrite the objective function as an equation.

- 40x1x1 - 30x2x2 + Z = 0

x1x1 + x2x2 + y1y1 =12

2x1x1 + x2x2 + y2y2 =16

y1y1 and y2y2 are the slack variables.

Step 2: Construct the initial simplex matrix as follows:

⎡⎢

⎢⎣x1x2y1y2Z11100122101016−40−300010⎤⎥

⎥⎦[x1x2y1y2Z11100122101016−40−300010]

Step 3: Identify the column with the highest negative entry. This is called the pivot column. As -40 is
the highest negative entry, thus, column 1 will be the pivot column.

Step 4: Divide the entries in the rightmost column by the entries in the pivot column. We exclude
the entries in the bottom-most row.

12 / 1 = 12

16 / 2 = 8

The row containing the smallest quotient is identified to get the pivot row. As 8 is the smaller
quotient as compared to 12 thus, row 2 becomes the pivot row. The intersection of the pivot row
and the pivot column gives the pivot element.

Thus, pivot element = 2.

Step 5: With the help of the pivot element perform pivoting, using matrix properties, to make all
other entries in the pivot column 0.
Using the elementary operations divide row 2 by 2 (R2R2 / 2)

⎡⎢

⎢⎣x1x2y1y2Z111001211/201/208−40−300010⎤⎥


⎥⎦[x1x2y1y2Z111001211/201/208−40−300010]

Now apply R1R1 = R1R1 - R2R2

⎡⎢

⎢⎣x1x2y1y2Z01/21−1/20411/201/208−40−300010⎤⎥


⎥⎦[x1x2y1y2Z01/21−1/20411/201/208−40−300010]

Finally R3R3 = R3R3 + 40R2R2 to get the required matrix.

⎡⎢

⎢⎣x1x2y1y2Z01/21−1/20411/201/2080−100201320⎤⎥


⎥⎦[x1x2y1y2Z01/21−1/20411/201/2080−100201320]

Step 6: Check if the bottom-most row has negative entries. If no, then the optimal solution has been
determined. If yes, then go back to step 3 and repeat the process. -10 is a negative entry in the
matrix thus, the process needs to be repeated. We get the following matrix.

⎡⎢

⎢⎣x1x2y1y2Z012−10810−11040020101400⎤⎥

⎥⎦[x1x2y1y2Z012−10810−11040020101400]
Writing the bottom row in the form of an equation we get Z = 400 - 20y1y1 - 10y2y2. Thus, 400 is the
highest value that Z can achieve when both y1y1 and y2y2 are 0.

Also, when x1x1 = 4 and x2x2 = 8 then value of Z = 400

Thus, x1x1 = 4 and x2x2 = 8 are the optimal points and the solution to our linear programming
problem.

Linear Programming by Graphical Method

If there are two decision variables in a linear programming problem then the graphical method can
be used to solve such a problem easily.

Suppose we have to maximize Z = 2x + 5y.

The constraints are x + 4y ≤ 24, 3x + y ≤ 21 and x + y ≤ 9

where, x ≥ 0 and y ≥ 0.

To solve this problem using the graphical method the steps are as follows.

Step 1: Write all inequality constraints in the form of equations.

x + 4y = 24

3x + y = 21

x+y=9

Step 2: Plot these lines on a graph by identifying test points.

x + 4y = 24 is a line passing through (0, 6) and (24, 0). [By substituting x = 0 the point (0, 6) is
obtained. Similarly, when y = 0 the point (24, 0) is determined.]

3x + y = 21 passes through (0, 21) and (7, 0).

x + y = 9 passes through (9, 0) and (0, 9).

Step 3: Identify the feasible region. The feasible region can be defined as the area that is bounded by
a set of coordinates that can satisfy some particular system of inequalities.

Any point that lies on or below the line x + 4y = 24 will satisfy the constraint x + 4y ≤ 24.

Similarly, a point that lies on or below 3x + y = 21 satisfies 3x + y ≤ 21.

Also, a point lying on or below the line x + y = 9 satisfies x + y ≤ 9.

The feasible region is represented by OABCD as it satisfies all the above-mentioned three
restrictions.

Step 4: Determine the coordinates of the corner points. The corner points are the vertices of the
feasible region.

O = (0, 0)

A = (7, 0)

B = (6, 3). B is the intersection of the two lines 3x + y = 21 and x + y = 9. Thus, by substituting y = 9 - x
in 3x + y = 21 we can determine the point of intersection.
C = (4, 5) formed by the intersection of x + 4y = 24 and x + y = 9

D = (0, 6)

Step 5: Substitute each corner point in the objective function. The point that gives the greatest
(maximizing) or smallest (minimizing) value of the objective function will be the optimal point.

Corner Points Z = 2x + 5y
O = (0, 0) 0
A = (7, 0) 14
B = (6, 3) 27
C = (4, 5) 33
D = (0, 6) 30
33 is the maximum value of Z and it occurs at C. Thus, the solution is x = 4 and y = 5.

Applications of Linear Programming

Linear programming is used in several real-world applications. It is used as the basis for creating
mathematical models to denote real-world relationships. Some applications of LP are listed below:

 Manufacturing companies make widespread use of linear programming to plan and schedule
production.
 Delivery services use linear programming to decide the shortest route in order to minimize
time and fuel consumption.

 Financial institutions use linear programming to determine the portfolio of financial products
that can be offered to clients.

Important Notes on Linear Programming

 Linear programming is a technique that is used to determine the optimal solution of a linear
objective function.

 The simplex method in lpp and the graphical method can be used to solve a linear
programming problem.

 In a linear programming problem, the variables will always be greater than or equal to 0.

 Linear Programming Examples

 Example 1: Solve the following linear programming problem using the graphical method.
Minimize: Z = 5x + 4y
4x + y ≥ 40,
2x + 3y ≥ 90,
x, y ≥ 0
Solution: Using the constraints we get the equations of the lines as 4x + y = 40 and 2x + 3y =
90.
4x + y = 40 passes through (0, 40) and (10, 0). Any point lying on or above this line satisfies
4x + y ≥ 40
2x + 3y = 90 passes through (0, 30) and (45, 0). Any point lying on or above this line satisfies
2x + 3y ≥ 90. The graph is given as

Corner Points Z = 5x + 4y

A = (45, 0) 225

B = (3, 28) 127

C = (0, 40) 160

 As the minimum value of Z is 127, thus, B (3, 28) gives the optimal solution.
Answer: The minimum value of Z is 127 and the optimal solution is (3, 28)

 Example 2: Solve the linear programming problem using the graphical method.
Maximize Z = 2x + 3y
x + y ≤ 30,
x ≤ 20, y ≤ 12
x, y ≥ 0
Solution: Writing the inequalities as equations we get,
x + y = 30 passing through (0, 30) and (30, 0). Points on or below this line will satisfy x + y ≤
30
x = 20 is a line parallel to the y axis. Any point on or to the left of this line will satisfy x ≤ 20.
y = 12 is a line parallel to the x axis. Any point on or below this line will satisfy y ≤ 12. The
graph is given by

Corner points Z = 2x + 3y

O = (0, 0) 0

A = (20, 0) 40

B = (20, 10) 70

C = (18, 12) 72
D = (0, 12) 36

 The maximum value of Z = 72 and it occurs at C (18, 12)


Answer: the maximum value of Z = 72 and the optimal solution is (18, 12)

 Example 3: Using the simplex method in lpp solve the linear programming problem
Minimize Z = x1x1 + 2x2x2 + 3x3x3
x1x1 + x2x2 + x3x3 ≤ 12
2x1x1 + x2x2 + 3x3x3 ≤ 18
x1x1, x2x2, x3x3 ≥ 0
Solution: Convert all inequalities to equations by introducing slack variables.
-x1x1 - 2x2x2 - 3x3x3 + Z = 0
x1x1 + x2x2 + x3x3 + y1y1 = 12
2x1x1 + x2x2 + 3x3x3 + y2y2 = 18
Expressing this as a matrix we get,
⎡⎢
 ⎢

 ⎢⎣x1x2x3y1y2Z1111001221301018−1−2−30010⎤⎥

 ⎥

 ⎥⎦[x1x2x3y1y2Z1111001221301018−1−2−30010]
As -3 is the greatest negative value thus, column 3 is the pivot column.
12 / 1 = 12
18 / 3 = 6
As 6 is the smaller quotient thus, row 2 is the pivot row and 3 is the pivot element. By
applying matrix operations we get,
⎡⎢
 ⎢

 ⎢⎣x1x2x3y1y2Z0.330.66701−0.33060.6670.33100.33061−1001118⎤⎥

 ⎥

 ⎥⎦[x1x2x3y1y2Z0.330.66701−0.33060.6670.33100.33061−1001118]
Now -1 needs to be eliminated. Thus, by repreating the steps the matrix so obtained is as
follows
⎡⎢
 ⎢

 ⎢⎣x1x2x3y1y2Z0.5101.50.5090.501−0.50.5031.5001.50.5127⎤⎥

 ⎥

 ⎥⎦[x1x2x3y1y2Z0.5101.50.5090.501−0.50.5031.5001.50.5127]
We get the maximum value of Z = 27 at x1x1 = 0, x2x2 = 9 x3x3 = 3
Answer: Maximum value of Z = 27 and optimal solution (0, 9, 3)
Breakdown tough concepts through simple visuals.

Math will no longer be a tough subject, especially when you understand the concepts through
visualizations.

Book a Free Trial Class

Practice Questions on Linear Programming

 Q.1
What are the constraints imposed on the variables of a linear programming problem with 2
variables, x and y?

x, y ≥ 0

x, y ≥ 0

x, y = 0

x, y = 0

x, y ≤ 0

x, y ≤ 0

None of the above

None of the above

 Check Answer

 Q.2
Find the optimal solution using linear programming.
Maximize Z = 50x + 120y
x + 2y ≤ 100
x + 3y ≤ 120
x + y ≤ 110
x, y ≥ 0

 (20,10)

 (20,10)

(60, 20)

(60, 20)

(-12, -18)

(-12, -18)

(5, 7)
s

J E Beasley

OR-Notes are a series of introductory notes on topics that fall under the broad heading of the field of
operations research (OR). They were originally used by me in an introductory OR course I give at
Imperial College. They are now available for use by any students and teachers interested in OR
subject to the following conditions.

A full list of the topics available in OR-Notes can be found here.

Linear programming formulation examples

Linear programming example 1996 MBA exam

A cargo plane has three compartments for storing cargo: front, centre and rear. These
compartments have the following limits on both weight and space:

Compartment Weight capacity (tonnes) Space capacity (cubic metres)

Front 10 6800

Centre 16 8700

Rear 8 5300

Furthermore, the weight of the cargo in the respective compartments must be the same proportion
of that compartment's weight capacity to maintain the balance of the plane.

The following four cargoes are available for shipment on the next flight:

Cargo Weight (tonnes) Volume (cubic metres/tonne) Profit (£/tonne)

C1 18 480 310

C2 15 650 380

C3 23 580 350

C4 12 390 285

Any proportion of these cargoes can be accepted. The objective is to determine how much (if any) of
each cargo C1, C2, C3 and C4 should be accepted and how to distribute each among the
compartments so that the total profit for the flight is maximised.

 Formulate the above problem as a linear program

 What assumptions are made in formulating this problem as a linear program?

 Briefly describe the advantages of using a software package to solve the above linear
program, over a judgemental approach to this problem.

Solution

Variables
We need to decide how much of each of the four cargoes to put in each of the three compartments.
Hence let:

xij be the number of tonnes of cargo i (i=1,2,3,4 for C1, C2, C3 and C4 respectively) that is put into
compartment j (j=1 for Front, j=2 for Centre and j=3 for Rear) where x ij >=0 i=1,2,3,4; j=1,2,3

Note here that we are explicitly told we can split the cargoes into any proportions (fractions) that we
like.

Constraints

 cannot pack more of each of the four cargoes than we have available

x11 + x12 + x13 <= 18


x21 + x22 + x23 <= 15
x31 + x32 + x33 <= 23
x41 + x42 + x43 <= 12

 the weight capacity of each compartment must be respected

x11 + x21 + x31 + x41 <= 10


x12 + x22 + x32 + x42 <= 16
x13 + x23 + x33 + x43 <= 8

 the volume (space) capacity of each compartment must be respected

480x11 + 650x21 + 580x31 + 390x41 <= 6800


480x12 + 650x22 + 580x32 + 390x42 <= 8700
480x13 + 650x23 + 580x33 + 390x43 <= 5300

 the weight of the cargo in the respective compartments must be the same proportion of
that compartment's weight capacity to maintain the balance of the plane

[x11 + x21 + x31 + x41]/10 = [x12 + x22 + x32 + x42]/16 = [x13 + x23 + x33 + x43]/8

Objective

The objective is to maximise total profit, i.e.

maximise 310[x11+ x12+x13] + 380[x21+ x22+x23] + 350[x31+ x32+x33] + 285[x41+ x42+x43]

The basic assumptions are:

 that each cargo can be split into whatever proportions/fractions we desire

 that each cargo can be split between two or more compartments if we so desire

 that the cargo can be packed into each compartment (for example if the cargo was spherical
it would not be possible to pack a compartment to volume capacity, some free space is
inevitable in sphere packing)

 all the data/numbers given are accurate

The advantages of using a software package to solve the above linear program, rather than a
judgemental approach are:
 actually maximise profit, rather than just believing that our judgemental solution maximises
profit (we may have bad judgement, even if we have an MBA!)

 makes the cargo loading the decision one that we can solve in a routine operational manner
on a computer, rather than having to exercise judgement each and every time we want to
solve it

 problems that can be appropriately formulated as linear programs are almost always better
solved by computers than by people

 can perform sensitivity analysis very easily using a computer

Linear programming example 1995 MBA exam

Briefly describe the main steps in using mathematical modelling to support management.

A canning company operates two canning plants. The growers are willing to supply fresh fruits in the
following amounts:

 S1: 200 tonnes at £11/tonne

 S2: 310 tonnes at £10/tonne

 S3: 420 tonnes at £9/tonne

Shipping costs in £ per tonne are:

To: Plant A Plant B

From: S1 3 3.5

S2 2 2.5

S3 6 4

Plant capacities and labour costs are:

Plant A Plant B

Capacity 460 tonnes 560 tonnes

Labour cost £26/tonne £21/tonne

The canned fruits are sold at £50/tonne to the distributors. The company can sell at this price all
they can produce.

The objective is to find the best mixture of the quantities supplied by the three growers to the two
plants so that the company maximises its profits.

 Formulate the problem as a linear program and explain it

 Explain the meaning of the dual values associated with the supply and plant capacity
constraints

 What assumptions have you made in expressing the problem as a linear program

Solution
The main steps in using mathematical modelling to support management are:

 1. Problem identification

o Diagnosis of the problem from its symptoms if not obvious (i.e. what is the
problem?)

o Delineation of the subproblem to be studied. Often we have to ignore parts of the


entire problem.

o Establishment of objectives, limitations and requirements.

 2. Formulation as a mathematical model

 3. Model validation (or algorithm validation)

o Model validation involves running the algorithm for the model on the computer in
order to ensure:

 the input data is free from errors

 the computer program is bug-free (or at least there are no outstanding


bugs)

 the computer program correctly represents the model we are attempting to


validate

 the results from the algorithm seem reasonable (or if they are surprising we
can at least understand why they are surprising).

 4. Solution of the model

o Standard computer packages, or specially developed algorithms, can be used to


solve the model.

o In practice, a "solution" often involves very many solutions under varying


assumptions to establish sensitivity.

 5. Implementation

o This phase may involve the implementation of the results of the study or the
implementation of the algorithm for solving the model as an operational tool
(usually in a computer package).

To formulate the problem given in the question as a linear program we need to define:

 variables

 constraints

 objective

Variables

We need to decide how much to supply from each of the three growers to each of the two canning
plants. Hence let xij be the number of tonnes supplied from grower i (i=1,2,3 for S1, S2 and S3
respectively) to plant j (j=1 for Plant A and j=2 for Plant B) where x ij >=0 i=1,2,3; j=1,2
Constraints

 cannot supply more than a grower has available - a supply constraint

x11 + x12 <= 200


x21 + x22 <= 310
x31 + x32 <= 420

 the capacity of each plant must be respected - a capacity constraint

x11 + x21 + x31 <= 460


x12 + x22 + x32 <= 560

Objective

The objective is to maximise total profit, i.e.

maximise revenue - grower supply cost - grower shipping cost - plant labour cost

and this is

maximise 50SUM{i=1,2,3}SUM{j=1,2}xij - 11(x11+x12) - 10(x21+x22) - 9(x31+x32) - 3x11 - 2x21 - 6x31 - 3.5x12 -


2.5x22 - 4x32 - 26SUM{i=1,2,3}xi1 - 21SUM{i=1,2,3}xi2

The dual values associated with the supply and plant capacity constraints in the optimal solution of
the above linear program tell us by how much the optimal objective function value will change if we
change the right-hand side of the corresponding constraints

The basic assumptions are:

 can ship from a grower any quantity we desire

 no loss in weight in processing at the plant

 no loss in weight in shipping

 can sell all we produce

 all the data/numbers given are accurate

Linear programming example 1993 UG exam

The production manager of a chemical plant is attempting to devise a shift pattern for his workforce.
Each day of every working week is divided into three eight-hour shift periods (00:01-08:00, 08:01-
16:00, 16:01-24:00) denoted by night, day and late respectively. The plant must be manned at all
times and the minimum number of workers required for each of these shifts over any working week
is as below:

Mon Tues Wed Thur Fri Sat Sun

Night 5 3 2 4 3 2 2

Day 7 8 9 5 7 2 5

Late 9 10 10 7 11 2 2
The union agreement governing acceptable shifts for workers is as follows:

1. Each worker is assigned to work either a night shift or a day shift or a late shift and once a
worker has been assigned to a shift they must remain on the same shift every day that they
work.

2. Each worker works four consecutive days during any seven day period.

In total there are currently 60 workers.

 Formulate the production manager's problem as a linear program.

 Comment upon the advantages/disadvantages you foresee of formulating and solving this
problem as a linear program.

Solution

Variables

The union agreement is such that any worker can only start their four consecutive work days on one
of the seven days (Mon to Sun) and in one of the three eight-hour shifts (night, day, late).

Let:

Monday be day 1, Tuesday be day 2, ..., Sunday be day 7

Night be shift 1, Day be shift 2, Late be shift 3

then the variables are:

Nij the number of workers starting their four consecutive work days on day i (i=1,...,7) and shift j
(j=1,...,3)

Note here that strictly these variables should be integer but, as we are explicitly told to formulate
the problem as a linear program in part (a) of the question, we allow them to take fractional values.

Constraints

 upper limit on the total number of workers of 60

SUM{i=1 to 7} SUM{j=1 to 3} Nij <= 60

since each worker can start his working week only once during the seven day, three shift, week

 lower limit on the total number of workers required for each day/shift period

let Dij be the (known) number of workers required on day i (i=1,...,7) and shift period j (j=1,...,3) e.g.
D53=11 (Friday, Late)

then the constraints are

Monday: N1j + N7j + N6j + N5j >= D1j j=1,...,3

Tuesday: N2j + N1j + N7j + N6j >= D2j j=1,...,3

Wednesday: N3j + N2j + N1j + N7j >= D3j j=1,...,3

Thursday: N4j + N3j + N2j + N1j >= D4j j=1,...,3


Friday: N5j + N4j + N3j + N2j >= D5j j=1,...,3

Saturday: N6j + N5j + N4j + N3j >= D6j j=1,...,3

Sunday: N7j + N6j + N5j + N4j >= D7j j=1,...,3

The logic here is straightforward, for example for Wednesday (day 3) the workers working shift j on
day 3 either started on Wednesday (day 3, N 3j) or on Tuesday (day 2, N2j) or on Monday (day 1, N1j)
or on Sunday (day 7, N7j) - so the sum of these variables is the total number of workers on duty on
day 3 in shift j and this must be at least the minimum number required (D 3j).

Objective

It appears from the question that the production manager's objective is simply to find a feasible
schedule so any objective is possible. Logically however he might be interested in reducing the size
of the workforce so the objective function could be:

minimise SUM{i=1 to 7} SUM{j=1 to 3} N ij

where all variables Nij>=0 and continuous (i.e. can take fractional values).

This completes the formulation of the problem as a linear program.

Some of the advantages and disadvantages of solving this problem as a linear program are:

 really need variable values which are integer

 some workers will always end up working weekends

 how do we choose the workers to use, e.g. if N 43=7 which 7 workers do we choose to begin
their work week on day 4 working shift 3

 what happens if workers fail to report in (e.g. if they are sick) - we may fall below the
minimum number required

 the approach above enables us to deal with the problem in a systematic fashion

 have the potential to reduce the size of the workforce by more effectively matching the
resources to the needs

able to investigate changes (e.g. in shift patterns, workers needed per day, etc) very easily.

Linear programming example 1991 UG exam

A company manufactures four products (1,2,3,4) on two machines (X and Y). The time (in minutes)
to process one unit of each product on each machine is shown below:

Machine

X Y

Product 1 10 27

2 12 19

3 13 33
4 8 23

The profit per unit for each product (1,2,3,4) is £10, £12, £17 and £8 respectively. Product 1 must be
produced on both machines X and Y but products 2, 3 and 4 can be produced on either machine.

The factory is very small and this means that floor space is very limited. Only one week's production
is stored in 50 square metres of floor space where the floor space taken up by each product is 0.1,
0.15, 0.5 and 0.05 (square metres) for products 1, 2, 3 and 4 respectively.

Customer requirements mean that the amount of product 3 produced should be related to the
amount of product 2 produced. Over a week approximately twice as many units of product 2 should
be produced as product 3.

Machine X is out of action (for maintenance/because of breakdown) 5% of the time and machine Y
7% of the time.

Assuming a working week 35 hours long formulate the problem of how to manufacture these
products as a linear program.

Solution

Variables

Essentially we are interested in the amount produced on each machine. Hence let:

xi = amount of product i (i=1,2,3,4) produced on machine X per week

yi = amount of product i (i=2,3,4) produced on machine Y per week

where xi >= 0 i=1,2,3,4 and yi >= 0 i=2,3,4

Note here that as product 1 must be processed on both machines X and Y we do not define y 1.

Constraints

 floor space

0.1x1 + 0.15(x2 + y2) + 0.5(x3 + y3) + 0.05(x4 + y4) <= 50

 customer requirements

x2 + y2 = 2(x3 + y3)

Note here that as this is only an approximate (±5% say) constraint we might do better to express this
constraint as

0.95[2(x3 + y3)] <= x2 + y2 <= 1.05[2(x3 + y3)]

 available time

10x1 + 12x2 + 13x3 + 8x4 <= 0.95(35)(60) (machine X)

27x1 + 19y2 + 33y3 + 23y4 <= 0.93(35)(60) (machine Y)

Objective

maximise profit, i.e.

maximise 10x1 + 12(x2 + y2) + 17(x3 + y3) + 8(x4 + y4)


Linear programming example 1987 UG exam

A company is planning its production schedule over the next six months (it is currently the end of
month 2). The demand (in units) for its product over that timescale is as shown below:

Month 3 4 5 6 7 8

Demand 5000 6000 6500 7000 8000 9500

The company currently has in stock: 1000 units which were produced in month 2; 2000 units which
were produced in month 1; 500 units which were produced in month 0.

The company can only produce up to 6000 units per month and the managing director has stated
that stocks must be built up to help meet demand in months 5, 6, 7 and 8. Each unit produced costs
£15 and the cost of holding stock is estimated to be £0.75 per unit per month (based upon the stock
held at the beginning of each month).

The company has a major problem with deterioration of stock in that the stock inspection which
takes place at the end of each month regularly identifies ruined stock (costing the company £25 per
unit). It is estimated that, on average, the stock inspection at the end of month t will show that 11%
of the units in stock which were produced in month t are ruined; 47% of the units in stock which
were produced in month t-1 are ruined; 100% of the units in stock which were produced in month t-
2 are ruined. The stock inspection for month 2 is just about to take place.

The company wants a production plan for the next six months that avoids stockouts. Formulate their
problem as a linear program.

Because of the stock deterioration problem the managing director is thinking of directing that
customers should always be supplied with the oldest stock available. How would this affect your
formulation of the problem?

Solution

Variables

Let

Pt be the production (units) in month t (t=3,...,8)

Iit be the number of units in stock at the end of month t which were produced in month i (i=t,t-1,t-2)

Sit be the number of units in stock at the beginning of month t which were produced in month i (i=t-
1,t-2)

dit be the demand in month t met from units produced in month i (i=t,t-1,t-2)

Constraints

 production limit

Pt <= 6000

 initial stock position

I22 = 1000
I12 = 2000

I02 = 500

 relate opening stock in month t to closing stock in previous months

St-1,t = 0.89It-1,t-1

St-2,t = 0.53It-2,t-1

 inventory continuity equation where we assume we can meet demand in month t from
production in month t. Let Dt represent the (known) demand for the product in month t
(t=3,4,...,8) then

closing stock = opening stock + production - demand

and we have

It,t = 0 + Pt - dt,t

It-1,t = St-1,t + 0 - dt-1,t

It-2,t = St-2,t + 0 - dt-2,t

where

dt,t + dt-1,t + dt-2,t = Dt

 no stockouts

all inventory (I,S) and d variables >= 0

Objective

Presumably to minimise cost and this is given by

SUM{t=3 to 8}15Pt + SUM{t=3 to 9}0.75(St-1,t+St-2,t) + SUM{t=3 to 8}25(0.11It,t+0.47It-1,t+1.0It-2,t)

Note because we are told to formulate this problem as a linear program we assume all variables are
fractional - in reality they are likely to be quite large and so this is a reasonable approximation to
make (also a problem occurs with finding integer values which satisfy (for example) S t-1,t=0.89It-1,t-
1 unless this is assumed).

If we want to ensure that demand is met from the oldest stock first then we can conclude that this
is already assumed in the numerical solution to our formulation of the problem since (plainly) it
worsens the objective to age stock unnecessarily and so in minimising costs we will automatically
supply (via the dit variables) the oldest stock first to satisfy demand (although the managing director
needs to tell the employees to issue the oldest stock first).

Linear programming example 1986 UG exam

A company assembles four products (1, 2, 3, 4) from delivered components. The profit per unit for
each product (1, 2, 3, 4) is £10, £15, £22 and £17 respectively. The maximum demand in the next
week for each product (1, 2, 3, 4) is 50, 60, 85 and 70 units respectively.
There are three stages (A, B, C) in the manual assembly of each product and the man-hours needed
for each stage per unit of product are shown below:

Product

1 2 3 4

Stage A 2 2 1 1

B 2 4 1 2

C 3 6 1 5

The nominal time available in the next week for assembly at each stage (A, B, C) is 160, 200 and 80
man-hours respectively.

It is possible to vary the man-hours spent on assembly at each stage such that workers previously
employed on stage B assembly could spend up to 20% of their time on stage A assembly and workers
previously employed on stage C assembly could spend up to 30% of their time on stage A assembly.

Production constraints also require that the ratio (product 1 units assembled)/(product 4 units
assembled) must lie between 0.9 and 1.15.

Formulate the problem of deciding how much to produce next week as a linear program.

Solution

Variables

Let

xi = amount of product i produced (i=1,2,3,4)

tBA be the amount of time transferred from B to A

tCA be the amount of time transferred from C to A

Constraints

 maximum demand

x1 <= 50

x2 <= 60

x3 <= 85

x4 <= 70

 ratio

0.9 <= (x1/x4) <= 1.15

i.e. 0.9x4 <= x1 and x1 <= 1.15x4

 work-time

2x1 + 2x2 + x3 + x4 <= 160 + tBA + tCA

2x1 + 4x2 + x3 + 2x4 <= 200 - tBA


3x1 + 6x2 + x3 + 5x4 <= 80 - tCA

 limit on transferred time

tBA <= 0.2(200)

tCA <= 0.3(80)

 all variables >= 0

Objective

maximise 10x1 + 15x2 + 22x3 + 17x4

Note we neglect the fact that the x i variables should be integer because we are told to formulate the
problem as an LP.

Linear programming example

A company makes three products and has available 4 workstations. The production time (in minutes)
per unit produced varies from workstation to workstation (due to different manning levels) as shown
below:

Workstation

1 2 3 4

Product 1 5 7 4 10

2 6 12 8 15

3 13 14 9 17

Similarly the profit (£) contribution (contribution to fixed costs) per unit varies from workstation to
workstation as below

Workstation

1 2 3 4

Product 1 10 8 6 9

2 18 20 15 17

3 15 16 13 17

If, one week, there are 35 working hours available at each workstation how much of each product
should be produced given that we need at least 100 units of product 1, 150 units of product 2 and
100 units of product 3. Formulate this problem as an LP.

Solution

Variables
At first sight we are trying to decide how much of each product to make. However on closer
inspection it is clear that we need to decide how much of each product to make at each workstation.
Hence let

xij = amount of product i (i=1,2,3) made at workstation j (j=1,2,3,4) per week.

Although (strictly) all the xij variables should be integer they are likely to be quite large and so we let
them take fractional values and ignore any fractional parts in the numerical solution. Note too that
the question explicitly asks us to formulate the problem as an LP rather than as an IP.

Constraints

We first formulate each constraint in words and then in a mathematical way.

 limit on the number of minutes available each week for each workstation

5x11 + 6x21 + 13x31 <= 35(60)

7x12 + 12x22 + 14x32 <= 35(60)

4x13 + 8x23 + 9x33 <= 35(60)

10x14 + 15x24 + 17x34 <= 35(60)

 lower limit on the total amount of each product produced

x11 + x12 + x13 + x14 >= 100

x21 + x22 + x23 + x24 >= 150

x31 + x32 + x33 + x34 >= 100

Objective

Presumably to maximise profit - hence we have

maximise

10x11 + 8x12 + 6x13 + 9x14 + 18x21 + 20x22 + 15x23 + 17x24 + 15x31 + 16x32 + 13x33 + 17x34

Production planning problem

Consider the production of tin cans which are stamped from metal sheets. A can consists of a main
body and two ends,. We have 4 possible stamping patterns (involving 2 different types (sizes) of
metal sheet). as shown below
We have the following information:

Pattern

1 2 3 4

Type of sheet used 1 2 1 1

Number of main bodies 1 4 2 0

Number of ends 7 4 3 9

Amount of scrap s1 s2 s3

s4

Time to stamp (hours) t1 t2 t3

t4

Note here that the si (i=1,2,3,4) and the ti (i=1,2,3,4) are not variables but constants (which have a
known value). Often in formulating LP's it is easier to use a symbol for a number rather than write
out the number in full every time it occurs in a constraint or in the objective function.
Let P be the profit obtained from selling one can, C be the cost per unit of scrap, T be the total
number of hours available per week, L1 be the number of metal sheets of type 1 which are available
for stamping per week and L2 be the number of metal sheets of type 2 which are available for
stamping per week.

At the start of the week there is nothing in stock. Each (unused) main body in stock at the end of the
week incurs a stock-holding cost of c1. Similarly each (unused) end in stock at the end of the week
incurs a stock-holding cost of c2. Assume that all cans produced one week are sold that week.

How many cans should be produced per week?

Production planning solution

Variables

Let

xi be the number of patterns of type i (i=1,2,3,4) stamped per week

y be the number of cans produced per week

Note xi >= 0 i=1,2,3,4 and y >= 0 and again we assume that the x i and y are large enough for
fractional values not to be significant.

Constraints

 time available

t1x1 + t2x2 + t3x3 + t4x4 <= T

 sheet availability

x1 + x3 + x4 <= L1 (sheet 1)

x2 <= L2 (sheet 2)

 number of cans produced

y = min[ (7x1+4x2+3x3+9x4)/2, (x1+4x2+2x3) ]

where the first term in this expression is the limit imposed upon y by the number of can ends
produced and the second term in this expression is the limit imposed upon y by the number of can
bodies produced. This constraint (because of the min[,] part) is not a linear constraint.

Objective

Presumably to maximise profit - hence

maximise

revenue - cost of scrap - unused main bodies stock - holding cost - unused ends stock - holding cost

i.e. maximise

Py - C(s1x1 + s2x2 + s3x3 + s4x4) - c1(x1 + 4x2 + 2x3 - y) - c2((7x1 + 4x2 + 3x3 + 9x4) - 2y)
As noted above this formulation of the problem is not an LP - however it is relatively easy (for
this particular problem) to turn it into an LP by replacing the y = min[,] non-linear equation
by two linear equations.

Suppose we replace the constraint

y = min[ (7x1+4x2+3x3+9x4)/2,

(x1+4x2+2x3) ] (A)

by the two constraints

y <= (7x1+4x2+3x3+9x4)/2 (B)

y <= (x1+4x2+2x3) (C)

(which are both linear constraints) then we do have an LP and in the optimal solution of this LP
either:

 constraint (B) or constraint (C) is satisfied with equality, in which case constraint (A) is also
satisfied with equality; or

 neither constraint (B) nor constraint (C) is satisfied with equality i.e. y <
(7x1+4x2+3x3+9x4 )/2 and y < (x1+4x2+2x3) - but in this case we can increase y (without
changing any xi values), increasing the objective function (assuming P + c 1 + 2c2 >0) and
contradicting the statement (above) that we already had the optimal solution.

Hence case (b) cannot occur and so case (a) is valid - replacing constraint (A) by constraints (B) and
(C) generates a valid LP formulation of the problem.

Note that this problem illustrates that even if our initial formulation of the problem is non-linear we
may be able to transform it into an LP.

Note too that it is relatively easy to extend the LP formulation of the problem to cope with the
situation where can bodies/ends unused at the end of one week are available for production the
following week.

Production planning problem

A company is producing a product which requires, at the final assembly stage, three parts. These
three parts can be produced by two different departments as detailed below.

Production rate (units/hr)

Part 1 Part 2 Part 3 Cost (£/hr)

Department 1 7 6 9 25.0

Department 2 6 11 5 12.5

One week, 1050 finished (assembled) products are needed (but up to 1200 can be produced if
necessary). If department 1 has 100 working hours available, but department 2 has 110 working
hours available, formulate the problem of minimising the cost of producing the finished (assembled)
products needed this week as an LP, subject to the constraint that limited storage space means that
a total of only 200 unassembled parts (of all types) can be stored at the end of the week.
Note: because of the way production is organised in the two departments it is not possible to
produce, for example, only one or two parts in each department, e.g. one hour of working in
department 1 produces 7 part 1 units, 6 part 2 units and 9 part 3 units and this cannot be altered.

Production planning solution

Variables

We need to decide the amount of time given over to the production of parts in each department
(since we, obviously, may not make use of all the available working time) and also to decide the total
number of finished (assembled) products made. Hence let:

xi = number of hours used in department i (i=1,2)

y = number of finished (assembled) products made

where xi >= 0 i=1,2 and y >= 0 and (as is usual) we assume that any fractional parts in the variables in
the numerical solution of the LP are not significant.

Constraints

 working hours available

x1 <= 100

x2 <= 110

 number of assembled products produced

1050 <= y <= 1200

 production constraints relating the hours worked to the number of assembled products

We produce (7x1 + 6x2) part 1 units, (6x1 + 11x2) part 2 units and (9x1 + 5x2) part 3 units. Now to
ensure that the number of assembled products produced is exactly y we need at least y part 1 units,
at least y part 2 units and at least y part 3 units. Hence we have the three constraints

7x1 + 6x2 >= y

6x1 + 11x2 >= y

9x1 + 5x2 >= y

 the total number of parts (of all types) produced is (7x 1 + 6x2) + (6x1 + 11x2) + (9x1 + 5x2) =
22x1 + 22x2. Since we produce exactly y assembled products the number of parts left over at
the end of the week is (22x1 + 22x2) - 3y and hence the constraint relating to the limited
storage space is given by

22x1 + 22x2 - 3y <= 200

Objective

minimise 25.0x1 + 12.5x2

Obvious extensions to this problem involve increasing (from the current value of 3) the number of
parts needed for the finished product and changing the ratio of parts used in a finished product from
its current value of 1:1:1.
J E Beasley

OR-Notes are a series of introductory notes on topics that fall under the broad heading of the field of
operations research (OR). They were originally used by me in an introductory OR course I give at
Imperial College. They are now available for use by any students and teachers interested in OR
subject to the following conditions.

A full list of the topics available in OR-Notes can be found here.

Linear programming solution examples

Linear programming example 1997 UG exam

A company makes two products (X and Y) using two machines (A and B). Each unit of X that is
produced requires 50 minutes processing time on machine A and 30 minutes processing time on
machine B. Each unit of Y that is produced requires 24 minutes processing time on machine A and 33
minutes processing time on machine B.

At the start of the current week there are 30 units of X and 90 units of Y in stock. Available
processing time on machine A is forecast to be 40 hours and on machine B is forecast to be 35 hours.

The demand for X in the current week is forecast to be 75 units and for Y is forecast to be 95 units.
Company policy is to maximise the combined sum of the units of X and the units of Y in stock at the
end of the week.

 Formulate the problem of deciding how much of each product to make in the current week
as a linear program.

 Solve this linear program graphically.

Solution

Let

 x be the number of units of X produced in the current week

 y be the number of units of Y produced in the current week

then the constraints are:

 50x + 24y <= 40(60) machine A time

 30x + 33y <= 35(60) machine B time

 x >= 75 - 30

 i.e. x >= 45 so production of X >= demand (75) - initial stock (30), which ensures we meet demand

 y >= 95 - 90

 i.e. y >= 5 so production of Y >= demand (95) - initial stock (90), which ensures we meet demand

The objective is: maximise (x+30-75) + (y+90-95) = (x+y-50)


i.e. to maximise the number of units left in stock at the end of the week
It is plain from the diagram below that the maximum occurs at the intersection of x=45 and 50x +
24y = 2400

Solving simultaneously, rather than by reading values off the graph, we have that x=45 and y=6.25
with the value of the objective function being 1.25

Linear programming example 1995 UG exam

The demand for two products in each of the last four weeks is shown below.

Week

1 2 3 4

Demand - product 1 23 27 34 40

Demand - product 2 11 13 15 14

Apply exponential smoothing with a smoothing constant of 0.7 to generate a forecast for the


demand for these products in week 5.

These products are produced using two machines, X and Y. Each unit of product 1 that is produced
requires 15 minutes processing on machine X and 25 minutes processing on machine Y. Each unit of
product 2 that is produced requires 7 minutes processing on machine X and 45 minutes processing
on machine Y. The available time on machine X in week 5 is forecast to be 20 hours and on machine
Y in week 5 is forecast to be 15 hours. Each unit of product 1 sold in week 5 gives a contribution to
profit of £10 and each unit of product 2 sold in week 5 gives a contribution to profit of £4.
It may not be possible to produce enough to meet your forecast demand for these products in week
5 and each unit of unsatisfied demand for product 1 costs £3, each unit of unsatisfied demand for
product 2 costs £1.

 Formulate the problem of deciding how much of each product to make in week 5 as a linear
program.

 Solve this linear program graphically.

Solution

Note that the first part of the question is a forecasting question so it is solved below.

For product 1 applying exponential smoothing with a smoothing constant of 0.7 we get:

M1 = Y1 = 23
M2 = 0.7Y2 + 0.3M1 = 0.7(27) + 0.3(23) = 25.80
M3 = 0.7Y3 + 0.3M2 = 0.7(34) + 0.3(25.80) = 31.54
M4 = 0.7Y4 + 0.3M3 = 0.7(40) + 0.3(31.54) = 37.46

The forecast for week five is just the average for week 4 = M 4 = 37.46 = 31 (as we cannot have
fractional demand).

For product 2 applying exponential smoothing with a smoothing constant of 0.7 we get:

M1 = Y1 = 11
M2 = 0.7Y2 + 0.3M1 = 0.7(13) + 0.3(11) = 12.40
M3 = 0.7Y3 + 0.3M2 = 0.7(15) + 0.3(12.40) = 14.22
M4 = 0.7Y4 + 0.3M3 = 0.7(14) + 0.3(14.22) = 14.07

The forecast for week five is just the average for week 4 = M 4 = 14.07 = 14 (as we cannot have
fractional demand).

We can now formulate the LP for week 5 using the two demand figures (37 for product 1 and 14 for
product 2) derived above.

Let

x1 be the number of units of product 1 produced

x2 be the number of units of product 2 produced

where x1, x2>=0

The constraints are:

15x1 + 7x2 <= 20(60) machine X

25x1 + 45x2 <= 15(60) machine Y

x1 <= 37 demand for product 1

x2 <= 14 demand for product 2

The objective is to maximise profit, i.e.

maximise 10x1 + 4x2 - 3(37- x1) - 1(14-x2)


i.e. maximise 13x1 + 5x2 - 125

The graph is shown below, from the graph we have that the solution occurs on the horizontal axis
(x2=0) at x1=36 at which point the maximum profit is 13(36) + 5(0) - 125 = £343

Linear programming example 1994 UG exam

A company is involved in the production of two items (X and Y). The resources need to produce X
and Y are twofold, namely machine time for automatic processing and craftsman time for hand
finishing. The table below gives the number of minutes required for each item:

Machine time Craftsman time

Item X 13 20

Y 19 29

The company has 40 hours of machine time available in the next working week but only 35 hours of
craftsman time. Machine time is costed at £10 per hour worked and craftsman time is costed at £2
per hour worked. Both machine and craftsman idle times incur no costs. The revenue received for
each item produced (all production is sold) is £20 for X and £30 for Y. The company has a specific
contract to produce 10 items of X per week for a particular customer.

 Formulate the problem of deciding how much to produce per week as a linear program.

 Solve this linear program graphically.

Solution
Let

 x be the number of items of X

 y be the number of items of Y

then the LP is:

maximise

 20x + 30y - 10(machine time worked) - 2(craftsman time worked)

subject to:

 13x + 19y <= 40(60) machine time

 20x + 29y <= 35(60) craftsman time

 x >= 10 contract

 x,y >= 0

so that the objective function becomes

maximise

 20x + 30y - 10(13x + 19y)/60 - 2(20x + 29y)/60

i.e. maximise

 17.1667x + 25.8667y

subject to:

 13x + 19y <= 2400

 20x + 29y <= 2100

 x >= 10

 x,y >= 0

It is plain from the diagram below that the maximum occurs at the intersection of x=10 and 20x +
29y <= 2100

Solving simultaneously, rather than by reading values off the graph, we have that x=10 and y=65.52
with the value of the objective function being £1866.5
Linear programming example 1992 UG exam

A company manufactures two products (A and B) and the profit per unit sold is £3 and £5
respectively. Each product has to be assembled on a particular machine, each unit of product A
taking 12 minutes of assembly time and each unit of product B 25 minutes of assembly time. The
company estimates that the machine used for assembly has an effective working week of only 30
hours (due to maintenance/breakdown).

Technological constraints mean that for every five units of product A produced at least two units of
product B must be produced.

 Formulate the problem of how much of each product to produce as a linear program.

 Solve this linear program graphically.

 The company has been offered the chance to hire an extra machine, thereby doubling the
effective assembly time available. What is the maximum amount you would be prepared to
pay (per week) for the hire of this machine and why?

Solution

Let

xA = number of units of A produced


xB = number of units of B produced

then the constraints are:

12xA + 25xB <= 30(60) (assembly time)

xB >= 2(xA/5)

i.e. xB - 0.4xA >= 0

i.e. 5xB >= 2xA (technological)

where xA, xB >= 0

and the objective is

maximise 3xA + 5xB

It is plain from the diagram below that the maximum occurs at the intersection of 12x A + 25xB = 1800
and xB - 0.4xA = 0

Solving simultaneously, rather than by reading values off the graph, we have that:

xA= (1800/22) = 81.8

xB= 0.4xA = 32.7

with the value of the objective function being £408.9


Doubling the assembly time available means that the assembly time constraint (currently 12x A +
25xB <= 1800) becomes 12xA + 25xB <= 2(1800) This new constraint will be parallel to the existing
assembly time constraint so that the new optimal solution will lie at the intersection of 12x A + 25xB =
3600 and xB - 0.4xA = 0

i.e. at xA = (3600/22) = 163.6

xB= 0.4xA = 65.4

with the value of the objective function being £817.8

Hence we have made an additional profit of £(817.8-408.9) = £408.9 and this is


the maximum amount we would be prepared to pay for the hire of the machine for doubling the
assembly time.

This is because if we pay more than this amount then we will reduce our maximum profit below
the £408.9 we would have made without the new machine.

Linear programming example 1988 UG exam

Solve

minimise

4a + 5b + 6c

subject to

a + b >= 11

a - b <= 5

c-a-b=0

7a >= 35 - 12b

a >= 0 b >= 0 c >= 0

Solution

To solve this LP we use the equation c-a-b=0 to put c=a+b (>= 0 as a >= 0 and b >= 0) and so the LP is
reduced to

minimise

4a + 5b + 6(a + b) = 10a + 11b

subject to

a + b >= 11

a - b <= 5

7a + 12b >= 35

a >= 0 b >= 0
From the diagram below the minimum occurs at the intersection of a - b = 5 and a + b = 11

i.e. a = 8 and b = 3 with c (= a + b) = 11 and the value of the objective function 10a + 11b = 80 + 33 =
113.

Linear programming example 1987 UG exam

Solve the following linear program:

maximise 5x1 + 6x2

subject to

x1 + x2 <= 10

x1 - x2 >= 3

5x1 + 4x2 <= 35

x1 >= 0

x2 >= 0

Solution

It is plain from the diagram below that the maximum occurs at the intersection of

5x1 + 4x2 = 35 and


x1 - x2 = 3

Solving simultaneously, rather than by reading values off the graph, we have that

5(3 + x2) + 4x2 = 35

i.e. 15 + 9x2 = 35

i.e. x2 = (20/9) = 2.222 and

x1 = 3 + x2 = (47/9) = 5.222

The maximum value is 5(47/9) + 6(20/9) = (355/9) = 39.444

Linear programming example 1986 UG exam

A carpenter makes tables and chairs. Each table can be sold for a profit of £30 and each chair for a
profit of £10. The carpenter can afford to spend up to 40 hours per week working and takes six hours
to make a table and three hours to make a chair. Customer demand requires that he makes at least
three times as many chairs as tables. Tables take up four times as much storage space as chairs and
there is room for at most four tables each week.

Formulate this problem as a linear programming problem and solve it graphically.

Solution

Variables
Let

xT = number of tables made per week

xC = number of chairs made per week

Constraints

 total work time

6xT + 3xC <= 40

 customer demand

xC >= 3xT

 storage space

(xC/4) + xT <= 4

 all variables >= 0

Objective

maximise 30xT + 10xC

The graphical representation of the problem is given below and from that we have that the solution
lies at the intersection of

(xC/4) + xT = 4 and 6xT + 3xC = 40

Solving these two equations simultaneously we get x C = 10.667, xT = 1.333 and the corresponding
profit = £146.667
Introduction

Optimization of resources (cost and time) is required in every aspect of our lives. We need the
optimization because we have limited time and cost resources, and we need to take maximum out
of them. From manufacturing to resolving supply chain issues, every aspect of the business world
today requires optimization to stay competitive.

Linear programming offers the most easiest way to do optimization as it simplifies the constraints
and helps to reach a viable solution to a complex problem. In this article, we will solve some of the
linear programming problems through graphing method.

The best Maths tutors available

4.9 (36 reviews)

Intasar

£48

/h

1st lesson free!
4.9 (29 reviews)

Paolo

£30

/h

1st lesson free!

5 (16 reviews)

Jamie

£25

/h

1st lesson free!
5 (16 reviews)

Harinder

£15

/h

1st lesson free!

5 (17 reviews)

Matthew

£30

/h

1st lesson free!
4.9 (12 reviews)

Petar

£40

/h

1st lesson free!

5 (24 reviews)

Shane

£25

/h

1st lesson free!

4.9 (31 reviews)

Sehaj

£25

/h
1st lesson free!

4.9 (36 reviews)

Intasar

£48

/h

1st lesson free!

4.9 (29 reviews)

Paolo

£30

/h

1st lesson free!

5 (16 reviews)

Jamie

£25

/h

1st lesson free!
5 (16 reviews)

Harinder

£15

/h

1st lesson free!

5 (17 reviews)

Matthew

£30

/h

1st lesson free!

4.9 (12 reviews)

Petar

£40

/h

1st lesson free!
5 (24 reviews)

Shane

£25

/h

1st lesson free!

4.9 (31 reviews)

Sehaj

£25

/h

1st lesson free!

Let's go

Exercise 1

A transport company has two types of trucks, Type A and Type B. Type A has a refrigerated capacity
of   and a non-refrigerated capacity of   while Type B has the same overall volume with
equal sections for refrigerated and non-refrigerated stock. A grocer needs to hire trucks for the
transport of   of refrigerated stock and   of non-refrigerated stock. The cost
per kilometer of a Type A is $30, and $40 for Type B. How many trucks of each type should the
grocer rent to achieve the minimum total cost?

Exercise 2

A school is preparing a trip for 400 students. The company who is providing the transportation has
10 buses of 50 seats each and 8 buses of 40 seats, but only has 9 drivers available. The rental cost for
a large bus is $800 and $600 for the small bus. Calculate how many buses of each type should be
used for the trip for the least possible cost.

Exercise 3

A store wants to liquidate 200 of its shirts and 100 pairs of pants from last season. They have
decided to put together two offers, A and B. Offer A is a package of one shirt and a pair of pants
which will sell for $30. Offer B is a package of three shirts and a pair of pants, which will sell for $50.
The store does not want to sell less than 20 packages of Offer A and less than 10 of Offer B. How
many packages of each do they have to sell to maximize the money generated from the promotion?

Solution of exercise 1

A transport company has two types of trucks, Type A and Type B. Type A has a refrigerated capacity
of   and a non-refrigerated capacity of   while Type B has the same overall volume
with equal sections for refrigerated and non-refrigerated stock. A grocer needs to hire trucks for the
transport of   of refrigerated stock and   of non-refrigerated stock. The cost
per kilometer of a Type A is $30, and $40 for Type B. How many trucks of each type should the
grocer rent to achieve the minimum total cost?

a) Choose the unknowns.

x = Type A trucks

y = Type B trucks

b)Write the objective function.

c)Write the constraints as a system of inequalities.

d)Find the set of feasible solutions that graphically represent the constraints.

Example 1 - part d
e)Calculate the coordinates of the vertices from the compound of feasible solutions.

Example 1 - part e

f)Calculate the value of the objective function at each of the vertices to determine which of them
has the maximum or minimum values.

As x and y must be natural numbers round the value of y.

By default, we see what takes the value x to y = 66 in the


equation   which it is within the feasible solutions.

The minimum cost is $4170. To achieve this 51 trucks of Type A and 66 trucks of Type B are
needed.

Solution of exercise 2

A school is preparing a trip for 400 students. The company who is providing the transportation has
10 buses of 50 seats each and 8 buses of 40 seats, but only has 9 drivers available. The rental cost for
a large bus is $800 and $600 for the small bus. Calculate how many buses of each type should be
used for the trip for the least possible cost.

a)Choose the unknowns.

x = small buses

y = big buses

b)Write the objective function.


c)Write the constraints as a system of inequalities.

d) Find the set of feasible solutions that graphically represent the constraints.

Example 2 - part d

e) Calculate the coordinates of the vertices from the compound of feasible solutions.

Example 2 - part e

f) Calculate the value of the objective function at each of the vertices to determine which of them
has the maximum or minimum values.
 

Hence, the minimum cost is $6200. This is achieved with 4 large and 5 small buses.

We substituted the points (0,9), (0,8), and (5,4) in the equation to determine the minimum cost.
However, you can tell this by directly looking at the graph. The coordinate (5,4) comes under the
feasible region and is the minimum point of it.

Solution of exercise 3

A store wants to liquidate 200 of its shirts and 100 pairs of pants from last season. They have
decided to put together two offers, A and B. Offer A is a package of one shirt and a pair of pants
which will sell for $30. Offer B is a package of three shirts and a pair of pants, which will sell for $50.
The store does not want to sell less than 20 packages of Offer A and less than 10 of Offer B. How
many packages of each do they have to sell to maximize the money generated from the promotion?

a)Choose the unknowns.

x = number of packages of Offer A

y = number of packages of Offer B

b)Write the objective function.

c)Write the constraints as a system of inequalities.

d)Find the set of feasible solutions that graphically represent the constraints.


Example 3 - part
d

e) Calculate the coordinates of the vertices from the compound of feasible solutions.

Example 3 - part e

f)Calculate the value of the objective function at each of the vertices to determine which of them
has the maximum or minimum values.

50 packages of each offer generates a maximum amount of $4000 in sales.

You might also like