Solving a Linear Programming Problem Graphically (Edexcel A Level Further Maths: Decision Maths 1)

Revision Note

Test yourself
Paul

Author

Paul

Last updated

Introduction to Solving an LP Problem Graphically

How do I solve a linear programming problem graphically?

  • For problems with two decision variables
    • the constraints (inequalities) are plotted accurately on a graph
    • this leads to the feasible region
    • the optimal solution will be one of the vertices of the feasible region
  • In harder problems
    • there may be a third decision variable
      • but there will be a connection to one (or both) of the other decision variables such that all constraints can be rewritten in terms of just two of them
        e.g.
        x comma space y comma space z are the numbers of chairs, tables and desks made by a furniture manufacturer
        but the number of desks produced is twice the number of tables (i.e.  z equals 2 y)
    • the optimal solution may not give integer values for the decision variables but the context demands they are
      • e.g.  is it possible to make 3.65 chairs and 4.2 tables per day?

Feasible Region

What is the feasible region?

  • Technically, the feasible region is the set of all values that satisfy all the constraints in a linear programming problem
  • In practice, this is the area on a graph that satisfies all of the inequalities
    • including the non-negativity constraint/inequality

How do I find the feasible region?

  • To find the feasible region
    • accurately plot each inequality (constraint) on a graph
      • plot each inequality as a straight line
        • rearranging to the form y less or equal than m x plus c or y greater or equal than m x plus c may help
        • but it can be easier to determine two points that lie on each line, plot and join them up
      • draw the line solid for inequalities involving ≤ or ≥, or dotted for inequalities involving > or <
        • (< and > are rare in linear programming problems)
    • shade the part of the graph not satisfied by each inequality
      • be careful with graphing software - these will often shade the part of the graph that does satisfiy an inequality
      • but it is easier to see a 'blank' area rather than an area shaded several times
      • a workaround to this is to reverse the inequality sign when typing the inequality into the software
    • the feasible region is the area on the graph left unshaded
      • it is the area that satisfies all of the inequalities
      • it is usually labelled with the capital letter R
  • Label each inequality/line around the edge of the graph

Examiner Tip

  • Exam questions will provide a graph for you to accurately plot the inequalities on or provide an accurate graph with some or all of the inequalities already plotted

Worked example

A linear programming problem is formulated as

Maximise

P equals 30 x plus 40 y

subject to

table row cell x plus y end cell less or equal than 10 row cell 3 x plus 2 y end cell less or equal than 24 row cell x plus 2 y end cell less or equal than 18 row cell x comma space y end cell greater or equal than 0 end table

Show graphically the feasible region, R, of the linear programming problem.

(The objective function is not needed to plot the feasible region)

Plot each inequality as a straight line graph with the 'unwanted' side shaded - all will be solid lines
The first constraint will be the line y equals negative x plus 10 (gradient -1 and y-axis intercept 10)
(You may find it easier to 'see' that points like (0, 10) and (10, 0) lie on the line, which you can plot and join up)

feasible-1

Plot and label the rest of the inequalities in the same way

feasible-2

Label the feasible region with R

feasible-3-green

Objective Line

What is the objective line?

  • The objective function (for an LP problem with two decision variables) is of the form P equals a x plus b y
    • Rearranged, this is of the form 'y equals m x plus c'
    • So for a particular value of P, there is a straight line graph
      • this is the objective line

How does an objective line indicate where the optimal solution is?

  • In a linear programming problem, P is usually unknown - it is the quantity that is to be maximised or minimised
    • In maximisation problems increasing the value of P 'moves' the objective line away from the origin and towards the upper boundaries of the feasible region

objective-line-max-rn-1

    • Similarly, in minimisation problems, decreasing the value of P 'moves' the objective line closer to the origin and towards the lower boundaries of the feasible region

objective-line-min-rn-2

  • It therefore follows that the optimal solution to a linear programming problem occurs when an objective line passes through a vertex of the feasible region
    • which vertex this is will depend on the gradient of the objective line

How do I find the optimal solution to a linear programming problem using an objective line?

  • Whether maximising or minimising, for the objective function P equals a x plus b y
    • choose a value of P that is a multiple of a and b
    • plot the objective line P equals a x plus b y
      • this is usually easiest by considering the two points where x equals 0 and where y equals 0
    • using your ruler, and keeping it parallel to the objective line just drawn move it away (for maximisation) or towards (for minimisation) the origin
    • the last vertex of the feasible region that your ruler passes through will be the optimal solution to the problem

Examiner Tip

  • To show your working (and understanding) draw an objective line each time your ruler passes through a vertex of the feasible region

Worked example

The constraints of a linear programming problem and the feasible region (labelled R) are shown in the graph below.

yLJQ8SPl_picture-1

The objective function, P equals 30 x plus 40 y is to be maximised.

Showing your method clearly, use the objective line method to determine the optimal solution to the problem.

To get started, choose a value of P that is both a multiple of 30 and 40.  We've started with 120.
Now plot the objective line with equation 120 equals 30 x plus 40 y
You can rearrange if you prefer, but by choosing a multiple of 30 and 40, it is easy to see this line will pass through the points (0, 3) and (4, 0)

picture-2

After plotting an initial line, slide your ruler parallel and 'up' the graph (away from the origin, as it is a maximising problem)
Draw an objective line when your ruler passes through a vertex of the feasible region - (8, 0), (4, 6) and (2, 8)

picture-3

The optimal solution is the last vertex the objective line passes through - which in this case is (2, 8)

The optimal solution is bold italic x bold equals bold 2 bold comma bold space bold italic y bold equals bold 8 and bold italic P is maximised at bold italic P bold equals bold 30 bold cross times bold 2 bold plus bold 40 bold cross times bold 8 bold equals bold 380

Vertex Method

What is the vertex method?

  • The vertex method is a way to find the optimal solution to a linear programming problem
  • The optimal solution to a linear programming problem lies on a vertex of the feasible region
  • By finding the coordinates of these vertices the values for the decision variables can be deduced
  • Substituting each of these sets of decision variables into the objective function allows the maximum or minimum objective function to be determined

How do I find the optimal solution from the vertex method?

  • STEP 1
    Find the coordinates of each vertex of the feasible region
    • If an accurate plot of the region is provided or drawn, these may be able to be read directly from the graph
    • On less accurate diagrams, some vertices may be obvious - such as the origin or any vertices along an axis
    • Otherwise find the vertices by solving each pair of the inequalities as simultaneous equations
      e.g.  For the inequalities x plus y less or equal than 8 and x plus 4 y less or equal than 17 solve the simultaneous equations x plus y equals 8 and x plus 4 y equals 17

  • STEP 2
    Substitute the coordinates of each vertex (i.e. the decision variables) into the objective function and evaluate it

  • STEP 3
    Determine which set of decision variables lead to the maximum or minimum objective function as required by the problem
    • This will be the optimal solution

Examiner Tip

  • In maximising problems where the origin is a vertex of the feasible region
    • it is usually obvious that the origin will not be the optimal solution
      • it is still a vertex of the feasible region however, so should be included in your list of vertices

Worked example

The graph below shows the feasible region, labelled R, of a linear programming problem where the objective function is to maximise P equals 2 x plus 5 y subject to the constraints shown on the graph.

vertex-we

Use the vertex method to solve the linear programming problem.

  • STEP 1
    Find the coordinates of each vertex of the feasible region
    Three of them should be obvious to spot!

bold italic x bold equals bold 0 bold comma bold space bold italic y bold equals bold 0
stretchy left parenthesis 0 comma space 0 stretchy right parenthesis

bold italic x bold equals bold 0 bold comma bold space bold italic y bold minus bold 2 bold italic x bold equals bold 2
stretchy left parenthesis 0 comma space 2 stretchy right parenthesis

bold italic x bold plus bold italic y bold equals bold 8 bold comma bold space bold italic y bold equals bold 0
stretchy left parenthesis 8 comma space 0 stretchy right parenthesis

For the two vertices that are not obvious, solve the appropriate simultaneous equations
(Your calculator may have a simultaneous equation solver that you can use)

bold italic y bold minus bold 2 bold italic x bold equals bold 2 bold comma bold space bold italic x bold plus bold 4 bold italic y bold equals bold 17
y equals 2 plus 2 x
x plus 4 open parentheses 2 plus 2 x close parentheses equals 17
9 x equals 9
x equals 1 comma space y equals 2 plus 2 open parentheses 1 close parentheses equals 4
stretchy left parenthesis 1 comma space 4 stretchy right parenthesis

bold italic x bold plus bold 4 bold italic y bold equals bold 17 bold comma bold space bold italic x bold plus bold italic y bold equals bold 8
x equals 8 minus y
8 minus y plus 4 y equals 17
3 y equals 9
y equals 3 comma space x equals 8 minus 3 equals 5
stretchy left parenthesis 5 comma space 3 stretchy right parenthesis

  • STEP 2
    Find P equals 2 x plus 5 y for each pair of x and y values
    Writing them out in a table can help keep track and make the optimal solution stand out
x y P equals 2 x plus 5 y
0 0 0
0 2 5 × 2 = 10
8 0 2 × 8 = 16
1 4 2 × 1 + 5 × 4 = 22
5 3 2 × 5 + 5 × 3 = 25

  • STEP 3
    The maximum value is 25, which occurs when x equals 5 and y equals 3

The optimal solution is bold italic x bold equals bold 5 bold comma bold space bold italic y bold equals bold 3 giving a maximum value of bold italic P bold equals bold 25

Integer Solutions

What do we mean by integer solutions?

  • The optimal solution to a linear programming problem lies on a vertex of the feasible region
  • The values of the decision variables at this vertex may not take integer values
  • However the context of the problem may demand that the decision variables take integer values
    • Decision variables are often a 'number of things'
      • is it possible for the furniture manufacturer to make 3.65 chairs per day?
      • for public health reasons, it would not be appropriate for a food factory to leave a tin of beans partially produced overnight !
  • This is what is meant by the phrase integer solutions

How do I find the integer solutions to a linear programming problem?

  • Find the optimal solution of the linear programming problem as usual
    • using the objective line or vertex method
  • Consider the four points with integer coordinates that surround the optimal solution
    • e.g.
      for an optimal solution of x equals 3.2 comma space y equals 4.7, the four surrounding points would be
      (3, 4), (3, 5), (4, 5) and (4, 4)

G_aVH0oe_integer-solution-rn

  • Check whether each of these four points satisfies all of the constraints
    • it may be obvious that one (or more) do not but they should still be mentioned
  • For those coordinates that do satisfy all the constraints
    • evaluate the objective function (P) at each of the coordinates
    • the integer solution will be the point that maximises or minimises the objective function as required
  • The integer solution may not be the optimal solution
    • Depending on the exact nature (gradient) of the objective line
      • The objective line 'moves away' from the boundary of the feasible region when an integer solution is found
      • So there could be another integer solution inside (or on the boundary of) the feasible region some way from the optimal solution
      • This other integer solution may be closer to the boundary of the feasible region than the one just found
    • You will not be expected to find this other integer solution, just to recognise that the integer solution found using the above process is not necessarily optimal

Examiner Tip

  • Questions won't necessarily indicate if integer solutions are required
    • Use common sense and think carefully about the context of the problem

Worked example

The linear programming problem formulated as

Maximise

P equals 5 x plus 10 y

subject to

table row cell 13 x plus 22 y end cell less or equal than 145 row cell 10 x minus 20 y end cell less or equal than 3 row cell 13 x minus 8 y end cell greater or equal than 4 row cell 6 x plus 5 y end cell less or equal than 50 row cell x comma space y end cell greater or equal than 0 end table

has optimal solution x equals 3.2 comma space y equals 4.7 space open parentheses P equals 63 close parentheses.

However, the decision variables may only take integer values.
Find the solution closest to the optimal solution, stating the values of the decision variables and the resulting value of P.

The four surrounding integer coordinates to (3.2, 4.7) are

(3, 4), (3, 5), (4, 5), (4, 4)

Check that these satisfy all the constraints and if so, evaluate P
Once a point fails to satisfy an inequality we do not need to make any further checks

yGrijk_b_picture-1

The integer solution closest to the optimal solution is bold italic x bold equals bold 4 bold comma bold space bold italic y bold equals bold 4 and bold italic P bold equals bold 60

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Paul

Author: Paul

Expertise: Maths

Paul has taught mathematics for 20 years and has been an examiner for Edexcel for over a decade. GCSE, A level, pure, mechanics, statistics, discrete – if it’s in a Maths exam, Paul will know about it. Paul is a passionate fan of clear and colourful notes with fascinating diagrams – one of the many reasons he is excited to be a member of the SME team.