glpk - GLPK interface
'F' Free (unbounded) variable (the constraint is ignored).
'U' Variable with upper bound ( A(i,:)*x<= b(i)).
'S' Fixed Variable (A(i,:)*x = b(i)).
'L' Variable with lower bound (A(i,:)*x >= b(i)).
'D' Double-bounded variable (A(i,:)*x >= -b(i) and A(i,:)*x <= b(i)).
'C' Continuous variable.
'I' Integer variable
Level of messages output by solver routines:
0 - No output.
1 - Error messages only.
2 - Normal output.
3 - Full output (includes informational messages).
scale (LPX_K_SCALE, default: 1). Scaling option:
0 - No scaling.
1 - Equilibration scaling.
2 - Geometric mean scaling, then equilibration scaling.
dual (LPX_K_DUAL, default: 0). Dual simplex option:
0 - Do not use the dual simplex.
1 - If initial basic solution is dual feasible, use the dual simplex.
price (LPX_K_PRICE, default: 1). Pricing option (for both primal and dual simplex):
0 - Textbook pricing.
1 - Steepest edge pricing.
round (LPX_K_ROUND, default: 0). Solution rounding option:
0 - Report all primal and dual values "as is".
1 - Replace tiny primal and dual values by exact zero.
itlim (LPX_K_ITLIM, default: -1). Simplex iterations limit. If this value is positive, it is decreased by one each time when one simplex iteration has been performed, and reaching zero value signals the solver to stop the search. Negative value means no iterations limit.
itcnt (LPX_K_OUTFRQ, default: 200). Output frequency, in iterations. This parameter specifies how frequently the solver sends information about the solution to the standard output.
branch (LPX_K_BRANCH, default: 2). Branching heuristic option (for MIP only):
0 - Branch on the first variable.
1 - Branch on the last variable.
2 - Branch using a heuristic by Driebeck and Tomlin.
btrack (LPX_K_BTRACK, default: 2). Backtracking heuristic option (for MIP only):
0 - Depth first search.
1 - Breadth first search.
2 - Backtrack using the best projection heuristic.
presol (LPX_K_PRESOL, default: 1). If this flag is set, the routine lpx_simplex solves the problem using the built-in LP presolver. Otherwise the LP presolver is not used.
usecuts (LPX_K_USECUTS, default: 1). If this flag is set, the routine lpx_intopt generates and adds cutting planes to the MIP problem in order to improve its LP relaxation before applying the branch&bound method (Only Gomory's mixed integer cuts are implemented).
lpsolver (default: 1) Select which solver to use. If the problem is a MIP problem this flag will be ignored.
1 - Revised simplex method.
2 - Interior point method.
save (default: 0). If this parameter is nonzero, save a copy of the problem problem in CPLEX LP format to the file "outpb.lp". There is currently no way to change the name of the output file.
Real parameters:
relax (LPX_K_RELAX, default: 0.07). Relaxation parameter used in the ratio test. If it is zero, the textbook ratio test is used. If it is non-zero (should be positive), Harris' two-pass ratio test is used. In the latter case on the first pass of the ratio test basic variables (in the case of primal simplex) or reduced costs of non-basic variables (in the case of dual simplex) are allowed to slightly violate their bounds, but not more than relax*tolbnd or relax*toldj (thus, relax is a percentage of tolbnd or toldj).
tolbnd (LPX_K_TOLBND, default: 10e-7). Relative tolerance used to check ifthe current basic solution is primal feasible. It is not recommended that you change this parameter unless you have a detailed understanding of its purpose.
toldj (LPX_K_TOLDJ, default: 10e-7). Absolute tolerance used to check if the current basic solution is dual feasible. It is not recommended that you change this parameter unless you have a detailed understanding of its purpose.
tolpiv (LPX_K_TOLPIV, default: 10e-9). Relative tolerance used to choose eligible pivotal elements of the simplex table. It is not recommended that you change this parameter unless you have a detailed understanding of its purpose.
objll (LPX_K_OBJLL, default: -DBL_MAX). Lower limit of the objective function. If on the phase II the objective function reaches this limit and continues decreasing, the solver stops the search. This parameter is used in the dual simplex method only.
objul (LPX_K_OBJUL, default: +DBL_MAX). Upper limit of the objective function. If on the phase II the objective function reaches this limit and continues increasing, the solver stops the search. This parameter is used in the dual simplex only.
tmlim (LPX_K_TMLIM, default: -1.0). Searching time limit, in seconds. If this value is positive, it is decreased each time when one simplex iteration has been performed by the amount of time spent for the iteration, and reaching zero value signals the solver to stop the search. Negative value means no time limit.
outdly (LPX_K_OUTDLY, default: 0.0). Output delay, in seconds. This parameter specifies how long the solver should delay sending information about the solution to the standard output. Non-positive value means no delay.
tolint (LPX_K_TOLINT, default: 10e-5). Relative tolerance used to check if the current basic solution is integer feasible. It is not recommended that you change this parameter unless you have a detailed understanding of its purpose.
tolobj (LPX_K_TOLOBJ, default: 10e-7). Relative tolerance used to check if the value of the objective function is not better than in the best known integer feasible solution. It is not recommended that you change this parameter unless you have a detailed understanding of its purpose.
Simplex Method:
180 (LPX_OPT) Solution is optimal.
181 (LPX_FEAS) Solution is feasible.
182 (LPX_INFEAS) Solution is infeasible.
183 (LPX_NOFEAS) Problem has no feasible solution.
184 (LPX_UNBND) Problem has no unbounded solution.
185 (LPX_UNDEF) Solution status is undefined.
Interior Point Method:
150 (LPX_T_UNDEF) The interior point method is undefined.
151 (LPX_T_OPT) The interior point method is optimal.
Mixed Integer Method:
170 (LPX_I_UNDEF) The status is undefined.
171 (LPX_I_OPT) The solution is integer optimal.
172 (LPX_I_FEAS) Solution integer feasible but its optimality has not been proven
173 (LPX_I_NOFEAS) No integer feasible solution.
If an error occurs, status will contain one of the following codes:
204 (LPX_E_FAULT) Unable to start the search.
205 (LPX_E_OBJLL) Objective function lower limit reached.
206 (LPX_E_OBJUL) Objective function upper limit reached.
207 (LPX_E_ITLIM) Iterations limit exhausted.
208 (LPX_E_TMLIM) Time limit exhausted.
209 (LPX_E_NOFEAS) No feasible solution.
210 (LPX_E_INSTAB) Numerical instability.
211 (LPX_E_SING) Problems with basis matrix.
212 (LPX_E_NOCONV) No convergence (interior).
213 (LPX_E_NOPFS) No primal feasible solution (LP presolver).
214 (LPX_E_NODFS) No dual feasible solution (LP presolver).
lambda - Dual variables.
redcosts - Reduced Costs.
time - Time (in seconds) used for solving LP/MIP problem.
mem - Memory (in bytes) used for solving LP/MIP problem.
Solve an LP/MILP problem using the GNU GLPK library. Given three arguments, glpk solves the following standard LP:
min C'*x subject to A*x <= b
but may also solve problems of the form
[ min | max ] C'*x subject to A*x [ "=" | "<=" | ">=" ] b x >= LB x <= UBc = [10, 6, 4]'; a = [ 1, 1, 1; 10, 4, 5; 2, 2, 6]; b = [100, 600, 300]'; lb = [0, 0, 0]'; ub = []; ctype = "UUU"; vartype = "CCC"; s = -1; param.msglev = 1; param.itlim = 100; [xmin, fmin, status, extra] = glpk (c, a, b, lb, ub, ctype, vartype, s, param);