3 \chapter{Stand-alone LP/MIP Solver}
6 The GLPK package includes the program \verb|glpsol|, which is a
7 stand-alone LP/MIP solver. This program can be invoked from the command
8 line of from the shell to read LP/MIP problem data in any format
9 supported by GLPK, solve the problem, and write the problem solution
10 obtained to an output text file.
12 \subsubsection*{Usage}
15 \verb|glpsol| [{\it options\dots}] [{\it filename}]
17 \subsubsection*{General options}
20 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
21 \verb|--mps| & read LP/MIP problem in fixed MPS format \\
22 \verb|--freemps| & read LP/MIP problem in free MPS format (default)\\
23 \verb|--lp| & read LP/MIP problem in CPLEX LP format \\
24 \verb|--glp| & read LP/MIP problem in GLPK format \\
25 \verb|--math| & read LP/MIP model written in GNU MathProg modeling
27 \multicolumn{2}{@{}l}{{\tt -m} {\it filename}, {\tt --model}
29 & read model section and optional data section from
30 {\it filename} (the same as \verb|--math|) \\
31 \multicolumn{2}{@{}l}{{\tt -d} {\it filename}, {\tt --data}
33 & read data section from {\it filename}
34 (for \verb|--math| only); if model file also has
35 data section, that section is ignored \\
36 \multicolumn{2}{@{}l}{{\tt -y} {\it filename}, {\tt --display}
38 & send display output to {\it filename}
39 (for \verb|--math| only); by default the output is
40 sent to \verb|stdout| \\
44 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
45 \verb|--seed| {\it value}
46 & initialize pseudo-random number generator used in
47 MathProg model with specified seed (any integer);
48 if the seed value is specified as \verb|?|
49 (question mark), some random seed will be used\\
50 \verb|--mincost| & read min-cost flow problem in DIMACS format\\
51 \verb|--maxflow| & read maximum flow problem in DIMACS format\\
52 \verb|--simplex| & use simplex method (default) \\
53 \verb|--interior| & use interior point method (for pure LP only) \\
54 \multicolumn{2}{@{}l}{{\tt -r} {\it filename}, {\tt --read}
56 & read solution from {\it filename} rather to find
58 \verb|--min| & minimization \\
59 \verb|--max| & maximization \\
60 \verb|--scale| & scale problem (default) \\
61 \verb|--noscale| & do not scale problem \\
62 \multicolumn{2}{@{}l}{{\tt -o} {\it filename}, {\tt --output}
64 & write solution to {\it filename} in printable
66 \multicolumn{2}{@{}l}{{\tt -w} {\it filename}, {\tt --write}
68 & write solution to {\it filename} in plain text
70 \multicolumn{2}{@{}l}{{\tt --ranges} {\it filename}} \\
71 & write sensitivity analysis report to {\it filename}
72 in printable format (simplex only) \\
73 \verb|--tmlim| {\it nnn}
74 & limit solution time to {\it nnn} seconds
75 (\verb|--tmlim 0| allows obtaining solution at
77 \verb|--memlim| {\it nnn}
78 & limit available memory to {\it nnn} megabytes \\
79 \verb|--check| & do not solve problem, check input data only \\
80 \verb|--name| {\it probname}
81 & change problem name to {\it probname} \\
82 \verb|--wmps| {\it filename}
83 & write problem to {\it filename} in fixed MPS
85 \multicolumn{2}{@{}l}{{\tt --wfreemps} {\it filename}} \\
86 & write problem to {\it filename} in free MPS
88 \verb|--wlp| {\it filename}
89 & write problem to {\it filename} in CPLEX LP
91 \verb|--wglp| {\it filename}
92 & write problem to {\it filename} in GLPK format \\
93 \verb|--log| {\it filename}
94 & write copy of terminal output to {\it filename} \\
95 \verb|-h|, \verb|--help|
96 & display this help information and exit \\
97 \verb|-v|, \verb|--version|
98 & display program version and exit \\
101 \subsection*{LP basis factorization options}
104 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
105 \verb|--luf| & LU + Forrest--Tomlin update \\
106 & (faster, less stable; default) \\
107 \verb|--cbg| & LU + Schur complement + Bartels--Golub update \\
108 & (slower, more stable) \\
109 \verb|--cgr| & LU + Schur complement + Givens rotation update \\
110 & (slower, more stable) \\
113 \subsubsection*{Options specific to the simplex solver}
116 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
117 \verb|--primal| & use primal simplex (default) \\
118 \verb|--dual| & use dual simplex \\
119 \verb|--std| & use standard initial basis of all slacks \\
120 \verb|--adv| & use advanced initial basis (default) \\
121 \verb|--bib| & use Bixby's initial basis\\
122 \verb|--ini| {\it filename}
123 & use as initial basis previously saved with
125 & (disables LP presolver) \\
126 \verb|--steep| & use steepest edge technique (default) \\
127 \verb|--nosteep| & use standard ``textbook'' pricing \\
128 \verb|--relax| & use Harris' two-pass ratio test (default) \\
129 \verb|--norelax| & use standard ``textbook'' ratio test \\
130 \verb|--presol| & use LP presolver (default; assumes \verb|--scale|
132 \verb|--nopresol| & do not use LP presolver \\
133 \verb|--exact| & use simplex method based on exact arithmetic \\
134 \verb|--xcheck| & check final basis using exact arithmetic \\
137 \subsubsection*{Options specific to the interior-point solver}
140 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
141 \verb|--nord| & use natural (original) ordering \\
142 \verb|--qmd| & use quotient minimum degree ordering \\
143 \verb|--amd| & use approximate minimum degree ordering (default)\\
144 \verb|--symamd| & use approximate minimum degree ordering \\
147 \subsubsection*{Options specific to the MIP solver}
150 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
151 \verb|--nomip| & consider all integer variables as continuous
152 (allows solving MIP as pure LP) \\
153 \verb|--first| & branch on first integer variable \\
154 \verb|--last| & branch on last integer variable \\
155 \verb|--mostf| & branch on most fractional variable \\
159 \begin{tabular}{@{}p{30mm}p{92.3mm}@{}}
160 \verb|--drtom| & branch using heuristic by Driebeck and Tomlin
162 \verb|--pcost| & branch using hybrid pseudocost heuristic (may be
163 useful for hard instances) \\
164 \verb|--dfs| & backtrack using depth first search \\
165 \verb|--bfs| & backtrack using breadth first search \\
166 \verb|--bestp| & backtrack using the best projection heuristic
168 \verb|--bestb| & backtrack using node with best local bound \\
169 \verb|--intopt| & use MIP presolver (default)\\
170 \verb|--nointopt| & do not use MIP presolver\\
171 \verb|--binarize| & replace general integer variables by binary ones
172 (assumes \verb|--intopt|)\\
173 \verb|--fpump| & apply feasibility pump heuristic\\
174 \verb|--gomory| & generate Gomory's mixed integer cuts\\
175 \verb|--mir| & generate MIR (mixed integer rounding) cuts\\
176 \verb|--cover| & generate mixed cover cuts\\
177 \verb|--clique| & generate clique cuts\\
178 \verb|--cuts| & generate cuts of all classes above (assumes
180 \verb|--mipgap| {\it tol}
181 & set relative mip gap tolerance to {\it tol}\\
187 For description of the MPS format see Appendix \ref{champs},
188 page \pageref{champs}.
193 For description of the CPLEX LP format see Appendix \ref{chacplex},
194 page \pageref{chacplex}.
199 For description of the modeling language see the document ``Modeling
200 Language GNU MathProg: Language Reference'' included in the GLPK
206 For description of the DIMACS min-cost flow problem format and DIMACS
207 maximum flow problem format see the document ``GLPK: Graph and Network
208 Routines'' included in the GLPK distribution.