XPRSwritebasis (WRITEBASIS)
XPRSwritebasis |
WRITEBASIS |
Purpose
Synopsis
int XPRS_CC XPRSwritebasis(XPRSprob prob, const char *filename, const char *flags);
WRITEBASIS [-flags] [filename]
Arguments
prob
|
The current problem.
|
||||||||||||
filename
|
A string of up to
MAXPROBNAMELENGTH characters containing the file name from which the basis is to be written. If omitted, the default
problem_name is used with a
.bss extension.
|
||||||||||||
flags
|
Flags to pass to
XPRSwritebasis (
WRITEBASIS):
|
Example 1 (Library)
After an LP has been solved it may be desirable to save the basis for future input as an advanced starting point for other similar problems. This may save significant amounts of time if the LP is complex. The Optimizer input commands might then be:
XPRSreadprob(prob, "myprob", ""); XPRSlpoptimize(prob, ""); XPRSwritebasis(prob, "", "");
This reads in a matrix file, maximizes the LP and saves the basis. Loading a basis for a MIP problem can disable some MIP presolve operations which can result in a large increase in solution times so it is generally not recommended.
Example 2 (Console)
An equivalent set of commands to the above for console users would be:
READPROB LPOPTIMIZE WRITEBASIS
Further information
1. The
t flag is only useful for later input to a similar problem using the
t flag with
XPRSreadbasis (
READBASIS).
2. If the Newton barrier algorithm has been used for optimization then crossover must have been performed before there is a valid basis. This basis can then only be used for restarting the simplex (primal or dual) algorithm.
3.
XPRSwritebasis (
WRITEBASIS) will output the basis for the original problem even if the matrix has been presolved.
Related topics