Linear Programming¶
After the first week of project presentations, we start the sixth week looking at mathematical optimization.
Optimization Problems¶
A linear programming problem is particular form of a mathematical optimization problem, motivated by production planning. We want to maximize profit and minimize cost, expressed as
Viewing linear programming geometrically, the linear constraints define a polyhedron, illustrated by Fig. 44.

Fig. 44 A polyhedron as the intersection of half planes.¶
We want the optimization problem to be feasible and well posed defined below:
If the polyhedron is not empty, then the problem is feasible.
If the polyhedron is bounded, then the problem is well posed.
Consider the standard form for a linear minimization problem:
To turn the inequalities into equalities, we add slack variables \({\bf z} \in {\mathbb R}^m\):
To make all variables positive, split \({\bf x} = {\bf x}^+ - {\bf x}^-\), where \({\bf x}^+ \geq {\bf 0}$, ${\bf x}^- \geq {\bf 0}\):
A classical application of linear programming is the diet problem. The problem is to plan healthy but economical meals. We want to determine the number of quantities of each nutrient, subject to the minimal requirements, minimizing the cost.
Typically \(m > n\) in the linear programming problem:
The Simplex Algorithm¶
The main idea of the simplex algorithm is to move from one vertex to another vertex in the polyhedron, improving the objective value in each move.
Bring the problem in standard form:
\({\rm min}~ {\bf c}^T {\bf x}\) subject to \(A{\bf x} = {\bf b}\), \({\bf x} \geq {\bf 0}\).
Find one feasible point.
Find one feasible vertex point.
Move to vertex with improved objective value, repeat until at optimum.
To illustrate the simple algorithm, we consider a simple example:
Imagine a production plan:
\(x_1\) can be sold at \(\$3\), while \(x_2\) yields \(\$5\) per unit.
We have constraints on labor resources, storage capacity, etc.
The feasible region, the objective function and the steps in the simple algorithm are illustrated in Fig. 45.

Fig. 45 The feasible region is bounded by the blue lines. All points on the red lines have the same value of the objective. We move from (0,0) to (0,6), and then to (4,6). At the optimal solution we can no longer increase the value of the objective.¶
Operations Research in Julia¶
JuMP is a modeling language and collection of packages for mathematical optimization in Julia.
GLPK is used for linear programming. GLPK is the GNU Linear Programming Kit, free software.
The first tutorial is an example of the diet problem.
Changhyun Kwon: Julia Programming for Operations Research, second edition. Free to read online, examples on github.
Duality¶
Every LP problem has a dual formulation and interpretation. Mathematically this is expressed as below:
The economic interpretation is as follows:
\(x_j\) : level of activity \(j\),
\(c_j\) : unit profit of activity \(j\),
\(b_i\) : amount available of resource \(i\),
\(a_{ij}\) : amount of resource \(i\) consumed by each unit of activity \(j\),
\(y_i\) : contribution to profit per unit of resource \(i\).
The dual of our numerical example:
Proposals of Project Topics¶
Read the paper by Ernest Koenigsberg: Some Industrial Applications of Linear Programming. Operational Research Society, Vol. 12, No. 2, pages 105-114, 1961.
Select one problem and explain the LP formulation, in your own words.
Work out an example with numerical data.
Use JuMP to solve an instance of the same dimensions as in the paper.
Report on the computational cost of the problem.
Read the first section of the book by Robert J. Vanderbei: Linear Programming. Foundations and Extensions. Fifth Edition, Springer-Verlag, 2020.
Explain why the management of a production facility translates into an LP problem, in your own words.
Setup a program to generate numerical data, for any dimension.
Use JuMP to solve the generated instances.
Report on the computational cost for various dimensions.
Exercises¶
Suppose General Motors makes a profit of \(\$100\) on each Chevrolet, \(\$200\) on each Buick, and \(\$400\) on each Cadillac.
These cars get 20, 17, and 14 miles a gallon respectively.
It takes respectively 1, 2, and 3 minutes to assemble one Chevrolet, one Buick, and one Cadillac.
Assume the company is mandated by the government that the average car has a fuel efficiency of at least 18 miles a gallon.
Under these constraints, determine the optimal number of cars, maximizing the profit, which can be assembled in one 8-hour day. Formulate the linear programming problem.
Consider the diet problem, look at the tutorial example of JuMP.
Write the dual of that example of the diet problem.
What are the units of the dual variables?
Suppose an investor has a choice between three types of shares.
Type A pays 4 percent, type B pays 6 percent, and type C pays 9 percent interest.
The investor has \(\$100,000\) available to buy shares and wants to maximize the interest, under the following constraints:
no more than \(\$20,000\) can be spent on shares of type C, and
at least \(\$10,000\) should be spent on shares of type A.
Answer the following questions:
Give the mathematical description of the optimization problem.
Bring the problem into the standard form.
Solve the linear programming problem.