4.shoe Making & Feeding Pigs (Solucion)
4.shoe Making & Feeding Pigs (Solucion)
4.shoe Making & Feeding Pigs (Solucion)
OPTIMIZACIÓN
EN LA GESTIÓN
EMPRESARIAL
Enrique Parra Iglesias
Prof. Titular de Fundamentos de Análisis Económico. UAH
Ex Director de Control de Gestión. CEPSA
Consultor.
[email protected]
Programación lineal (PL)
GRAPHICAL SOLUTION OF LINEAR PROGRAMMING
A MAXIMIZATION EXAMPLE
Example: Shoe Making
The shoes are made with a very high-quality leather, but this is available only in limited
quantities of no more than 3 square meters (m2 ) per week. The amount of leather
used in producing a pair of shoes is 0.2 m2 for women's shoes and 0.3 m2 for men's.
Men's shoes can be sold for a profit of $34 per pair, while women's shoes return $36
per pair. How many pairs of men's shoes and how many pairs of women's shoes should be
produced each week if the shoemaker wishes to make the highest possible profit?
The variable W is the number of pairs of women's shoes produced in a week, and M is the
weekly production of pairs of men's shoes.
Total profit attributable to women's shoes is $36 times the number of pairs of women's
shoes produced: 36 x W. The contribution of men's shoes to weekly profit is $34 per
pair, so the total is $34 X M. Mathematically, the objective is to maximize P, where
P = 36W + 34M
There are two constraints facing the shoemaker: the amount of time each pair of shoes
takes to produce and the amount of leather each pair requires.
If there are W pairs of women's shoes produced in a week, women's shoes require a total of
4 X W hours per week. For example, if the shoemaker makes five pairs of women's
shoes, each requiring four hours of labor, the total time spent making women's shoes is 4 X
5 = 20 hours. Two pairs of women's shoes require a total of 4 X 2 = 8 hours. In general,
W shoes require a total of 4 x W hours.
Similarly, women's shoes use up 0.2 m2 of leather, so the total leather requirement of
women's shoes is 0.2 X W m 2 . Men's shoes, on the other hand, have total requirements for
3 X M hours of labor and 0.3 x M m2 of leather per week.
Remember that the total time worked on both types of shoe per week cannot exceed 40 hours.
4W + 3M ≤ 40
In a similar way, the total usage of leather for women's shoes plus the total usage of leather
for men's shoes cannot exceed 3 m2 per week, so:
0.2W + 0.3 M ≤ 3
These constraints are called inequalities, because they can be true even if the left-hand
sides are not equal to the right-hand sides. Finally, there is a set of constraints that applies
to all LP problems: the variables cannot take negative values:
W ≥ 0; M≥ 0
This requirement may seem obvious, as you clearly cannot produce a negative number of
shoes, but it is essential to bear in mind because in some problems it is not self-evident.
Maximize
P = 36W + 34M
subject to
4W + 3M ≤ 40
0.2W + 0.3M ≤ 3
w ≥ 0; M≥0
A feasible solution is one that satisfies all the constraints of the problem.
Start by graphing the non-negativity constraints that limit the solution to positive
values of W and M.
These constraints require that the optimal combination of men's and women's
shoes must be one of the shaded points in Figure 1.
Figure 1
4W + 3M = 40
which is the equation for a straight line. We will graph this line without limiting the
graph to whole numbers of shoes. This is most easily done by finding the points at
which the line intersects the axes and joining them with a straight line.
To find the intersection with the W axis, set M equal to zero and solve for W:
4W = 40
So W= 10
Similarly, to find where the line intersects the M axis, set W equal to zero:
3M = 40, so M = 13.33
Figure 2
4W + 3M > 40
4W + 3M < 40
(4 x 0) + (3 x 0) = 0
4W + 3M ≤ 40
Figure 4
Figure 5
4W + 3M = 40 (1)
0.2W + 0.3M = 3 (2)
4W + 3M = 40 (1)
2W + 3M = 30 (2’)
(1) - (2’): 2W = 10 , W = 5
M = 6,67
P = 36W + 34M
(0 ; 5,55)
(0 ; 5,55)
( 5,88 ; 0 )
Figure 6
Figure 8
As you increase the profit value, the objective function moves in parallel upward and to
the right.
The shoemaker should produce 5 pairs of women's shoes and 6.67 pairs of men's shoes
per week. (You can interpret the fractional part of the men's shoes as having a pair of
shoes partly finished).
The highest weekly profit that can be made is $406.67, which can be calculated as
The profit achievable at any point within the shaded region can always be bettered by
drawing a higher line that just touches the boundary (i.e., a line that is a "tangent" to
the boundary).
The only exception to this will be where the objective function is exactly parallel to
one of the constraints that forms part of the boundary of the feasible region.
In this case all points along this segment of the boundary will be equally good.
Another principle is that the optimal solution depends on the slope of the
objective function.
This slope is determined by the ratio of objective function coefficients (i.e., profits in
this case) of the two activities. If the activities‘ profits were both halved or both
doubled, the optimal solution would not change.
Figure 9
At each comer the angle at which constraints meet is less than 180 degrees when
viewed from within the set. The feasible set of an LP problem must be convex.
It would be impossible, for example, to correctly solve an LP model with the feasible
set shown in Figure 10.
Figure 10
Table 2.1 shows profit calculated at each extreme point for the shoemaker example. It
confirms that the profit-maximizing strategy is to produce 5 women's pairs and 6.67
men's pairs per week.
For example, suppose that the shoemaker prefers making women's shoes and would
not be prepared to produce more than eight pairs of men's shoes per week, even if it
meant sacrificing some profit. This new constraint can be stated as
1M ≤ 8
or for convenience
M≤8
Note that the W variable does not appear in the constraint. This can be
interpreted as W having a zero coefficient. If desired the constraint could be
written
0W + 1M ≤ 8
Figure 11
The new optimal solution is to produce 5 pairs of men's shoes and 6.25 of women's, giving
weekly profits of ($36 x 6.25) + ($34 x 5) = $395. Without this constraint on men's shoes,
the maximum profit was $406.67 per week, so meeting the shoemaker's preference for
making women's shoes requires a sacrifice of $11.67 profit per week.
Each kilogram of wheat provides 110 g of protein, while a kilogram of lupins provides
280 g. The total minimum requirement for protein is 50 pigs x 1000 g/pig = 50,000 g.
Thus the protein constraint is
which states that the total amount of protein provided by wheat plus the amount
provided by lupins must be at least 50,000. Wheat and lupins, respectively, provide 13 and
14 MJ/kg of energy, and the total minimum requirement is 50 pigs X 70 MJ/pig = 3500
MJ. The energy constraint is
which represents the requirement that total energy provided by wheat and lupins
must be at least 3500.
C = 0.15W + 0.20L
Figure 14 shows the process of trying out various cost levels to find the lowest cost
solution that is feasible.
The cheapest ration in this example is to feed 133.33 kg of wheat and 126.2 kg of
lupins at a cost of
There are potential solutions costing less than $45.24; the lowest dashed line in Figure
14 shows the set of wheat and lupin levels costing $20.00.
However, none of these solutions provides adequate levels of the nutrients; they are
cheap but not feasible.
To conclude this chapter it should be noted that while the graphical approach is useful in
coming to understand LP, it is not useful for solving practical problems.
The graphical approach can only be used for problems with two (or, at most, three)
decision variables, whereas all realistic problems have tens, hundreds, or even thousands
of variables, so the only practical way to solve them is on a computer.
• Solving an LP problem graphically involves two stages: (a) graphing the feasible
region and (b) identifying the feasible point that is optimal.
• The graphical approach can only be applied easily to problems with two variables.
Calculate the objective function value at the following non extreme points for the
problem in Exercise 2: (X, Y) (25, 0), (15, 5), (10, 10), (12, 12). Compare the values
at these points with those at the extreme points.