Unit 2 Optimization Models
Unit 2 Optimization Models
LINEAR PROGRAMMING
The facts
The experience
The intuition
The authority
Objective Function.
Variables
Restrictions
The next step involves the determination of the same, for which
we propose to follow the following methodology:
The objective function is closely related to the general question that one wishes to address.
answer. If a model resulted in different questions, the objective function would
it would relate to the higher-level question, that is, the fundamental question.
For example, if in a situation one wishes to minimize thecostsit is very
It is likely that the highest level question is the one that relates to increasing the
utility instead of a question that seeks to find a way to decrease the
costs.
THE DECISION VARIABLES.
Similar to the relationship that exists between specific objectives and the general objective, there
THE PROBLEM
The 'SALAZAR' Yarn and Fabrics Factory requires to manufacture two quality fabrics.
different T and T'; 500 Kg of thread a, 300 Kg of thread b and 108 Kg of thread available
c. To obtain one meter of T daily, 125 grams of a, 150 grams of b, and
72 g of c; to produce one meter of T' per day, 200 g of a, 100 g of required.
by 27 grams of c.
The T is sold at $4000 per meter and the T' is sold at $5000 per meter. If it must be obtained
the maximum profit, how many meters of T and T' should be produced?
To carry out this step, we start from the central question of the problem.
Determine the number of daily meters of fabric type T and T' to be manufactured having
consider the optimal benefit regarding utility.
In this step, we determine the functions that limit the problem, these are
given by capacity, availability, proportion, non-negativity among others.
About non-negativity
Objective Function
4000XT + 5000XT'
The previous exercise was solved using Solver - Excel, and its result was:
Standard Form
All the constraints must be of the less than or equal type, with the right side
Positive, the objective function must be maximization and all variables are non
negatives.
The slack variables are introduced, and the decision variables are selected as
the initial non-basic variables, and the slack variables as the basic variables
initials.
Optimality test
The basic solution is optimal if and only if the coefficients of the objective function are
no negatives, if that is the case the process stops, otherwise it continues to a new one
iteration to obtain the following basic solution.
The non-basic variable with the highest absolute negative coefficient is selected.
the most negative) of the objective equation. This will be the pivot column.
Choose the strictly positive and non-zero quotients from the column.
corresponding to the pivot
Divide each coefficient by the element on the right side of the same row
In the following table, copy the pivot row and fill its column with zeros.
The new element = element - (Pivot row coefficient) (Pivot column coefficient).
DUAL MODEL.
A todo
SUBTHEME 2.4 SIMPLEX TABULAR METHOD
The Simplex method is an iterative procedure that allows improving the solution of
the objective function at each step. The process concludes when it is not possible
continue improving said value, that is, the optimal solution has been reached (the
greater or lesser possible value, depending on the case, for which all are satisfied
restrictions).
It is necessary to take into account that the Simplex method only works with
restrictions of the problem whose inequalities are of the type "≤" (less than or equal) and
its independent coefficients should be greater than or equal to 0. Therefore, it will be necessary to
The standard form of the problem model consists of an objective function subject to
certain restrictions:
The objective will be to maximize or minimize the value of the objective function (for
example, increase profits or reduce losses, respectively).
All variables (xi) must have a positive or null value (non-negativity condition)
negativity.
The independent terms (bi) of each equation must be non-negative.
It is necessary to adapt themodeling problemto the standard form in order to apply the
Simplex algorithm.
Type of optimization.
As mentioned, the objective of the method will be to optimize the value of the
objective function. However, two options are presented: obtain the optimal value
maximize or obtain the minimum optimal value (minimize).
In addition, there are differences in the algorithm between the maximization objective and the
Maximization objective
Entry condition to the base: the lowest negative value in row Z (or the highest
absolute value among the negatives) indicates the variable Pique enters the database.
Exit condition of the base: once the entering variable has been obtained, the variable
the exit is determined by the smallest quotient P0/Pj of the strictly
positives.
Minimization objective
Entry condition to the base: the highest positive value in row Z indicates the variable
Pj that enters the database.
Leaving condition of the base: once the entering variable is obtained, the variable
what comes out is determined by the smallest quotient P0/Pj of the strictly
negatives.
Disadvantages: In the case that the function has all the coefficients of its
basic positive variables, and also the constraints are of the inequality type
≤, when making the change, these coefficients become negative, fulfilling the
stop condition in the first iteration (in the row of the objective function value
all values are positive or zero). Obtained in this case by default an
optimal value for the function equals 0.
Solution: This problem does not really exist since for the solution to be
greater than 0, it is necessary that some restriction has the condition '≥' (and
it would be a model for thetwo-phase [Link] the presented case,
The real solution must be zero.
It has also been said that the independent terms (bi) of each equation must
must be non-negative in order to use the Simplex method. To this end, if any of the
restrictions present an independent term less than 0 it will be necessary to multiply
by "-1" on both sides of the inequality (considering that this operation
it also affects the type of restriction.
To normalize a constraint with an inequality of the type '≤', one must add a
new variable, called slack variable xs (with the non-negativity condition:
xs ≥ 0). This new variable appears with a coefficient of zero in the objective function, and
adding in the corresponding equation (which now will indeed be an identity
mathematics or equation of equality.
In the case of an inequality of the type '≥', a new variable must also be added.
excess variable call xs (with the non-negativity condition: xs ≥ 0). This
a new variable appears with a coefficient of zero in the objective function, and subtracting in the
corresponding equation.
Now a problem arises with the non-negativity condition with this new one.
variable of the problem. The inequalities that contain a type of inequality '≥'
would remain:
a11·x1 + a12·x2 ≥ b1 a11·x1 + a12·x2 - 1·xs = b1
When performing the first iteration with the Simplex method, the basic variables do not
they will be at the base and will take a value of zero. In this case, the new variable xs, after
make zero x1 and x2, it will take the value -b1 and it would not meet the condition of no
negativity. It is necessary to add another new variable xr, called an artificial variable,
which will also appear with a zero coefficient in the objective function and summing in the
corresponding restriction. Remaining as follows:
Contrary to what one might think, for restrictions of type '=' (although already
his identities) it is also necessary to add artificial variables xr. As in the
In the previous case, its coefficient will be zero in the objective function and will appear as a positive addition.
In the last case, it becomes clear that the artificial variables represent a
violation of the laws of algebra, so it will be necessary to ensure that such
artificial variables must have a value of 0 in the final solution. This is taken care of
theTwo-Phase Methodand for this reason, whenever these types of variables appear
It will have to be done.
The following table summarizes the type of variable that appears according to inequality.
in the normalized equation, as well as its sign:
Type of
Type of variable that appears
inequality
≥ - excess + artificial
= artificial
Type of
Type of variable that appears
inequality
≤ + tolerance
Once the model has been standardized, it may be necessary to apply the method.
Simplex or theTwo-Phase [Link] the figure for the way of acting
to reach the solution of the modeled problem.
Simplex Method
The columns of the table are arranged as follows: the first column
from the table contains the variables that are in the database (or basic variables),
this is, those that take value to provide a solution; the second
the column gathers the coefficients that these basic variables have in the function
objective (this column is called Cb); the third shows the constant term
from each restriction (P0); from this a column appears for each of the
decision variables and slack present in the objective function (Pj). To have a
a clearer view of the table, a row is included that contains the titles of each one
from the columns.
Two new rows are added to this table: one of them, which leads the table, where
the coefficients of the variables of the objective function appear, and a last row
what the objective function value and the reduced costs Zj - Cj collect.
The reduced costs show the possibility of improvement in solution Z0. Therefore,
reasons are also called indicator values.
Table
C1 C2 ... Cn
Base Cb P0 P1 P2 ... Pn
All the values included in the table will be given by the problem model.
except for the values of row Z (or indicator row). These are obtained from the following
form: Zj = Σ (Cbi·Pj) for i = 1.m, where if j = 0, P0 = bi and C0 = 0, and in case
opposite Pj = aij.
It is observed, when applying the Simplex method, that in this first table the base is occupied by
For this same reason, it is not necessary to perform the cost calculations.
reduced in the first table, being able to be determined directly as the change
of the sign of the coefficients of each variable in the objective function, that is, -Cj.
Stop condition:
The stopping condition is met when the indicator row does not contain any value.
negative among the reduced costs (when the goal is maximization), this
Yes, there is no possibility of improvement.
Once the stopping condition is met, the value of each variable that achieves the
the optimal solution is found in the column P0, indicating in the base to what
the variable corresponds to that value. If a variable does not appear in the database, it means
that its value is zero. In the same way, the optimal value of the objective function (Z)
is located in column P0, row Z.
If the stopping condition is not met, it is necessary to perform one more iteration of the
algorithm, that is, to determine the variable that becomes basic and the one that ceases to be.
find the pivot element, update the table values, and check if it
meets the stopping condition again.
It is also possible to determine that the problem is not bounded and its
The solution will always be improvable. In such cases, it is not necessary to continue iterating.
indefinitely and the algorithm can be completed. This situation occurs when in
the column of the incoming variable to the database all values are negative or null.
When a variable becomes basic, that is, when it enters the basis, it begins to form
part of the solution. Observing the reduced costs in row Z, it is decided that
enter the base the variable of the column in which it is the lowest value (or of
maximum absolute value) among the negatives.
Selection of the variable that comes out of the database:
Once the incoming variable is obtained, it is determined that the variable exits the base.
that is in that row whose quotient P0/Pj is the smallest of the
strictly positive (considering that this operation will be carried out exclusively
when Pj is greater than 0).
Pivot element:
The pivot element of the table is marked by the intersection between the column
from the entering variable and the row of the exiting variable.
Table update:
The rows corresponding to the objective function and the titles will remain.
unchanged in the new table. The rest of the values must be calculated as follows
explain the following:
New Row Element = Previous Row Element - (Previous Row Element in Column
Pivot * New Element Pivot Row.
In this way, all the elements of the column of the variable are achieved.
entries should be null except for the row of the outgoing variable whose value will be 1. (It is
analogous to using the Gauss-Jordan method to solve systems of equations
linear).
Two-Phase Method
Otherwise, the problem is not feasible, meaning it has no solution and will not be.
It is necessary to continue with the second phase.
PHASE 1: This first phase is very similar to the Simplex method, with the exception of
the construction of the first table, in addition to the need to study the result
obtained to determine if the second phase is developed.
In that case, the last table of this phase will be, with some modifications, the one used.
as an initial table for the second phase.
It is prepared similarly to the initial table of the Simplex method, but with
some differences.
The other difference for the first table is that it is now necessary to calculate.
row Z (or indicator row).
Table
The stopping condition is the same as in the normal Simplex method. That is,
when none of the values of the reduced costs in the indicator row is
negative (since the objective is to maximize (-1) as it has been proposed
·Z').
Once the stop condition is met, it is necessary to determine if it is possible to proceed to the
second phase to obtain the optimal solution of the original problem. This is done
observing the result obtained in the first phase: if its value is 0, it means that
the original problem has a solution and it is possible to calculate it, otherwise indicate
it is a non-feasible problem and has no solution.
If we have come to the conclusion that the original problem has a solution,
we must prepare our table for the second phase. This step is very simple,
it is only about removing the columns corresponding to the variables
artificial.
The initial table in this case remains almost identical to the last table of the first one.
phase. Only the row of the objective function will need to be modified by that of the
original problem and recalculate the Z row (in the same way as in the
first table of phase 1).
From this point onwards, all iterations will continue until reaching the optimal solution of the
Any model of a situation is a simplification of the real situation. For this reason,
Thus, there is some uncertainty in determining the values of all the
involved parameters. Due to this, it is important to study the variability of the
solution to the problem posed according to possible modifications of the
values of the parameters, or due to the incorporation of new elements
to the situation.
We will call Sensitivity Analysis the study of the variation of the optimum of an LP.
product of modifications of certain parameters such as variable coefficients
in the objective function, coefficients on the right side of constraints, etc.
Additionally, the simultaneous variation of coefficients in the objective function will be studied.
To develop the different options, we will consider the following example in your
standard version:
s.t.
Applying the Simplex method, we obtain the final table of Table 1.1. Then, the
solución óptima del problema corresponde a z = 280, s1 = 24, x3 = 8, x1 = 2 y x2 =
s2 = s3 = 0
Change of the Coefficient in the Objective Function of a Non-Basic Variable.
In the optimal basis of problem (1.1), the only non-basic decision variable is x2.
This variable has as a coefficient in the objective function: c2 = 30. We will call
cj to the coefficient in the objective function of variable j. Since x2 is not in the basis,
it would be interesting to determine the value of c2 needed for the variable x2 to be
incorporated into the optimal base.
Due to the fact that only the coefficient of one variable in the function is being changed.
objective, the feasible region of the problem remains unchanged, that is, it is not seen
the feasibility of the current optimum has been modified. It can only occur that the current solution
c2 − z2 = −5 + δ ≤ 0 → δ ≤ 5 (2.1)
In this case, any variation below 5 will not change the base. An increase
exactly the same 5 implies that x2 can become a baseline variable (optimal)
Alternative). Values greater than 5 represent a change in the optimal and will require
carry out additional iterations to obtain the new optimal solution. Of all
ways, before ensuring that the optimal solution has changed, it must be verified
that the variable that has been modified can indeed enter the base
its coefficient in the objective function. As an example, let's consider a
increment δ = 10. In this case, we check that the variable x2 can enter
In this case, only x1 can exit, x2 can enter with a value of 1.6.
Then, the new value of the objective function results:
The iteration is completed in Table 2.3, where the new maximum value is verified.
from the objective function and the combination of values of the baseline variables. Although
In this case, only one iteration was enough to determine the new optimum, generally.
Several iterations may be required. In this example, the first constraint remains.
being active, but in general terms it can change the condition of a
restriction (switch from active to inactive or vice versa). In summary, if the change of
the coefficient of a non-baseline variable is sufficient to alter the optimum, it is being
transferring the optimum from one extreme point to another, in no case is the region altered
feasible of the problem.
Basic
Where the index k refers to the non-basic variable k and aik is the coefficient in the
restriction i of the non-basic variable k. In this case, it must be imposed:
-4 ≤ δ ≤ 20 (3.3)
To maintain the optimal base. In case the variation exceeds this range, it will change.
the combination of variables in the base and the value of the objective function. If the value
the δ remains within the range, the variables do not change in value and the new magnitude
the objective function is defined by:
If the value of δ falls outside the range defined in (3.3), the base will change and it will be necessary.
iterate to determine the new value of the baseline variables. Let's consider by
example δ = 40 and let's see the effect on the optimal solution. Incorporating the new
value of c1 the table ceases to be optimal (Table 3.2), in this case it is advisable to enter
the variable s2 with value 4. Completing the iteration (Table 3.3) it is verified that it
it has reached the optimum. In this case, s1 = 16, s2 = 4, x1 = 4 and x2 = x3 =
0, with an objective function value of 400. The new value of z could have been
predicted in terms of the shadow price of the entering variable and the value it takes
the variable:
side, a change within the optimality range modifies the cj − zj, but keeps
the base.
Statistics, etc.
In this work, it was observed that the simplex method is an efficient and reliable algorithm.
Objective function
Decision variables
Restrictions
Requirements
There are two methods to solve a linear programming model, which are
son
[Link]
The provided text does not contain translatable content.