Performs Scenario Analysis on a Linear programming problem by evaluating the location of the extremum (i.e. maximum or minimum) when the coefficients of the linear object function and the constraints are perturbed.
-100, then a shift of 2%, gives result in a coefficient of -102.In particular, this method returns the location of the extremum (i.e. maximum or minimum) of the given Linear Programming problem after one or both of the following has been performed:
Overview of Scenario Testing
Scenario Analysis (also known as back testing) is another technique which allows a linear programming problem to be put under various stresses and to measure the implications in terms of the change in the location (and hence value) of the extremum of the object function. The advantage of Scenario Analysis (over Sensitivity Grids) is that it allows all (rather than only two) coefficients of the linear object function to be shifted and parallel shifts of the inequalities and equalities to be made and for the resulting effects on the location of the extremum to be recorded.
Remark: Further details concerning the application and use of Scenario Analysis is described within the accompanying PDF documentation.
Application to the Factory Example
In the case of the Factory Example (see Factory Example description) Scenario Analysis will allow you to see the effect of structural changes within the production procedure and market. For example, say there is a shortage of a particular `means of production' and because of a structural change in the market the profitability of a given product reduces. By applying a suitable parallel shift to the constraint which represents the `means of production' in shortage, and by making the appropriate change of the coefficient corresponding to the change in the profitability of a particular product. Through this method we are able to evaluate the product mix (i.e. location) which results in the greatest profit for the factor under the new business conditions.
Defining the Linear Programming Problem
The linear programming problem is passed to the method by specifying the array of coefficients of the linear object function and by using two 2-dimensional double arrays in order to describe the set of inequality and equality constraints which the solution of the linear programming problem must satisfy. Below we explicitly describe how a given linear programming problem, that is an object function together with a set of inequality and equality constraints can be mapped into the parameters which will be provided to the (simplex) method.
All linear (programming) object functions f can be written in the following form:
N is the number of variables considered, coefficientsi
are the set of coefficients of the linear function and
x1,...,xN are the coordinates
(i.e. the degrees of freedom of the problem) of the solution set over which a point where an extremum
(i.e. minimum or maximum) of the linear function is sought.The solution set is spanned by the coordinates
x1,...,xNx which are
subject to a set of inequality and equality constraints. That is, the solution set over which an
extremum is sought is any combination of coordinates which satisfies the given constraints. These
inequality and equality constraints are supplied in the form of 2 dimensional double arrays, where
each line of the 2 dimensional array corresponds to the coefficients within a linear equality or
inequality constraint. That is, in order to express the following inequality:
N + 1th term),
according to the following convention:
The equality constraints for the problem are expressed in a similar fashion to the inequality constraints, where the coefficients are listed in order followed by a real number. The equalities should be collected within a two-dimensional array in a similar way to the inequalities and passed as a parameter to the method. In particular, each equality is expressed in the following form: c1 * x1 + c2 * x2 + ... + cN * xN + b = 0, for which you will need to provide the following array within the equality two-dimensional array:
Notes on the Scenario Analysis parameters
As mentioned above Scenario Analysis stresses the linear optimization problem by shifting one or both of the following:
percentageShiftsOfCoefficientsshiftsOfInequalities, and the (parallel) equality shifts are described by the array
shiftsOfEqualitiesObject Function Coefficient Shifts: Within this methods the sizes of the shifts of the
objects functions coefficients are provided
to the method as percentages of a selected coefficients initial values. That is, the shifts are
proportional to the absolute value of the (initial) values of the coefficients. The absolute size
of each shift of the i-th coefficient is
Absolute Shift size := percentageShift[i] * abs(coefficients[i]),
where abs is the absolute value, percentageShift[i] is the i-th term of the
parameter array percentageShiftsOfCoefficients and coefficients[i] is the i-th
coefficient. By considering each of the coefficients shifts we are able to populate the parameter array
percentageShiftsOfCoefficients.
Equality Constraint Shifts: A parallel shift of an equality constraint by `d', is equivalent to mapping the constraint:
In accordance with the notes above concerning the construction of the 2-dimensional array
equalityConstraints; representing the equality constraints, this parallel shifted equality
constraint would be represented within the 2-dimensional array as:
In order to construct the 2-dimensional array representing the set of shifted equality constraints
we go through each of the constraints contained within the Linear programming problem and make the changes
within the 2-dimensional array equalityConstraints, which correspond to the absolute shifts
of the constant term for each of the equality constraints.
Inequality Constraint Shifts: A parallel shift of an inequality constraint by `d', is equivalent to mapping the constraint:
In accordance with the notes above concerning the construction of the 2-dimensional array
inequalityConstraints; representing the inequality constraints, this parallel shifted
inequality constraint would be represented within the 2-dimension array as:
In order to construct the 2-dimensional array representing the set of shifted inequality constraints
we go through each of the constraints contained within the Linear programming problem and make the changes
within the 2-dimensional array inequalityConstraints, which correspond to the absolute shifts
of the constant term for each of the inequality constraints.
| Exception Type | Condition |
|---|---|
| LinearProgrammingException | Thrown if either the region given by the constraints is empty or if the function is unbounded on the region. |
LinearProgramming Class | WebCab.COM.Math.Optimization.LinearProgramming Namespace