Optimization model
Many quantitative decision tasks in economy and industry lead naturally to optimization problems. A broad category of practically tractable problems are linear optimization problems where the goal function and the constraints depend linearly on the decision variables. Let us illustrate the linear optimization (also called linear programming) on an example from the mining industry.A mining company extracts rock or minerals from an open pit (quarry), mixes them to achieve the required quality and sells the blend on the market. The company wants obviously achieve a maximum profit under the constraints given by the quarry composition, the mix, production costs and capacity. The situation can be modeled mathematically as follows.

The quarry is divided into more or less homogeneous blocks:
Block model of a quarry

The mineral concentration, the weight, the production cost and other properties of the
blocks are measured or estimated:
Block Tonnage Profit c/ton R % S % .. B_{1} 20 6 15 .. .. B_{2} 10 2 35 .. .. B_{3} .. .. .. .. .. Quarry data

The goal is to maximize the profit
g = c_{1}x_{1} + c_{2}x_{2} + ...
by taking
x_{1} tons from the block B_{1},
and satisfying all constraints that follow below.
x_{2} tons from the block B_{2},
... 
The concentration of the chemicals in the blend must lay between specified limits:
Chemical Min % Max % R 20 25 S .. .. .. .. .. Requirements on the chemical mix
R_{min} ≤ r_{1}x_{1} + r_{2}x_{2} + ... ≤ R_{max} x_{1} + x_{2} + ... (r_{1}  R_{min}) x_{1} + (r_{2}  R_{min}) x_{2} + ... ≥ 0
Corresponding inequalities are added for further chemicals.
(r_{1}  R_{max}) x_{1} + (r_{2}  R_{max}) x_{2} + ... ≤ 0

The taken tonnages must satisfy the obvious constraints:
x_{1} ≥ 0
x_{2} ≥ 0
...
x_{1} ≤ B_{1}
x_{2} ≤ B_{2}
... 
The company has only a limited production capacity T_{max}:
x_{1} + x_{2} + ... ≤ T_{max}
Twodimensional case
We will now solve the problem in the simplified case of 2 blocks only. We assume that the maximum production capacity is T_{max} = 25 tons. The task is then: Find the variables x_{1}, x_{2} such that the profitg = 6x_{1} + 2x_{2} = max !
is maximal and the constraints:
5x_{1} + 15x_{2} ≥ 0
10x_{1} + 10x_{2} ≤ 0
x_{1} ≥ 0
x_{2} ≥ 0
x_{1} ≤ 20
x_{2} ≤ 10
x_{1} + x_{2} ≤ 25
Graphical solution
In the case of 2 variables the problem can be solved graphically in the (x_{1}, x_{2})plane.Graphical solution (Picture creation)
6x_{1} + 2x_{2} = m
parametrized by the value of m. When this line is moved to the right, the value m of the goal is increased and it achieves the maximum 125 at the right most corner (18.75, 6.25) of the feasible region. So, the optimal solution is
x_{1} = 18.75
x_{2} = 6.25
Profit = 125
Solution with Microsoft Excel
Microsoft Excel provides the addon "Solver" that allows to solve optimization problems numerically. The application of Excel Solver to our twodimensional example is easy. However, the Solver becomes impractical and errorprone for realworld large scale problems.Simplex Algorithm
Simplex Algorithm (PDF) is the method of choice for linear optimization of realworld large scale problems. This method was devised by G. B. Dantzig in 1947. My implementation of the Simplex Algorithm in C++ can handle thousands of variables and constraints, is numerically stable and computes the solution very efficiently.