Linear Programming:
Linear programming (LP, also called linear optimization) is a method to achieve the best outcome
(such as maximum profit or lowest cost) in a mathematical model whose requirements are represented
by linear relationships. Linear programming is a special case of mathematical programming (also known
as mathematical optimization).
More formally, linear programming is a technique for the optimization of a linear objective function,
subject to linear equality and linear inequality constraints. Its feasible region is a convex polytope, which
is a set defined as the intersection of finitely many half spaces, each of which is defined by a linear
inequality. Its objective function is a real-valued affine (linear) function defined on this polyhedron. A
linear programming algorithm finds a point in the polytope where this function has the smallest (or
largest) value if such a point exists.
Examples:
A transport company has two types of trucks, Type A and Type B. Type A has a
refrigerated capacity of 20 m³ and a non-refrigerated capacity of 40 m³ while Type B has
the same overall volume with equal sections for refrigerated and non-refrigerated stock. A
grocer needs to hire trucks for the transport of 3,000 m³ of refrigerated stock and 4,000 m³
of non-refrigerated stock. The cost per kilometer of a Type A is 30 and 40 for Type B. How
many trucks of each type should the grocer rent to achieve the minimum total cost?
1.Choose the unknowns.
x = Type A trucks
y = Type B trucks
2. Write the objective function.
F (x,y) = 30x + 40y
3. Write the constraints as a system of inequalities.
A B Total
Refrigerated 20 30 3000
Non-Refrigerated 40 30 4000
20x + 30y ≥ 3 000
40x + 30y ≥ 4 000
x≥0
y≥0
4.Find the set of feasible solutions that graphically represent the constraints.
5.Calculate the coordinates of the vertices from the compound of feasible solutions.
6. Calculate the value of the objective function at each of the vertices to
determine which of them has the maximum or minimum values.
f(0, 400/3) = 30 · 0 + 40 · 400/3 = 5,333.332
f(150, 0) = 30 · 150 + 40 · 0 = 4,500
As x and y must be natural numbers round the value of y.
f(50, 67) = 30 · 50 + 40 ·67 = 4,180
By default, we see what takes the value x to y = 66 in the equation 20x + 30y =
3,000. x = 51 which it is within the feasible solutions.
f(51, 66) = 30 · 51 + 40 · 66 = 4,170
Example:
A store has requested a manufacturer to produce pants and sports jackets.
For materials, the manufacturer has 750 m² of cotton textile and 1,000 m² of
polyester. Every pair of pants (1 unit) needs 1 m² of cotton and 2 m² of polyester.
Every jacket needs 1.5 m² of cotton and 1 m² of polyester.
The price of the pants is fixed at 40.
What is the number of pants and jackets that the manufacturer must give to the
stores so that these items obtain a maximum sale?
1 Choose the unknowns.
x = number of pants
y = number of jackets
2 Write the objective function.
f(x,y)= 50x + 40y
3 Write the constraints as a system of inequalities.
To write the constraints, use a table:
Pants Jackets Available
Cotton 1 1,5 750
Polyester 2 1 1000
x + 1.5y ≤ 750 2x+3y ≤ 1500
2x + y ≤ 1000
As the number of pants and jackets are natural numbers, there are two more constraints:
x≥0
y≥0
4 Find the set of feasible solutions that graphically represent the constraints.
Represent the constraints graphically.
As x ≥ 0 and y ≥ 0, work in the first quadrant.
Represent the straight lines from their points of intersection with the axe
Solve the inequation graphically: 2x +3y ≤ 1500, and take a point on the plane, for example
(0,0).
2 · 0 + 3 · 0 ≤ 1,500
Since 0 ≤ 1,500 then the point (0,0) is in the half plane where the inequality is satisfied.
Similarly, solve 2x + y ≤ 1,000.
2 · 0 + 0 ≤ 1,000
The area of intersection of the solutions of the inequalities would be the solution to the system of
inequalities, which is the set of feasible solutions.
5. Calculate the coordinates of the vertices from the compound of feasible solutions.
The optimal solution, if unique, is in a vertex. These are the solutions to the systems:
2x + 3y = 1,500; x = 0 (0, 500)
2x + y = 1,000; y = 0 (500, 0)
2x + 3y =1,500; 2x + y = 1,000 (375, 250)