Module 2 of 6 · Lesson 2 of 3
Contour Lines and the Direction of Improvement
Where the objective is constant, and which way along it improves.
What you will be able to do
Given a linear objective and a direction of optimisation, the learner can draw or describe the contour family, identify the coefficient vector as the direction of increase, decide whether a proposed direction improves the objective, and state which way a contour must be pushed.
Orientation
Points of equal objective value form parallel lines. Everything about solving a linear program graphically follows from knowing which way to push them.
Those are two skills, not one, and only the first is drawing. The family of lines needs the slope, and the slope is identical whether you are maximising or minimising. Which way to push needs the sign, and the sign comes from the coefficient vector together with the direction of optimisation.
This matters because the second skill fails silently. A contour family drawn perfectly and pushed the wrong way produces a confident answer at the wrong corner, and nothing in the drawing looks amiss.
This unit assumes you can compute a dot product and plot a straight line.
Intuition
Deciding the direction on a worked program
Two programs sharing one contour family, worked to the point where the drawing stops helping.
Program A. Maximise
The contour family is identical: the lines
Where they differ. Take the point
so the objective rises by
A direction that changes nothing. Take
Moving along
A test to run before trusting a drawing. Pick any two points in the feasible region, compute the objective at both, and confirm the one you believe is better actually scores better. On Program B,
Why this is the error that survives practice. A learner who has only maximised builds the habit "push away from the origin", and it works every time until the first minimisation. The habit is a coincidence of the problems seen, not a rule, and the drawing offers no warning when it fails.
Figure
Objective contours and the coefficient vector normal to them
The two ways of seeing a linear objective, drawn in one scene because the lesson's idea is the translation between them.
As contours.
As a vector. The coefficient vector
The translation is the thing to carry away:
The two forms carry different information, which is why the lesson keeps both. From
Maximising means sliding the contour as far as it will go along
Definition
Contours, the coefficient vector, and the sign test
The canonical statement gives the contour geometry and the test
Which way to move. The objective changes by
Whether a whole edge is optimal. If
Why the gradient and the contours are both needed. The contour family says where equal-value lines run but is identical for
A caution about slope:
Example
Reading direction off the coefficients
A maximisation with positive coefficients.
The same objective minimised.
A negative coefficient.
A direction test. With
The last case is the significant one. A direction with
Worked example
Deciding which corner a minimisation reaches
Problem. For
say which corner the contour reaches last, using the direction of improvement rather than testing every corner.
Goal. Identify the optimal corner from the geometry, then confirm.
Relevant principle.
Step 1: write down
Step 2: find the travel direction. Minimising, so travel along
Step 3: push that way within the region. Going left drives
Step 4: confirm against the other corners. They are
Check the sign convention held. Had this been a maximisation, travel would be along
What did the work. The coefficient signs alone identified the corner before any value was computed. Enumerating the corners confirmed it; it was not the method.
Non-example
Things that are not the improving direction
Not the improving direction: the contour's own slope. The contour for
Not the improving direction: away from the origin. For
Not a contour: a constraint line.
Not a reason to reverse
Contrast
Contour slope against direction of improvement
Two facts about a linear objective look like one fact, and separating them is the whole of this unit.
What the drawing settles. Where the equal-value lines run. This needs only the ratio of the coefficients, and it is identical for
What the drawing cannot settle. Which way along them improves. Those three problems travel in three different ways: along
Why the error survives inspection. Suppose the direction is taken backwards on the first of these. The contours are correct, the region is correct, the contour is slid neatly until it last touches, at the wrong corner. The output is a specific point and a specific value, both plausible, neither flagged by anything visible. Compare an arithmetic slip, which usually produces something that looks odd.
The habit that prevents it. Write
Exercise
1. For
2. With
3. Find a nonzero direction along which
4. A learner says: 'It is a minimisation, so I flipped the objective to
5. Two objectives,
What to carry forward
A linear objective assigns a value to every point. Equal-value points form contours: parallel straight lines sharing the coefficient vector, differing only in position.
The coefficient vector
Any direction can be tested rather than judged. Moving along
Drawing the family and choosing the direction are separate skills with separate failure modes, and only the second fails invisibly. This same quantity returns as the reduced cost once the geometry is gone, where the sign convention is all that remains of the picture.