QSopt QSopt_dual QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Solve the LP problem with the dual simplex algorithm.
Synopsis
int QSopt_dual (QSprob p, int *status)
Arguments
p a handle to an initialized problem.
status returns a code to indicate the status of the final solution.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
Description

The dual simplex algorithm is the method of choice for many forms of LP problems when solving the problem from scratch. The algorithm is also an effective solution procedure for re-optimizing problems after the addition of constraints (adding constraints keeps the current dual solution feasible).

After a call to QSopt_dual, the status variable should be checked to determine the status of the solution. In the most common cases, either an optimal solution is found (indicated by a value of QS_LP_OPTIMAL), or the problem is shown to be in infeasible (QS_LP_INFEASIBLE), or the problem is shown to be unbounded (QS_LP_UNBOUNDED). Optimization Status Codes gives a full list of the possible values for status.

By default QSopt_dual will solve the specified LP problem using the dual steepest-edge pricing rule. This rule is effective for many difficult LP problems, but for problems that are relatively easy to solve (even though they may be very large in size) a less time-consuming pricing rule may be preferable. To select an alternative pricing rule, the QSset_param function can be used with the whichparam argument set to the value given below.

Constant Parameter
QS_PARAM_DUAL_PRICING Dual Pricing

The QSopt library has available three pricing rules for the dual simplex algorithm. The pricing rule can be specified in QSset_param by setting the newvalue argument to one of the values given below.

Constant Rule
QS_PRICE_DDANTZIG Dual Dantzig
QS_PRICE_DSTEEP Dual steepest-edge
QS_PRICE_DMULTPARTIAL Dual multiple-partial

See Parameter Setting for the Optimizer for more parameters associated with the optimization algorithm

Example
int status, rval;

/* p is a QSprob, a handle to an existing LP problem */

rval = QSopt_dual (p, &status);
if (rval) {
    fprintf (stderr, "QSopt_dual failed with return code %d\n", rval);
} else {
    switch (status) {
    case QS_LP_OPTIMAL:
        printf ("Found optimal solution to LP\n");
        break;
    case QS_LP_INFEASIBLE:
        printf ("No feasible solution exists for the LP\n");
        break;
    case QS_LP_UNBOUNDED:
        printf ("The LP objective is unbounded\n");
        break;
    default:
        printf ("LP could not be solved, status = %d\n", status);
        break;
    }
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003