Module 1 of 6 · Lesson 5 of 7
The Matrix Form of a Linear Program
The same program as one matrix statement, and the two readings of it the later methods are written in.
What you will be able to do
Given a linear program written in scalars, the learner can assemble
Orientation
A program with forty constraints and sixty variables fills a page in scalars and one line in matrix notation. The compression is useful on its own, and it is not the reason the notation is used.
The reason is that
A solver's interface asks for the same three objects: a coefficient array, a right-hand-side vector, a cost vector. Assembling them by hand once is what makes that interface legible.
Intuition
Two questions, one product
Rows answer whether a point is allowed. Row
Columns answer what a plan is made of. Column
So
The readings describe the same numbers and suit different questions. "The feasible region is an intersection of half-spaces" is a row statement. "A basis is a set of
The shapes are not a convention to memorise; they are forced.
Definition
The objects and their shapes
Beyond the statement itself, three details decide whether an assembled
Where each number goes. The coefficient of variable
| Object | Shape | Indexed by |
|---|---|---|
| constraint, then variable | ||
| constraint | ||
| variable | ||
| variable |
Mixed directions.
Maximisation.
What the form does not do. It records the program, unchanged. No constraint is removed, no feasible point is added, and the optimum is the same point it was in scalars.
Principle
Which reading each later result uses
The two readings of
| Result | Reading | Statement |
|---|---|---|
| Feasibility of a point | row | every |
| Active constraints at a point | row | the rows holding with equality |
| Feasible region as a polyhedron | row | intersection of the half-spaces |
| Basic solution | column | choose |
| Direction of a simplex step | column | |
| Reduced cost | column | |
| Unboundedness detected in a pivot | column | no positive entry in the direction |
A pattern is visible in the table. Questions about a point are row questions: they take an
The simplex method is a column method throughout, which is why it is stated for programs in the equality form
Worked example
Assembling a program, then reading it back
The program. A workshop makes three products. Each unit of product 1 uses 2 machine hours, 1 labour hour and 4 kg of material; product 2 uses 1, 2 and 3; product 3 uses 3, 2 and 5. Available: 120 machine hours, 90 labour hours, 250 kg. Unit profits are 30, 20 and 45. Maximise profit.
Step 1: fix the index order. Variables
Step 2: assemble. One row per constraint, one column per variable:
Step 3: write the program.
As a minimisation,
---
Step 4: read a row back. Row 2 is
the labour hours. This is the check that the assembly is right: every row must translate back to a constraint of the original description.
Step 5: read a column back. Column 3 is
Step 6: evaluate a plan both ways. Take
By rows:
Every entry is at most the corresponding entry of
By columns:
The same vector. The readings are two groupings of one calculation, and agreeing on every entry is what makes them readings of one object rather than two procedures.
Step 7: a constraint in the wrong direction. Suppose the description also required total output of at least 12 units:
adding the row
Non-example
Four assemblies that are not the program
Comparing the vectors as wholes. A reader takes
A transposed coefficient matrix. Writing
A dropped direction. A constraint
Omitted zeros. Variable 3 absent from constraint 1 is recorded as
What unites the four is that each produces a well-formed object. Nothing about
Contrast
The same matrix, read two ways
Take
for three products and three resources.
| Row reading | Column reading | |
|---|---|---|
| What one line is | a constraint | an activity |
| Row 2 / column 2 says | product mix uses | one unit of product 2 uses |
| The question it answers | is this plan allowed? | what does this product cost in resources? |
| a list of resource totals, one per constraint | ||
| Used by | feasibility, active sets, the polyhedron | bases, pivots, reduced costs |
Both descriptions are of the same nine numbers. Row 2 and column 2 share only the entry
The practical use of the distinction is diagnostic. A reader stuck on "what is