askvity

How to Draw an Objective Line

Published in Linear Programming Graphing 5 mins read

An objective line in optimization problems, particularly linear programming, represents combinations of decision variables that yield a constant value for the objective function (e.g., maximizing profit or minimizing cost). It's essentially a level set of the objective function, often expressed in the form ax + by = Z, where 'a' and 'b' are coefficients, 'x' and 'y' are variables, and 'Z' is the objective value.

Drawing an objective line (or lines parallel to it) on a graph helps visualize how the objective function changes across the feasible region and identify optimal solutions.

Methods for Drawing an Objective Line

There are a couple of common approaches to drawing an objective line or lines parallel to it on a graph:

  1. Using Intercepts (Standard Method):

    • Choose a convenient value for the objective function, Z. This value can be arbitrary, as you primarily need to establish the line's slope and direction. Pick a value that makes calculating intercepts easy (e.g., a multiple of 'a' and 'b').
    • Set y = 0 and solve the equation ax + by = Z for x. This gives you the x-intercept point (Z/a, 0).
    • Set x = 0 and solve the equation ax + by = Z for y. This gives you the y-intercept point (0, Z/b).
    • Plot these two points on your graph.
    • Draw a straight line connecting these two points. This line represents the objective function for your chosen value of Z.
  2. Using Coefficients to Determine Direction (As Seen in Reference):

    • Identify the coefficients 'a' (of x) and 'b' (of y) in your objective function Z = ax + by.
    • As described in the video snippet ["How to use an objective line (ruler method) to Optimise - YouTube"](), a technique is to "simply swap the coefficients round".
    • Plot a point on the x-axis corresponding to the value of the coefficient of y (which is 'b'). This gives the point (b, 0).
    • Plot a point on the y-axis corresponding to the value of the coefficient of x (which is 'a'). This gives the point (0, a).
    • Draw a straight line connecting these two points (b, 0) and (0, a).
    • Insight: The line connecting (b, 0) and (0, a) has the equation ax + by = ab. This line is parallel to all objective lines ax + by = Z for any value of Z. Therefore, this method effectively draws a line that shows the direction and slope of your objective function's level curves, which is crucial for the "ruler method" of optimization.

Practical Example

Let's say your objective function is to maximize Z = 3x + 4y. Here, a = 3 and b = 4.

Using the methods:

  • Method 1 (Intercepts):

    • Choose a value for Z, say Z = 12 (a multiple of 3 and 4).
    • x-intercept: 3x + 4(0) = 12 => 3x = 12 => x = 4. Point is (4, 0).
    • y-intercept: 3(0) + 4y = 12 => 4y = 12 => y = 3. Point is (0, 3).
    • Plot (4, 0) and (0, 3) and draw the line through them.
  • Method 2 (Using Coefficients from Reference):

    • Coefficient of y is b = 4. Plot on x-axis: (4, 0).
    • Coefficient of x is a = 3. Plot on y-axis: (0, 3).
    • Plot (4, 0) and (0, 3) and draw the line through them. This line 3x + 4y = 12 is parallel to other objective lines for different Z values.

Notice that in this specific example (Z=12), both methods yield the same line. This is because ab = 3 * 4 = 12. If you chose a different Z value in Method 1 (e.g., Z=24), you would get the line 3x + 4y = 24 with intercepts (8, 0) and (0, 6), which would be parallel to the line 3x + 4y = 12 drawn using Method 2.

How to Use the Objective Line

Once you've drawn an objective line (or a reference line parallel to it using Method 2), you can use it to find the optimal solution within the feasible region:

  1. Draw the feasible region defined by your constraints.
  2. Draw one objective line using either method.
  3. Imagine moving a ruler parallel to this line across the feasible region.
    • If you're maximizing Z, the optimal solution lies on the boundary of the feasible region at the point where the objective line last touches the region as you move it in the direction that increases Z (away from the origin if Z=0).
    • If you're minimizing Z, the optimal solution lies where the objective line first touches the region as you move it in the direction that decreases Z (towards the origin if Z=0).

By drawing the objective line, you visually represent the function you are trying to optimize and how its value changes across the solution space.

Related Articles