|
NAG[e04mfc] NAG[nag_opt_lp] - Linear programming
|
|
Calling Sequence
e04mfc(a, bl, bu, cvec, x, objf, 'n'=n, 'nclin'=nclin, 'tda'=tda, 'optional_settings'=optional_settings, 'comm'=comm, 'fail'=fail)
nag_opt_lp(. . .)
Parameters
|
a - Matrix(1..nclin, 1..tda, datatype=float[8], order=C_order);
|
|
|
If then the array a is not referenced.
|
|
|
bl - Vector(1.. , datatype=float[8]);
bu - Vector(1.. , datatype=float[8]);
|
|
|
On entry: bl must contain the lower bounds and bu the upper bounds, for all the constraints in the following order. The first elements of each array must contain the bounds on the variables, and the next elements the bounds for the general linear constraints (if any). To specify a non-existent lower bound (i.e., ), set , and to specify a non-existent upper bound (i.e., ), set ; here optional_settings[inf_bound] is the value of the optional argument optional_settings[inf_bound], whose default value is (see Section [The optional-settings Parameter]). To specify the th constraint as an , set , say, where .
|
|
Constraint: , for . .
|
|
|
cvec - Vector(1..n, datatype=float[8]);
|
|
|
If the problem type is specified then cvec is not referenced and a NULL pointer may be given.
|
|
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On entry: an initial estimate of the solution.
|
|
On exit: the point at which nag_opt_lp (e04mfc) terminated. If no error is raised, NW_SOLN_NOT_UNIQUE or NW_NOT_FEASIBLE, x contains an estimate of the solution.
|
|
|
objf - assignable;
|
|
|
Note: On exit the variable objf will have a value of type float.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the arrays cvec, x.
|
|
On entry: , the number of variables.
|
|
Constraint: . .
|
|
|
'nclin'=nclin - integer; (optional)
|
|
|
Default value: the first dimension of the array a.
|
|
On entry: , the number of general linear constraints.
|
|
Constraint: . .
|
|
|
'tda'=tda - integer; (optional)
|
|
|
On entry: the second dimension of the array a as declared in the function from which nag_opt_lp (e04mfc) is called.
|
|
Constraint: if , . .
|
|
|
'optional_settings'=optional_settings - Vector; (optional)
|
|
|
|
'comm'=comm - table; (optional)
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_opt_lp (e04mfc) solves general linear programming problems. It is not intended for large sparse problems.
|
|
Error Indicators and Warnings
|
|
|
If one of the above exits occurs, no values will have been assigned to objf, or to optional_settings[ax] and optional_settings[lambda]. x and optional_settings[state] will be unchanged.
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument optional_settings[print_level] had an illegal value.
"NE_BOUND"
The lower bound for variable (array element ) is greater than the upper bound.
"NE_BOUND_LCON"
The lower bound for linear constraint (array element ) is greater than the upper bound.
"NE_BOUND_NLCON"
The lower bound for non-linear constraint (array element ) is greater than the upper bound.
"NE_CVEC_NULL"
but argument NULL.
"NE_INT_ARG_LT"
On entry, n must not be less than 1: .
"NE_INVALID_INT_RANGE_1"
Value given to optional_settings[max_iter] not valid. Correct range is .
"NE_INVALID_INT_RANGE_2"
Value given to optional_settings[reset_ftol] not valid. Correct range is .
"NE_INVALID_REAL_RANGE_F"
Value given to optional_settings[ftol] not valid. Correct range is .
"NE_INVALID_REAL_RANGE_FF"
Value given to optional_settings[crash_tol] not valid. Correct range is .
"NE_NOT_APPEND_FILE"
Cannot open file for appending.
"NE_NOT_CLOSE_FILE"
Cannot close file .
"NE_OPT_NOT_INIT"
optional_settings structure not initialized.
"NE_STATE_VAL"
is out of range. .
"NE_WARM_START"
but pointer NULL.
"NW_NOT_FEASIBLE"
No feasible point was found for the linear constraints. It was not possible to satisfy all the constraints to within the feasibility tolerance. In this case, the constraint violations at the final will reveal a value of the tolerance for which a feasible point will exist – for example, if the feasibility tolerance for each violated constraint exceeds its Residual at the final point. The user should check that there are no constraint redundancies. If the data for the constraints are accurate only to the absolute precision , the user should ensure that the value of the optional argument optional_settings[ftol] is greater than . For example, if all elements of are of order unity and are accurate only to three decimal places, the optional argument optional_settings[ftol] should be at least .
"NW_OVERFLOW_WARN"
Serious ill-conditioning in the working set after adding constraint . Overflow may occur in subsequent iterations. If overflow occurs preceded by this warning then serious ill-conditioning has probably occurred in the working set when adding a constraint. It may be possible to avoid the difficulty by increasing the magnitude of the optional argument optional_settings[ftol] and re-running the program. If the message recurs even after this change, the offending linearly dependent constraint must be removed from the problem.
"NW_SOLN_NOT_UNIQUE"
Optimal solution is not unique. is a weak local minimum (the projected gradient is negligible, the Lagrange multipliers are optimal but there is a small multiplier). This means that the solution is not unique.
"NW_TOO_MANY_ITER"
The maximum number of iterations, , have been performed. The value of the optional argument optional_settings[max_iter] may be too small. If the method appears to be making progress (e.g., the objective function is being satisfactorily reduced), increase the value of optional_settings[max_iter] and rerun nag_opt_lp (e04mfc) (possibly using the facility to specify the initial working set).
|
|
Accuracy
|
|
nag_opt_lp (e04mfc) implements a numerically stable active set strategy and returns solutions that are as accurate as the condition of the problem warrants on the machine.
|
|
Further Comments
|
|
Sensible scaling of the problem is likely to reduce the number of iterations required and make the problem less sensitive to perturbations in the data, thus improving the condition of the problem. In the absence of better information it is usually sensible to make the Euclidean lengths of each constraint of comparable magnitude. See the e04 Chapter Introduction and Gill et al. (1986a) for further information and advice.
|
|
Further Description
|
|
This section gives a detailed description of the algorithm used in nag_opt_lp (e04mfc). This, and possibly the next section, Section [Optional Arguments ], may be omitted if the more sophisticated features of the algorithm and software are not currently of interest.
|
Overview
|
|
nag_opt_lp (e04mfc) is based on an inertia-controlling method due to Gill and Murray (1978) and is described in detail by Gill et al. (1991). Here the main features of the method are summarized. Where possible, explicit reference is made to the names of variables that are arguments of nag_opt_lp (e04mfc) or appear in the printed output. nag_opt_lp (e04mfc) has two phases: finding an initial feasible point by minimizing the sum of infeasibilities (the feasibility phase), and minimizing the linear objective function within the feasible region (the optimality phase). The computations in both phases are performed by the same functions. The two-phase nature of the algorithm is reflected by changing the function being minimized from the sum of infeasibilities to the linear objective function. The feasibility phase does not perform the standard simplex method (i.e., it does not necessarily find a vertex), except in the LP case when . Once any iterate is feasible, all subsequent iterates remain feasible.
In general, an iterative process is required to solve a linear program. (For simplicity, we shall always consider a typical iteration and avoid reference to the index of the iteration.) Each new iterate is defined by
(1)
where the steplength is a non-negative scalar, and is called the search direction.
At each point , a working set of constraints is defined to be a linearly independent subset of the constraints that are satisfied "exactly" (to within the tolerance defined by the optional argument optional_settings[ftol]; see Section [The optional-settings Parameter]). The working set is the current prediction of the constraints that hold with equality at a solution of an LP problem. The search direction is constructed so that the constraints in the working set remain unaltered for any value of the step length. For a bound constraint in the working set, this property is achieved by setting the corresponding component of the search direction to zero. Thus, the associated variable is fixed and the specification of the working set induces a partition of into fixed and free variables. During a given iteration, the fixed variables are effectively removed from the problem; since the relevant components of the search direction are zero, the columns of corresponding to fixed variables may be ignored.
Let denote the number of general constraints in the working set and let denote the number of variables fixed at one of their bounds ( and are the quantities Lin and Bnd in the printed output from nag_opt_lp (e04mfc)). Similarly, let denote the number of free variables. At every iteration, the variables are re-ordered so that the last variables are fixed, with all other relevant vectors and matrices ordered accordingly.
|
|
The Main Iteration
|
|
Let denote the by matrix
where is the identity matrix of order . Let denote the transformed gradient
and let the vector of first elements of be denoted by . The quantity is known as the reduced gradient of . If the reduced gradient is zero, is a constrained stationary point in the subspace defined by . During the feasibility phase, the reduced gradient will usually be zero only at a vertex (although it may be zero at non-vertices in the presence of constraint dependencies). During the optimality phase, a zero reduced gradient implies that minimizes the linear objective when the constraints in the working set are treated as equalities. At a constrained stationary point, Lagrange multipliers and for the general and bound constraints are defined from the equations
(5)
Given a positive constant of the order of the machine precision, a Lagrange multiplier corresponding to an inequality constraint in the working set is said to be optimal if when the associated constraint is at its upper bound, or if when the associated constraint is at its lower bound. If a multiplier is non-optimal, the objective function (either the true objective or the sum of infeasibilities) can be reduced by deleting the corresponding constraint (with index Jdel; see Section [Description of Printed Output ]) from the working set.
If optimal multipliers occur during the feasibility phase and the sum of infeasibilities is non-zero, there is no feasible point, and nag_opt_lp (e04mfc) will continue until the minimum value of the sum of infeasibilities has been found. At this point, the Lagrange multiplier corresponding to an inequality constraint in the working set will be such that when the associated constraint is at its upper bound, and when the associated constraint is at its lower bound. Lagrange multipliers for equality constraints will satisfy .
If the reduced gradient is not zero, Lagrange multipliers need not be computed and the non-zero elements of the search direction are given by . The choice of step length is influenced by the need to maintain feasibility with respect to the satisfied constraints.
Each change in the working set leads to a simple change to : if the status of a general constraint changes, a row of is altered; if a bound constraint enters or leaves the working set, a column of changes. Explicit representations are recurred of the matrices and and of vectors , and .
One of the most important features of nag_opt_lp (e04mfc) is its control of the conditioning of the working set, whose nearness to linear dependence is estimated by the ratio of the largest to smallest diagonal elements of the factor (the printed value Cond T; see Section [Description of Printed Output ]). In constructing the initial working set, constraints are excluded that would result in a large value of Cond T.
nag_opt_lp (e04mfc) includes a rigorous procedure that prevents the possibility of cycling at a point where the active constraints are nearly linearly dependent (see Gill et al. (1989)). The main feature of the anti-cycling procedure is that the feasibility tolerance is increased slightly at the start of every iteration. This not only allows a positive step to be taken at every iteration, but also provides, whenever possible, a choice of constraints to be added to the working set. Let denote the maximum step at which does not violate any constraint by more than its feasibility tolerance. All constraints at a distance along from the current point are then viewed as acceptable candidates for inclusion in the working set. The constraint whose normal makes the largest angle with the search direction is added to the working set.
|
|
Choosing the Initial Working Set
|
|
Let be partitioned as . A working set for which defines the null space can be obtained by including the rows of as "artificial constraints". Minimization of the objective function then proceeds within the subspace defined by , as described in Section [Definition of the Search Direction ].
The artificially augmented working set is given by
(6)
so that will satisfy and . By definition of the factorization, automatically satisfies the following:
where
and hence the factorization of (6) is available trivially from and without additional expense.
The matrix is not kept fixed, since its role is purely to define an appropriate null space; the factorization can therefore be updated in the normal fashion as the iterations proceed. No work is required to "delete" the artificial constraints associated with when , since this simply involves repartitioning . The "artificial" multiplier vector associated with the rows of is equal to , and the multipliers corresponding to the rows of the "true" working set are the multipliers that would be obtained if the artificial constraints were not present. If an artificial constraint is "deleted" from the working set, an A appears alongside the entry in the Jdel column of the printed output (see Section [Description of Printed Output ]).
The number of columns in and and the Euclidean norm of , appear in the printed output as Nart, Nrz and Norm Gz (see Section [Description of Printed Output ]).
Under some circumstances, a different type of artificial constraint is used when solving a linear program. Although the algorithm of nag_opt_lp (e04mfc) does not usually perform simplex steps (in the traditional sense), there is one exception: a linear program with fewer general constraints than variables (i.e., ). (Use of the simplex method in this situation leads to savings in storage.) At the starting point, the "natural" working set (the set of constraints exactly or nearly satisfied at the starting point) is augmented with a suitable number of "temporary" bounds, each of which has the effect of temporarily fixing a variable at its current value. In subsequent iterations, a temporary bound is treated as a standard constraint until it is deleted from the working set, in which case it is never added again. If a temporary bound is "deleted" from the working set, an F (for "Fixed") appears alongside the entry in the Jdel column of the printed output (see Section [Description of Printed Output ]).
|
|
|
The optional_settings Parameter
|
|
Further information and examples on setting and using vectors of this type are available, see the documentation for NAG[SetOptions], NAG[GetOptions], NAG[FreeOptions] and NAG[Nag_E04_Opt].
|
prob - String;
|
|
Default
|
On entry: specifies the problem type. The following are the two possible values of prob and the size of the array cvec that is required to define the objective function:
|
|
"Nag_FP" cvec not accessed;
|
|
"Nag_LP" required;
|
|
"Nag_FP" denotes a feasible point problem and "Nag_LP" a linear programming problem.
|
|
Constraint: "Nag_FP" or "Nag_LP". .
|
|
|
start - String;
|
|
Default
|
On entry: specifies how the initial working set is chosen. With , nag_opt_lp (e04mfc) chooses the initial working set based on the values of the variables and constraints at the initial point. Broadly speaking, the initial working set will include equality constraints and bounds or inequality constraints that violate or "nearly" satisfy their bounds (to within optional_settings[crash_tol]; see below).
|
|
With , the user must provide a valid definition of every element of the array pointer optional_settings[state] (see below for the definition of this member of optional_settings). nag_opt_lp (e04mfc) will override the users' specification of optional_settings[state] if necessary, so that a poor choice of the working set will not cause a fatal error. will be advantageous if a good estimate of the initial working set is available – for example, when nag_opt_lp (e04mfc) is called repeatedly to solve related problems.
|
|
Constraint: "Nag_Cold" or "Nag_Warm". .
|
|
|
list - boolean;
|
|
Default
|
On entry: if the argument settings in the call to nag_opt_lp (e04mfc) will be printed.
|
|
|
print_level - String;
|
|
Default
|
On entry: the level of results printout produced by nag_opt_lp (e04mfc). The following values are available:
|
|
"Nag_Soln" The final solution.
|
|
"Nag_Iter" One line of output for each iteration.
|
|
"Nag_Iter_Long" A longer line of output for each iteration with more information (line exceeds 80 characters).
|
|
"Nag_Soln_Iter" The final solution and one line of output for each iteration.
|
|
"Nag_Soln_Iter_Long" The final solution and one long line of output for each iteration (line exceeds 80 characters).
|
|
"Nag_Soln_Iter_Const" As "Nag_Soln_Iter_Long" with the Lagrange multipliers, the variables , the constraint values and the constraint status also printed at each iteration.
|
|
"Nag_Soln_Iter_Full" As "Nag_Soln_Iter_Const" with the diagonal elements of the upper triangular matrix associated with the factorization 3 of the working set.
|
|
Constraint: "Nag_NoPrint", "Nag_Soln", "Nag_Iter", "Nag_Soln_Iter", "Nag_Iter_Long", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full". .
|
|
|
outfile - Vector(datatype=string);
|
|
|
On entry: The name of a file to which intermediate or diagnostic output should be appended. If a value is not provided for this parameter then the behaviour of this routine is platform dependent. Usually all output will be suppressed, however on some platforms output will be produced and will be displayed in the Maple session.
|
|
|
max_iter - integer;
|
|
Default
|
On entry: max_iter specifies the maximum number of iterations to be performed by nag_opt_lp (e04mfc).
|
|
If the user wishes to check that a call to nag_opt_lp (e04mfc) is correct before attempting to solve the problem in full then max_iter may be set to 0. No iterations will then be performed but the initialization stages prior to the first iteration will be processed and a listing of argument settings output if (the default setting).
|
|
Constraint: . .
|
|
|
crash_tol - float;
|
|
Default
|
Constraint: . .
|
|
|
ftol - float;
|
|
Default
|
On entry: ftol defines the maximum acceptable violation in each constraint at a "feasible" point. For example, if the variables and the coefficients in the general constraints are of order unity, and the latter are correct to about 6 decimal digits, it would be appropriate to specify ftol as .
|
|
nag_opt_lp (e04mfc) attempts to find a feasible solution before optimizing the objective function. If the sum of infeasibilities cannot be reduced to zero, nag_opt_lp (e04mfc) finds the minimum value of the sum. Let Sinf be the corresponding sum of infeasibilities. If Sinf is quite small, it may be appropriate to raise ftol by a factor of 10 or 100. Otherwise, some error in the data should be suspected.
|
|
Note that a "feasible solution" is a solution that satisfies the current constraints to within the tolerance ftol.
|
|
Constraint: . .
|
|
|
reset_ftol - integer;
|
|
Default
|
On entry: this option is part of an anti-cycling procedure designed to guarantee progress even on highly degenerate problems.
|
|
At certain stages the following "resetting procedure" is used to remove constraint infeasibilities. First, all variables whose upper or lower bounds are in the working set are moved exactly onto their bounds. A count is kept of the number of nontrivial adjustments made. If the count is positive, iterative refinement is used to give variables that satisfy the working set to (essentially) machine precision. Finally, the current feasibility tolerance is reinitialized to .
|
|
If a problem requires more than reset_ftol iterations, the resetting procedure is invoked and a new cycle of reset_ftol iterations is started. (The decision to resume the feasibility phase or optimality phase is based on comparing any constraint infeasibilities with .)
|
|
The resetting procedure is also invoked when nag_opt_lp (e04mfc) reaches an apparently optimal, infeasible or unbounded solution, unless this situation has already occurred twice. If any nontrivial adjustments are made, iterations are continued.
|
|
Constraint: . .
|
|
|
fcheck - integer;
|
|
Default
|
On entry: every fcheck iterations, a numerical test is made to see if the current solution satisfies the constraints in the working set. If the largest residual of the constraints in the working set is judged to be too large, the current working set is re-factorized and the variables are recomputed to satisfy the constraints more accurately.
|
|
Constraint: . .
|
|
|
inf_bound - float;
|
|
Default
|
On entry: inf_bound defines the "infinite" bound in the definition of the problem constraints. Any upper bound greater than or equal to inf_bound will be regarded as plus infinity (and similarly for a lower bound less than or equal to ).
|
|
Constraint: . .
|
|
|
inf_step - float;
|
|
Default
|
On entry: inf_step specifies the magnitude of the change in variables that will be considered a step to an unbounded solution. (Note that an unbounded solution can occur only when the problem is of type ). If the change in during an iteration would exceed the value of inf_step, the objective function is considered to be unbounded below in the feasible region.
|
|
Constraint: . .
|
|
|
state - assignable;
|
|
Default memory
|
Note: On exit the variable state will have a value of type integer.
|
|
On entry: state need not be set if the default option of is used as values of memory will be automatically allocated by nag_opt_lp (e04mfc).
|
|
|
|
|
The corresponding constraint should not be in the initial working set.
|
|
|
|
The constraint should be in the initial working set at its lower bound.
|
|
|
|
The constraint should be in the initial working set at its upper bound.
|
|
|
|
The constraint should be in the initial working set as an equality. This value should only be specified if . The values 1,2 or 3 all have the same effect when .
|
|
|
|
|
The values , and 4 are also acceptable but will be reset to zero by the function. In particular, if nag_opt_lp (e04mfc) has been called previously with the same values of n and nclin, state already contains satisfactory information. (See also the description of the optional argument optional_settings[start]). The function also adjusts (if necessary) the values supplied in x to be consistent with the values supplied in state.
|
|
On exit: if nag_opt_lp (e04mfc) exits with no error is raised, NW_SOLN_NOT_UNIQUE or NW_NOT_FEASIBLE, the values in state indicate the status of the constraints in the working set at the solution. Otherwise, state indicates the composition of the working set at the final iterate. The significance of each possible value of is as follows:
|
|
|
|
|
The constraint violates its lower bound by more than the feasibility tolerance.
|
|
|
|
The constraint violates its upper bound by more than the feasibility tolerance.
|
|
|
|
The constraint is satisfied to within the feasibility tolerance, but is not in the working set.
|
|
|
|
This inequality constraint is included in the working set at its lower bound.
|
|
|
|
This inequality constraint is included in the working set at its upper bound.
|
|
|
|
This constraint is included in the working set as an equality. This value of state can occur only when .
|
|
|
|
This corresponds to optimality being declared with being temporarily fixed at its current value. This value of state can only occur when the error "NW_SOLN_NOT_UNIQUE" is raised.
|
|
|
|
|
|
ax - assignable;
|
|
Default memory
|
Note: On exit the variable ax will have a value of type float.
|
|
On entry: nclin values of memory will be automatically allocated by nag_opt_lp (e04mfc) and this is the recommended method of use of ax. However a user may supply memory from the calling program.
|
|
On exit: if , ax points to the final values of the linear constraints .
|
|
|
lambda - assignable;
|
|
Default memory
|
Note: On exit the variable lambda will have a value of type float.
|
|
On entry: values of memory will be automatically allocated by nag_opt_lp (e04mfc) and this is the recommended method of use of lambda. However a user may supply memory from the calling program.
|
|
|
iter - assignable;
|
|
|
Note: On exit the variable iter will have a value of type integer.
|
|
On exit: the total number of iterations performed in the feasibility phase and (if appropriate) the optimality phase.
|
|
|
optim_tol - float;
|
|
|
On entry: optim_tol defines the tolerance used to determine whether the bounds and generated constraints have the correct sign for the solution to be judged optimal.
|
|
Constraint: . .
|
|
|
Description of Printed Output
|
|
The level of printed output can be controlled by the user with the structure members optional_settings[list] and optional_settings[print_level] (see Section [The optional-settings Parameter]). If then the argument values to nag_opt_lp (e04mfc) are listed, whereas the printout of results is governed by the value of optional_settings[print_level]. The default of provides a single line of output at each iteration and the final result. This section describes all of the possible levels of results printout available from nag_opt_lp (e04mfc).
The convention for numbering the constraints in the iteration results is that indices 1 to refer to the bounds on the variables, and indices to refer to the general constraints. When the status of a constraint changes, the index of the constraint is printed, along with the designation L (lower bound), U (upper bound), E (equality), F (temporarily fixed variable) or A (artificial constraint).
When "Nag_Iter" or "Nag_Soln_Iter" the following line of output is produced on completion of each iteration.
|
Jdel the index of the constraint deleted from the working set. If Jdel is zero, no constraint was deleted.
|
|
Jadd the index of the constraint added to the working set. If Jadd is zero, no constraint was added.
|
|
Step the step taken along the computed search direction. If a constraint is added during the current iteration (i.e., Jadd is positive), Step will be the step to the nearest constraint. During the optimality phase, the step can be greater than one only if the reduced Hessian is not positive-definite.
|
|
Ninf the number of violated constraints (infeasibilities). This will be zero during the optimality phase.
|
|
Sinf/Obj the value of the current objective function. If is not feasible, Sinf gives a weighted sum of the magnitudes of constraint violations. If is feasible, Obj is the value of the objective function. The output line for the final iteration of the feasibility phase (i.e., the first iteration for which Ninf is zero) will give the value of the true objective at the first feasible point.
|
|
During the optimality phase, the value of the objective function will be non-increasing. During the feasibility phase, the number of constraint infeasibilities will not increase until either a feasible point is found, or the optimality of the multipliers implies that no feasible point exists. Once optimal multipliers are obtained, the number of infeasibilities can increase, but the sum of infeasibilities will either remain constant or be reduced until the minimum sum of infeasibilities is found.
|
|
Bnd the number of simple bound constraints in the current working set.
|
|
Lin the number of general linear constraints in the current working set.
|
|
Nart the number of artificial constraints in the working set, i.e., the number of columns of (see Section [Further Description ]). At the start of the optimality phase, Nart provides an estimate of the number of nonpositive eigenvalues in the reduced Hessian.
|
|
Nrz is the number of columns of (see Section [Further Description ]). Nrz is the dimension of the subspace in which the objective function is currently being minimized. The value of Nrz is the number of variables minus the number of constraints in the working set; i.e., .
|
|
Norm Gz , the Euclidean norm of the reduced gradient with respect to . During the optimality phase, this norm will be approximately zero after a unit step.
|
If "Nag_Iter_Long", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full" the line of printout is extended to give the following information. (Note this longer line extends over more than 80 characters).
|
NOpt is the number of non-optimal Lagrange multipliers at the current point. NOpt is not printed if the current is infeasible or no multipliers have been calculated. At a minimizer, NOpt will be zero.
|
|
Min LM is the value of the Lagrange multiplier associated with the deleted constraint. If Min LM is negative, a lower bound constraint has been deleted; if Min LM is positive, an upper bound constraint has been deleted. If no multipliers are calculated during a given iteration, Min LM will be zero.
|
|
Cond T is a lower bound on the condition number of the working set.
|
When "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full" more detailed results are given at each iteration. For the setting additional values output are:
|
Value of x the value of currently held in x.
|
|
State the current value of optional_settings[state] associated with .
|
|
Value of Ax the value of currently held in optional_settings[ax].
|
|
State the current value of optional_settings[state] associated with .
|
Also printed are the Lagrange Multipliers for the bound constraints, linear constraints and artificial constraints.
If then the diagonal of and are also output at each iteration.
When "Nag_Soln", "Nag_Soln_Iter", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full" the final printout from nag_opt_lp (e04mfc) includes a listing of the status of every variable and constraint. The following describes the printout for each variable.
|
Varbl the name (V) and index , for of the variable.
|
|
State the state of the variable (FR if neither bound is in the working set, EQ if a fixed variable, LL if on its lower bound, UL if on its upper bound, TF if temporarily fixed at its current value). If Value lies outside the upper or lower bounds by more than the feasibility tolerance, State will be ++ or -- respectively.
|
|
Value the value of the variable at the final iteration.
|
|
Lower bound the lower bound specified for the variable. (None indicates that .)
|
|
Upper bound the upper bound specified for the variable. (None indicates that .)
|
|
Lagr mult the value of the Lagrange multiplier for the associated bound constraint. This will be zero if State is FR. If is optimal, the multiplier should be non-negative if State is LL, and non-positive if State is UL.
|
|
Residual the difference between the variable Value and the nearer of its bounds and .
|
The meaning of the printout for general constraints is the same as that given above for variables, with "variable" replaced by "constraint", and with the following change in the heading:
|
LCon the name (L) and index , for of the constraint.
|
|
Output of results via a user-defined printing function
|
|
The rest of this section can be skipped by a user who only wishes to use the default printing facilities.
When a user-defined function is assigned to optional_settings[print_fun] this will be called in preference to the internal print function of nag_opt_lp (e04mfc). Calls to the user-defined function are again controlled by means of the optional_settings[print_level] member. Information is provided through st and comm, the two structure arguments to optional_settings[print_fun].
If then the results from the last iteration of nag_opt_lp (e04mfc) are set in the following members of st:
first - boolean
true on the first call to optional_settings[print_fun].
iter - integer
The number of iterations performed.
n - integer
The number of variables.
nclin - integer
The number of linear constraints.
jdel - integer
Index of constraint deleted.
jadd - integer
Index of constraint added.
step - float
The step taken along the current search direction.
ninf - integer
The number of infeasibilities.
f - float
The value of the current objective function.
bnd - integer
Number of bound constraints in the working set.
lin - integer
Number of general linear constraints in the working set.
nart - integer
Number of artificial constraints in the working set.
nrz - integer
Number of columns of .
norm_gz - float
Euclidean norm of the reduced gradient, .
nopt - integer
Number of non-optimal Lagrange multipliers.
min_lm - float
Value of the Lagrange multiplier associated with the deleted constraint.
condt - float
A lower bound on the condition number of the working set.
x - float
x points to the n memory locations holding the current point .
ax - float
optional_settings[ax] points to the nclin memory locations holding the current values .
state - integer
optional_settings[state] points to the memory locations holding the status of the variables and general linear constraints. See Section [The optional-settings Parameter] for a description of the possible status values.
t - float
The upper triangular matrix with columns. Matrix element is held in .
tdt - integer
The trailing dimension for .
If then the Lagrange multipliers have been updated and the following members, kx, kactive, optional_settings[lambda] and gq, are set:
kx - integer
Indices of the bound constraints with associated multipliers. Value of is the index of the constraint with multiplier , for .
kactive - integer
Indices of the linear constraints with associated multipliers. Value of is the index of the constraint with multiplier , for .
lambda - float
The multipliers for the constraints in the working set. , for hold the multipliers for the bound constraints while the multipliers for the linear constraints are held at indices , , .
gq - float
, for , hold the multipliers for the artificial constraints.
The following members of st are also relevant and apply when it_prt or new_lm is true.
refactor - boolean
true if iterative refinement performed. See Section [The Main Iteration ] and optional argument optional_settings[reset_ftol].
jmax - integer
If then holds the index of the constraint with the maximum violation.
errmax - float
If then holds the value of the maximum violation.
moved - boolean
true if some variables moved to their bounds. See the optional argument optional_settings[reset_ftol].
nmoved - integer
If then holds the number of variables which were moved to their bounds.
rowerr - boolean
true if some constraints are not satisfied to within optional_settings[ftol].
feasible - boolean
true when a feasible point has been found.
If then the final result from nag_opt_lp (e04mfc) is available and the following members of st are set:
iter - integer
The number of iterations performed.
n - integer
The number of variables.
nclin - integer
The number of linear constraints.
x - float
x points to the n memory locations holding the final point .
f - float
The final objective function value or, if is not feasible, the sum of infeasibilities. If the problem is of type and is feasible then f is set to zero.
ax - float
optional_settings[ax] points to the nclin memory locations holding the final values .
state - integer
optional_settings[state] points to the memory locations holding the final status of the variables and general linear constraints. See Section [The optional-settings Parameter] for a description of the possible status values.
lambda - float
optional_settings[lambda] points to the final values of the Lagrange multipliers.
bl - float
bl points to the lower bound values.
bu - float
bu points to the upper bound values.
endstate - table
The state of termination of nag_opt_lp (e04mfc). Possible values of endstate and their correspondence to the error raised are:
Value of endstate
|
Error raised
|
Nag_Feasible and Nag_Optimal
|
no error raised
|
Nag_Weakmin
|
NW_SOLN_NOT_UNIQUE
|
Nag_Unbounded
|
NE_UNBOUNDED
|
Nag_Infeasible
|
NW_NOT_FEASIBLE
|
Nag_Too_Many_Iter
|
NW_TOO_MANY_ITER
|
|
|
The relevant members of the structure comm are:
it_prt - boolean
Will be true when the print function is called with the result of the current iteration.
sol_prt - boolean
Will be true when the print function is called with the final result.
new_lm - boolean
Will be true when the Lagrange multipliers have been updated.
|
Before calling nag_opt_lp (e04mfc) this field may be initialized for use by when called from nag_opt_lp (e04mfc).
|
|
|
|
|
|
Examples
|
|
>
|
a := Matrix([[1, 1, 1, 1, 1, 1, 1], [0.15, 0.04, 0.02, 0.04, 0.02, 0.01, 0.03], [0.03, 0.05, 0.08, 0.02, 0.06, 0.01, 0], [0.02, 0.04, 0.01, 0.02, 0.02, 0, 0], [0.02, 0.03, 0, 0, 0.01, 0, 0], [0.7, 0.75, 0.8, 0.75, 0.8, 0.97, 0], [0.02, 0.06, 0.08, 0.12, 0.02, 0.01, 0.97]], datatype=float[8], order='C_order'):
bl := Vector([-0.01, -0.1, -0.01, -0.04, -0.1, -0.01, -0.01, -0.13, -1e+21, -1e+21, -1e+21, -1e+21, -0.0992, -0.003], datatype=float[8]):
bu := Vector([0.01, 0.15, 0.03, 0.02, 0.05, 1e+21, 1e+21, -0.13, -0.0049, -0.0064, -0.0037, -0.0012, 1e+21, 0.002], datatype=float[8]):
cvec := Vector([-0.02, -0.2, -0.2, -0.2, -0.2, 0.04, 0.04], datatype=float[8]):
x := Vector([-0.01, -0.03, 0, -0.01, -0.1, 0.02, 0.01], datatype=float[8]):
NAG:-e04mfc(a, bl, bu, cvec, x, objf):
|
|
|
See Also
|
|
Gill P E, Hammarling S, Murray W, Saunders M A and Wright M H (1986a) Users' guide for LSSOL (Version 1.0) Report SOL 86-1 Department of Operations Research, Stanford University
Gill P E and Murray W (1978) Numerically stable methods for quadratic programming Math. Programming 14 349–372
Gill P E, Murray W, Saunders M A and Wright M H (1984b) Procedures for optimization problems with a mixture of bounds and general linear constraints ACM Trans. Math. Software 10 282–298
Gill P E, Murray W, Saunders M A and Wright M H (1989) A practical anti-cycling procedure for linearly constrained optimization Math. Programming 45 437–474
Gill P E, Murray W, Saunders M A and Wright M H (1991) Inertia-controlling methods for general quadratic programming SIAM Rev. 33 1–36
Gill P E, Murray W and Wright M H (1991b) Numerical Linear Algebra and Optimization (Volume 1) Addison Wesley, Redwood City, California.
e04 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|