Evaluates the sensitivity grid for a given Linear programming problem.
percentageShiftOfFirst * abs(initialPoint[firstSelectedIndex]).percentageShiftOfSecond * abs(initialPoint[secondSelectedIndex]).a 2 dimensional double array representing the sensitivity grid of dimensions noShiftsOfFirst by noShiftsOfSecond.
Remark: The nature of the sensitivity grid is described in finer detail within the PDF documentation. We advise that this API documentation should be used in conjunction with the PDF documentation.
The purpose of the sensitivity grid is to determine how the value of the extremum (i.e. minimum or maximum) of the given linear programming problem is effected by perturbations (i.e. shifts) of the two selected coefficients of the linear object function. This approach to sensitivity analysis allows the study of the stability of the solution to be studied when any two of the coefficients of the linear object function to be perturbed. Such sensitivity analysis is particularly appropriate in the following two instances:
Application to the Factory Example
In the case of the Factory Example (see Factory Example description) since the coefficients of the linear object function represent the profitability of the individual products, a sensitivity grid will allow us to see how the maximum profitability of the factory will vary as the level of profitability of two of its five products varies. By performing such analysis you will be able to understand how stable the profitability of the factory is to changes in the profitability of the individual products.
Notes on Coefficient and perturbation Selection
The selection of which particular coefficients to shift and the size and number of these shifts should be made with the particular business problem in mind. For example, your application may suggest certain appropriate combinations of coefficients and shift sizes for which the sensitivity grid will display valuable qualitative information. On the other hand you may wish to investigate a particular phenomenon which has been hypothesized, in which case your choices should reflect the given problem at hand.
Even if you do not have any a-priori idea as to what particular shifts to consider, by repeatedly applying the sensitivity grid approach you will be able to build up an intuition as to what shifts are most appropriate for which stability questions you are considering.
Sensitivity Grid applied to the factory example
Say the coefficients of the linear object function (of order five), evaluates the profit of the production of five different products and the constraints of the problem represent the physical limitations of the production procedure of the these products from the available resources. By finding the maximum of the object function we are actually finding the balance of the production procedure between the five products which results in the greatest profit.
Now if we consider the sensitivity grid in which the 1st and 2nd coefficients are shifted (i.e. the production levels of the first and second products) we are able to determine how the total maximum achievable profit will be effected if the balance between the 1st and 2nd manufactured products and the remaining three products is varied.
By performing such analysis you will not only be able to see if you production could be rebalanced so that the over-all profit level is increased by also whether a given product mix profit level is stable to unforeseen changes in the production level of each good.
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 a extremum (i.e.
maximum or minimum) 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 Sensitivity Grid's parameters and structure
Here we provide further explanation of the parameters which effect the construction of the sensitivity grid of a given linear programming problem. These parameters effect the number of elements of the 2-dimensional array, the `directions' in which the coefficients are shifted and the size of these shifts.
The dimensions of the sensitivity grid is noShiftsOfFirst by
noShiftsOfSecond, where the noShiftsOfFirst is the
number of shifts of the first selected coefficient and noShiftsOfSecond
is the number of shifts of the second selected coefficients of the linear object function.
The particular coefficients of the linear object function which are shifted are selected by
the integer parameters firstSelectedIndex, secondSelectedIndex
which correspond to the index of the coefficients of the linear object function. Please
note that the indexing of these coefficients starts from 0, that is the 1st coefficient
of the linear object function corresponds to 0, to 2nd coefficient to 1, and on on.
Note that the noShiftsOfFirst represents the `height' of the sensitivity
grid and noShiftsOfSecond represents the `width' of the sensitivity grid,
with respect to the returned 2 dimensional double array. When
constructing the sensitivity grid it is necessary to assign a `middle cell' which corresponds
to the given initial values of the coefficients of the linear object function. The middle cell
will contain the value of the extremum of the given linear programming problem before the
coefficients of the object function have been perturbed.
Remark: The returned sensitivity grid will have the property that for a given `row' only the second selected coefficient of the object function is varied, where as for a given `column' of the sensitivity grid only the first selected coefficient is varied.
Within this methods the sizes of the shifts are provided to the method as percentages of
a selected coefficients default values. That is, the shifts are proportional to the absolute
value of the default (middle cell) values of the two selected coefficients. The absolute size
of each shift of the first selected coefficient is
firstSelectedShift := percentageShiftOfFirst * abs(coefficients[firstSelectedIndex]),
and correspondingly the size of each shift of the second selected coefficient is
secondSelectedShift := percentageShiftOfSecond * abs(coefficients[secondSelectedIndex]),
where abs is the absolute value. Therefore, if the object function under consideration
is denoted by f, and x0 denotes the given values of the coefficients of
the linear object function, then the (i,j)th' cell of the sensitivity grid is given
by:
| 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