We are going to learn how to create and solve an exercice of the following type (and others more complicated than this without a doubt):
A carpenter has to construct rectangular tables whose sides do not exceed
In this type of problem, the new part regarding what we have already seen in the previous levels, is that there appears a certain quantity that has to be maximized (it might also have to be minimized, but here this is not the case). In this example, it is the perimeter of the tables, which is subject to certain restrictions. The function to maximize (minimize) is called the objective function. The maximum value (or minimum) of the objective function is in the margins of the feasible area delimited by the restrictions of the problem. This value is called the ideal value.
Let's see how to express mathematically the problem of the example:
The first thing to be identified are the variables or unknowns. In this case those will be the long side of the table (that we will call
We identify the objective function. What we are asked to maximize / minimize? And: How does this quantity express itself according to the variables of the problem?
In our case we have been asked to maximize the perimeter (which we will call
Following the steps of the first level, we write the restrictions as inequations. These restrictions are:
-
The sides cannot be bigger than two meters (not even less than zero, since it would not make sense):
- The sum of the biggest side and the double of the minor must not exceed
meters:
We identify the region of validity defined by the restrictions and calculate the apexes of the above mentioned region. The straight lines associated with the restrictions are:
and , which are straight lines parallel to the axis , which cross and respectively. The inequality from which they come defines a stripe of feasible solutions between and . and , which are straight lines parallel to the axis , which cross and respectively. The inequality from which they come defines a stripe of feasible solutions between and . , whose validity area is below the straight line (it is possible to see verifying that the poin , which is below the straight line, fulfills the inequation ).
The apexes of the region of validity are calculated as in the previous level: looking at what points the straight lines defined by the restrictions cross one another and then select from these points those that satisfy all the inequations. Doing so, we see that the apexes of the region of validity take as coordinates:
-
where and cross. -
where and cross. -
where and cross. where and cross.
The last step is to calculate the value of the objective function in the apexes of the region of validity, to see which of the points maximizes the perimeter of the tables.
We see that the perimeter is maximized in the point
Other examples:
Example
The
First, we identify the variables. In this case there will be the number of buses of type A (that we will call
The restrictions of the problem in the form of inequations:
-
, (we cannot rent a negative number of buses). -
( buses are type A). -
( buses are type B). -
(there are only drivers). (we want the total number of places available to be at least equal to the number of students).
With the inequations, we do as we have done in level 2: look for the straight lines associated with the inequations, the areas of validity of every inequation and the common feasible area with all the restrictions.
And the feasible area is:
The next step is to calculate the apexes of the region of validity. In this case they are:
The objective function (price) takes the following values in the apexes of the region of feasible solutions:
€ € €
Since we want to minimize the price, the point that we want is
To sum up, in any problem of linear programming we will have to follow the same steps:
- Choose the variables of the problem.
- Write the objective function according to the information of the problem.
- Write the restrictions as inequations.
- Determine the feasible region that the restrictions indicate.
- Calculate the coordinates of the apexes of the region of feasible solutions.
- Calculate the objective value of the function in each of the apexes to see in which of them the maximum or minimal value is available, as is asked in the problem.