WebCab Optimization for COM v2.6

LinearProgramming.MultiLinearSimplex Method 

Returns the location of the extremum (i.e. minimum or maximum) of a linear programming problem.

public double[] MultiLinearSimplex(
   ExtremumTypes extremumType,
   double[] coefficients,
   double[,] inequalityConstraints,
   double[,] equalityConstraints
);

Parameters

extremumType
Used to determine whether location of the minimum or maximum of the object function is sought. If the minimum is required then input MINIMUM, if the maximum is required then input MAXIMUM.
coefficients
The coefficients of the linear objective function f, where f(x1, x2, ...) = coefficients1 * x1 + coefficients2 * x2 + ....
inequalityConstraints
A two-dimensional array containing the coefficients of the inequalities where every array corresponds to another inequality encoded in accordance with the above notes.
equalityConstraints
A two-dimensional array containing the coefficients of the equalities where every array corresponds to another equality encoded in accordance with the above notes.

Return Value

The coordinates of the location of the extremum (i.e. maximum or minimum) of the linear programming problem. That is, a point in N-dimensional space returned as an array of doubles where the first term of the array corresponds to the first coordinate, the second term to the second coordinate and so on.

Remarks

Recall, that a linear programming problem is a special type of optimization problem where the objective function, inequality constraints and equality constraints are all linear. In order to find the extremum we apply a refined Kunzi-Tzschach-Zehnder simplex algorithm. Below we describe how the object function and constraints are passed to the simplex method.

Application to the Factory Example

Since in the Factory example (see Factory Example description) the linear object function represents the profit level of the factory, the returned solution to the simplex method represents the product mix of the factory which will result in the maximum profit. By then substituting this product mix back into the linear object function we will be able to see the exact profit level which can be achieved by the factory.

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:

f(x1, x2, ..., xN) = coefficients1 * x1 + coefficients2 * x2 + ... + coefficientsN * xN,
where 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 the 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:

c1 * x1 + c2 * x2 + ... + cN * xN + b >= 0,
you will need to supply a line within the two-dimensional array which contains the inequality constraints coefficients plus the constant b (i.e. the N + 1th term), according to the following convention:
{c1, c2, ..., cN, b}
For every inequality of the problem considered you will need to provide such an array within the inequality constraints two-dimensional array.


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:

{c1, c2, ..., cN, b}
For each of the equality constraints you will need to first encode then as an array in accordance with the above convention and then add the array to the equality constraints two-dimensional array.

@enumerationTypes ExtremumTypes

Exceptions

Exception TypeCondition
LinearProgrammingExceptionThrown if either the region given by the constraints is empty or if the function is unbounded on the region.

See Also

LinearProgramming Class | WebCab.COM.Math.Optimization.LinearProgramming Namespace | MultiLinearSimplex