alpar@1
|
1 |
|
alpar@1
|
2 |
GNU Linear Programming Kit FAQ
|
alpar@1
|
3 |
|
alpar@1
|
4 |
Summary: Frequently Asked Questions about the GNU Linear Programming Kit
|
alpar@1
|
5 |
|
alpar@1
|
6 |
Author: Dr. Harley Mackenzie <hjm@hardsoftware.com>
|
alpar@1
|
7 |
|
alpar@1
|
8 |
Posting-Frequency: Monthly
|
alpar@1
|
9 |
|
alpar@1
|
10 |
Language: English
|
alpar@1
|
11 |
|
alpar@1
|
12 |
$Date: 2004/01/09 05:57:57 $
|
alpar@1
|
13 |
|
alpar@1
|
14 |
$Revision: 1.6 $
|
alpar@1
|
15 |
|
alpar@1
|
16 |
|
alpar@1
|
17 |
|
alpar@1
|
18 |
Introduction
|
alpar@1
|
19 |
|
alpar@1
|
20 |
Q. What is GPLK?
|
alpar@1
|
21 |
|
alpar@1
|
22 |
A. GLPK stands for the GNU Linear Programming Kit. The GLPK package is
|
alpar@1
|
23 |
a set of routines written in ANSI C and organized in the form of a
|
alpar@1
|
24 |
callable library. This package is intended for solving large-scale
|
alpar@1
|
25 |
linear programming (LP), mixed integer linear programming (MIP), and
|
alpar@1
|
26 |
other related problems.
|
alpar@1
|
27 |
|
alpar@1
|
28 |
The GLPK package includes the following main components:
|
alpar@1
|
29 |
|
alpar@1
|
30 |
* implementation of the simplex method,
|
alpar@1
|
31 |
|
alpar@1
|
32 |
* implementation of the primal-dual interior point method,
|
alpar@1
|
33 |
|
alpar@1
|
34 |
* implementation of the branch-and-bound method,
|
alpar@1
|
35 |
|
alpar@1
|
36 |
* application program interface (API),
|
alpar@1
|
37 |
|
alpar@1
|
38 |
* GNU MathProg modeling language (a subset of AMPL),
|
alpar@1
|
39 |
|
alpar@1
|
40 |
* GLPSOL, a stand-alone LP/MIP solver.
|
alpar@1
|
41 |
|
alpar@1
|
42 |
|
alpar@1
|
43 |
Q. Who develops and maintains GLPK?
|
alpar@1
|
44 |
|
alpar@1
|
45 |
A. GLPK is currently developed and maintained by Andrew Makhorin,
|
alpar@1
|
46 |
Department for Applied Informatics, Moscow Aviation Institute, Moscow,
|
alpar@1
|
47 |
Russia. Andrew's email address is <mao@mai2.rcnet.ru> and his postal
|
alpar@1
|
48 |
address is 125871, Russia, Moscow, Volokolamskoye sh., 4, Moscow
|
alpar@1
|
49 |
Aviation Institute, Andrew O. Makhorin
|
alpar@1
|
50 |
|
alpar@1
|
51 |
|
alpar@1
|
52 |
Q. How is GLPK licensed?
|
alpar@1
|
53 |
|
alpar@1
|
54 |
A. GLPK is currently licensed under the GNU General Public License
|
alpar@1
|
55 |
(GPL). GLPK is free software; you can redistribute it and/or modify it
|
alpar@1
|
56 |
under the terms of the GNU General Public License as published by the
|
alpar@1
|
57 |
Free Software Foundation; either version 2, or (at your option) any
|
alpar@1
|
58 |
later version.
|
alpar@1
|
59 |
|
alpar@1
|
60 |
GLPK is not licensed under the Lesser General Public License (LGPL) as
|
alpar@1
|
61 |
distinct from other free LP codes such as lp_solve. The most
|
alpar@1
|
62 |
significant implication is that code that is linked to the GLPK library
|
alpar@1
|
63 |
must be released under the GPL, whereas with the LGPL, code linked to
|
alpar@1
|
64 |
the library does not have to be released under the same license.
|
alpar@1
|
65 |
|
alpar@1
|
66 |
|
alpar@1
|
67 |
Q. Where is the GLPK home page?
|
alpar@1
|
68 |
|
alpar@1
|
69 |
The GLPK home page is part of the GNU web site and can found at
|
alpar@1
|
70 |
<http://www.gnu.org/software/glpk/glpk.html>.
|
alpar@1
|
71 |
|
alpar@1
|
72 |
|
alpar@1
|
73 |
Q. How do I download and install GLPK?
|
alpar@1
|
74 |
|
alpar@1
|
75 |
A. The GLPK source distribution can be found in the subdirectory
|
alpar@1
|
76 |
/gnu/glpk/ on your favorite GNU mirror
|
alpar@1
|
77 |
<http://www.gnu.org/prep/ftp.html> and can be compiled directly from
|
alpar@1
|
78 |
the source.
|
alpar@1
|
79 |
|
alpar@1
|
80 |
The GLPK package (like all other GNU software) is distributed in the
|
alpar@1
|
81 |
form of packed archive. This is one file named 'glpk-x.y.tar.gz', where
|
alpar@1
|
82 |
x is the major version number and y is the minor version number.
|
alpar@1
|
83 |
|
alpar@1
|
84 |
In order to prepare the distribution for installation you should:
|
alpar@1
|
85 |
|
alpar@1
|
86 |
1. Copy the GLPK distribution file to some subdirectory.
|
alpar@1
|
87 |
|
alpar@1
|
88 |
2. Enter the command 'gzip -d glpk-x.y.tar.gz' in order to unpack the
|
alpar@1
|
89 |
distribution file. After unpacking the name of the distribution file
|
alpar@1
|
90 |
will be automatically changed to 'glpk-x.y.tar'.
|
alpar@1
|
91 |
|
alpar@1
|
92 |
3. Enter the command 'tar -x < glpk-x.y.tar' in order to unarchive the
|
alpar@1
|
93 |
distribution. After this operation the subdirectory 'glpk-x.y' which is
|
alpar@1
|
94 |
the GLPK distribution will have been automatically created.
|
alpar@1
|
95 |
|
alpar@1
|
96 |
After you have unpacked and unarchived GLPK distribution you should
|
alpar@1
|
97 |
configure the package, and compiled the application. The result of
|
alpar@1
|
98 |
compilation is:
|
alpar@1
|
99 |
|
alpar@1
|
100 |
* the file 'libglpk.a', which is a library archive containing object code
|
alpar@1
|
101 |
for all GLPK routines; and
|
alpar@1
|
102 |
|
alpar@1
|
103 |
* the program 'glpsol', which is a stand-alone LP/MIP solver.
|
alpar@1
|
104 |
|
alpar@1
|
105 |
Complete compilation and installation instructions are included in the
|
alpar@1
|
106 |
INSTALL file included with the distribution.
|
alpar@1
|
107 |
|
alpar@1
|
108 |
The distribution includes make files for the Microsoft Visual C/C++
|
alpar@1
|
109 |
version 6 and Borland C/C++ version 5 and by default compiles and links
|
alpar@1
|
110 |
a glpk*.lib library file, a glpk*.dll DLL file and an glpsol.exe
|
alpar@1
|
111 |
application file. A GNU Windows 4.1 binary, source and documentation
|
alpar@1
|
112 |
compiled using the mingw32 C/C++ compiler is also available from
|
alpar@1
|
113 |
<http://gnuwin32.sourceforge.net/packages/glpk.htm>.
|
alpar@1
|
114 |
|
alpar@1
|
115 |
|
alpar@1
|
116 |
Q. Is there a GLPK mailing list or newsgroup?
|
alpar@1
|
117 |
|
alpar@1
|
118 |
A. GLPK has two mailing lists: <help-glpk@gnu.org> and
|
alpar@1
|
119 |
<bug-glpk@gnu.org>.
|
alpar@1
|
120 |
|
alpar@1
|
121 |
The main discussion list is <help-glpk@gnu.org>, and is used to discuss
|
alpar@1
|
122 |
all aspects of GLPK, including its development and porting. There is
|
alpar@1
|
123 |
also a special list used for reporting bugs at <bug-glpk@gnu.org>.
|
alpar@1
|
124 |
|
alpar@1
|
125 |
To subscribe to any GLPK mailing list, send an empty mail with a
|
alpar@1
|
126 |
Subject: header line of just "subscribe" to the relevant -request list.
|
alpar@1
|
127 |
For example, to subscribe yourself to the main list, you would send
|
alpar@1
|
128 |
mail to <help-glpk-request@gnu.org> with no body and a Subject: header
|
alpar@1
|
129 |
line of just "subscribe".
|
alpar@1
|
130 |
|
alpar@1
|
131 |
Another way to subscribe to the GLP mailing lists is to visit the web
|
alpar@1
|
132 |
pages <http://mail.gnu.org/mailman/listinfo/help-glpk> and
|
alpar@1
|
133 |
<http://mail.gnu.org/mailman/listinfo/bug-glpk>.
|
alpar@1
|
134 |
|
alpar@1
|
135 |
Currently there are no newsgroups dedicated to GLPK.
|
alpar@1
|
136 |
|
alpar@1
|
137 |
|
alpar@1
|
138 |
Q. Who maintains this FAQ and how do I contribute to this FAQ?
|
alpar@1
|
139 |
|
alpar@1
|
140 |
A. The present maintainer of this FAQ is Dr. Harley Mackenzie, HARD
|
alpar@1
|
141 |
software, although the content of the FAQ is derived from many sources
|
alpar@1
|
142 |
such as GLPK documentation, GLPK email archives and original content.
|
alpar@1
|
143 |
|
alpar@1
|
144 |
Harley's email address is <hjm@hardsoftware.com> and his postal address
|
alpar@1
|
145 |
is c/o HARD software, PO Box 8004, Newtown, Victoria 3220, Australia.
|
alpar@1
|
146 |
|
alpar@1
|
147 |
All contributions to this FAQ, such as questions and (preferably)
|
alpar@1
|
148 |
answers should be sent to the <hjm@hardsoftware.com> email address.
|
alpar@1
|
149 |
This FAQ is copyright Harley Mackenzie 2003 and is released under the
|
alpar@1
|
150 |
same license, terms and conditions as GLPK, that is, GPL version 2 or
|
alpar@1
|
151 |
later.
|
alpar@1
|
152 |
|
alpar@1
|
153 |
Contributions are not directly referenced in the body of the FAQ as
|
alpar@1
|
154 |
this would become unmanageable and messy, but rather as a list of
|
alpar@1
|
155 |
contributors to this FAQ. If you are the author of any information
|
alpar@1
|
156 |
included in this FAQ and you do not want your content to be included,
|
alpar@1
|
157 |
please contact the FAQ maintainer and your material will be removed.
|
alpar@1
|
158 |
Also if you have not been correctly included as a contributor to this
|
alpar@1
|
159 |
FAQ, your details have changed, or you do not want your name listed in
|
alpar@1
|
160 |
the list of contributors, please contact the FAQ maintainer for
|
alpar@1
|
161 |
correction.
|
alpar@1
|
162 |
|
alpar@1
|
163 |
|
alpar@1
|
164 |
Q. Where can I download this FAQ?
|
alpar@1
|
165 |
|
alpar@1
|
166 |
The latest version of the GLPK FAQ is available to download from
|
alpar@1
|
167 |
<http://www.hardsoftware.com/downloads.php#GLPK+FAQ> in the following
|
alpar@1
|
168 |
formats:
|
alpar@1
|
169 |
|
alpar@1
|
170 |
* DocBook
|
alpar@1
|
171 |
|
alpar@1
|
172 |
* Formatted text
|
alpar@1
|
173 |
|
alpar@1
|
174 |
* Adobe PDF
|
alpar@1
|
175 |
|
alpar@1
|
176 |
|
alpar@1
|
177 |
Q. Who are the FAQ contributors?
|
alpar@1
|
178 |
|
alpar@1
|
179 |
A. The FAQ contents were created from the following sources:
|
alpar@1
|
180 |
|
alpar@1
|
181 |
* Michael Hennebry
|
alpar@1
|
182 |
|
alpar@1
|
183 |
* http://www-unix.mcs.anl.gov/otc/Guide/faq/linear-programming-faq.html
|
alpar@1
|
184 |
|
alpar@1
|
185 |
* Harley Mackenzie, HARD software Pty. Ltd.
|
alpar@1
|
186 |
|
alpar@1
|
187 |
* Andrew Makhorin, Department for Applied Informatics, Moscow Aviation
|
alpar@1
|
188 |
Institute
|
alpar@1
|
189 |
|
alpar@1
|
190 |
|
alpar@1
|
191 |
GLPK functions & features
|
alpar@1
|
192 |
|
alpar@1
|
193 |
Q. What is the current state of GLPK development?
|
alpar@1
|
194 |
|
alpar@1
|
195 |
A. GLPK is a work in progress and is presently under continual
|
alpar@1
|
196 |
development. As of the current version 4.3, GLPK is a simplex-based
|
alpar@1
|
197 |
solver is able to handle problems with up to 100,000 constraints. In
|
alpar@1
|
198 |
particular, it successfully solves all instances from netlib (see the
|
alpar@1
|
199 |
file bench.txt included in the GLPK distribution). The interior-point
|
alpar@1
|
200 |
solver is not very robust as it is unable to handle dense columns,
|
alpar@1
|
201 |
sometimes terminates due to numeric instability or slow convergence.
|
alpar@1
|
202 |
|
alpar@1
|
203 |
The Mixed Integer Programming (MIP) solver currently is based on
|
alpar@1
|
204 |
branch-and-bound, so it is unable to solve hard or very large problems
|
alpar@1
|
205 |
with a probable practical limit of 100-200 integer variables. However,
|
alpar@1
|
206 |
sometimes it is able to solve larger problems of up to 1000 integer
|
alpar@1
|
207 |
variables, although the size that depends on properties of particular
|
alpar@1
|
208 |
problem.
|
alpar@1
|
209 |
|
alpar@1
|
210 |
|
alpar@1
|
211 |
Q. How does GLPK compare with other LP codes?
|
alpar@1
|
212 |
|
alpar@1
|
213 |
A. I think that on very large-scale instances CPLEX 8.0 dual simplex is
|
alpar@1
|
214 |
10-100 times faster than the GLPK simplex solver and, of course, much
|
alpar@1
|
215 |
more robust. In many cases GLPK is faster and more robust than lp_solve
|
alpar@1
|
216 |
4.0 for pure LPs as well as MIP's. See the bench.txt file in the GLPK
|
alpar@1
|
217 |
distribution doc directory for GLPK netlib benchmark results.
|
alpar@1
|
218 |
|
alpar@1
|
219 |
You can find benchmarks for some LP and MIP solvers such as CPLEX,
|
alpar@1
|
220 |
GLPK, lp_solve, and OSL on Hans Mittelmann's webpage at
|
alpar@1
|
221 |
<http://plato.asu.edu/bench.html>.
|
alpar@1
|
222 |
|
alpar@1
|
223 |
|
alpar@1
|
224 |
Q. What are the differences between AMPL and GNU MathProg?
|
alpar@1
|
225 |
|
alpar@1
|
226 |
A. The subset of AMPL implemented in MathProg approximately corresponds
|
alpar@1
|
227 |
to AMPL status in 1990, because it is mainly based on the paper Robert
|
alpar@1
|
228 |
Fourer, David M Gay and Brian W Kernighan (1990), "A Modeling Language
|
alpar@1
|
229 |
for Mathematical Programming", Management Science, Vol 36, pp. 519-554
|
alpar@1
|
230 |
and is available at
|
alpar@1
|
231 |
<http://users.iems.nwu.edu/~4er/WRITINGS/amplmod.pdf>.
|
alpar@1
|
232 |
|
alpar@1
|
233 |
The GNU MathProg translator was developed as part of GLPK. However, GNU
|
alpar@1
|
234 |
MathProg can be easily used in other applications as there is a set of
|
alpar@1
|
235 |
MathProg interface routines designed for use in other applications.
|
alpar@1
|
236 |
|
alpar@1
|
237 |
|
alpar@1
|
238 |
Q. What input file formats does GLPK support?
|
alpar@1
|
239 |
|
alpar@1
|
240 |
A. GLPK presently can read input and output LP model files in three
|
alpar@1
|
241 |
supported formats:
|
alpar@1
|
242 |
|
alpar@1
|
243 |
* MPS format - which is a column oriented and widely supported file
|
alpar@1
|
244 |
format but has poor human readability.
|
alpar@1
|
245 |
|
alpar@1
|
246 |
* CPLEX format - which is an easily readable row oriented format.
|
alpar@1
|
247 |
|
alpar@1
|
248 |
* GNU MathProg - which is an AMPL like mathematical modeling language.
|
alpar@1
|
249 |
|
alpar@1
|
250 |
|
alpar@1
|
251 |
Q. What interfaces are available for GLPK?
|
alpar@1
|
252 |
|
alpar@1
|
253 |
A. The GLPK package is in fact a C API that can be either by statically
|
alpar@1
|
254 |
or dynamically linked directly with many programming systems.
|
alpar@1
|
255 |
|
alpar@1
|
256 |
Presently there are three contributed external interfaces included with
|
alpar@1
|
257 |
the GLPK package:
|
alpar@1
|
258 |
|
alpar@1
|
259 |
* GLPK Java Native Interface (JNI)
|
alpar@1
|
260 |
|
alpar@1
|
261 |
* GLPK Delphi Interface (DELI)
|
alpar@1
|
262 |
|
alpar@1
|
263 |
* GLPKMEX Matlab MEX interface
|
alpar@1
|
264 |
|
alpar@1
|
265 |
There is an unofficial Microsoft Visual Basic, Tcl/Tk and Java GLPK
|
alpar@1
|
266 |
interface available at
|
alpar@1
|
267 |
<http://gottfried.lindner.bei.t-online.de/glpk.htm>.
|
alpar@1
|
268 |
|
alpar@1
|
269 |
There are other language interfaces under development, including a Perl
|
alpar@1
|
270 |
interface currently being developed by the FAQ maintainer, Dr. Harley
|
alpar@1
|
271 |
Mackenzie <hjm@hardsoftware.com>.
|
alpar@1
|
272 |
|
alpar@1
|
273 |
|
alpar@1
|
274 |
Q. Where can I find some examples?
|
alpar@1
|
275 |
|
alpar@1
|
276 |
A. The GLPK package distribution contains many examples written in GNU
|
alpar@1
|
277 |
MathProg (*.mod), C API calls (*.c), CPLEX input file format (*.lpt),
|
alpar@1
|
278 |
MPS format (*.mps) as well as some specific Traveling Salesman examples
|
alpar@1
|
279 |
(*.tsp).
|
alpar@1
|
280 |
|
alpar@1
|
281 |
All of the examples can be found in the GLPK distribution examples
|
alpar@1
|
282 |
sub-directory.
|
alpar@1
|
283 |
|
alpar@1
|
284 |
|
alpar@1
|
285 |
Q. What are the future plans for GLPK?
|
alpar@1
|
286 |
|
alpar@1
|
287 |
A. Developments planned for GLPK include improving the existing key
|
alpar@1
|
288 |
GLPK components, such as developing a more robust and more efficient
|
alpar@1
|
289 |
implementation of the simplex-based and interior-point solvers. Future
|
alpar@1
|
290 |
GLPK enhancements planned are implementing a branch-and-cut solver, a
|
alpar@1
|
291 |
MIP pre-processor, post-optimal and sensitivity analysis and possibly
|
alpar@1
|
292 |
network simplex and quadratic programming solvers.
|
alpar@1
|
293 |
|
alpar@1
|
294 |
|
alpar@1
|
295 |
Q. How do I report a GLPK bug?
|
alpar@1
|
296 |
|
alpar@1
|
297 |
A. If you think you have found a bug in GLPK, then you should send as
|
alpar@1
|
298 |
complete a report as possible to <bug-glpk@gnu.org>.
|
alpar@1
|
299 |
|
alpar@1
|
300 |
|
alpar@1
|
301 |
Q. How do I contribute to the GLPK development?
|
alpar@1
|
302 |
|
alpar@1
|
303 |
A. At present new GLPK development patches should be emailed to Andrew
|
alpar@1
|
304 |
Makhorin <mao@mai2.rcnet.ru >, with sufficient documentation and test
|
alpar@1
|
305 |
code to explain the nature of the patch, how to install it and the
|
alpar@1
|
306 |
implications of its use. Before commencing any major GLPK development
|
alpar@1
|
307 |
for inclusion in the GLPK distribution, it would be a good idea to
|
alpar@1
|
308 |
discuss the idea on the GLPK mailing list.
|
alpar@1
|
309 |
|
alpar@1
|
310 |
|
alpar@1
|
311 |
Q. How do I compile and link a GLPK application on a UNIX platform?
|
alpar@1
|
312 |
|
alpar@1
|
313 |
A. To compile a GLPK application on a UNIX platform, then compiler must
|
alpar@1
|
314 |
be able to include the GLPK include files and link to the GLPK library.
|
alpar@1
|
315 |
For example, on a system where the GLPK system is installed:
|
alpar@1
|
316 |
|
alpar@1
|
317 |
gcc mylp.c -o mylp -lglpk
|
alpar@1
|
318 |
|
alpar@1
|
319 |
or specify the include files and libglpk.a explicitly, if GLPK is not
|
alpar@1
|
320 |
installed.
|
alpar@1
|
321 |
|
alpar@1
|
322 |
|
alpar@1
|
323 |
Q. How do I compile and link a GLPK application on a Win32 platform?
|
alpar@1
|
324 |
|
alpar@1
|
325 |
A. On a Win32 platform, GLPK is implemented either as a Win32 Dynamic
|
alpar@1
|
326 |
Link Library (DLL) or can be statically linked to the glpk*.lib file.
|
alpar@1
|
327 |
As with the UNIX instructions, a GLPK application must set a path to
|
alpar@1
|
328 |
the GLPK include files and also reference the GLPK library if
|
alpar@1
|
329 |
statically linked.
|
alpar@1
|
330 |
|
alpar@1
|
331 |
|
alpar@1
|
332 |
Q. How do I limit the GLPK execution time?
|
alpar@1
|
333 |
|
alpar@1
|
334 |
A. You can limit the computing time by setting the control parameter
|
alpar@1
|
335 |
LPX_K_TMLIM via the API routine lpx_set_real_parm . At present there is
|
alpar@1
|
336 |
no way of limiting the execution time of glpsol without changing the
|
alpar@1
|
337 |
source and recompiling a specific version.
|
alpar@1
|
338 |
|
alpar@1
|
339 |
|
alpar@1
|
340 |
GLPK Linear Programming
|
alpar@1
|
341 |
|
alpar@1
|
342 |
Q. What is Linear Programming and how does it work?
|
alpar@1
|
343 |
|
alpar@1
|
344 |
A. Linear Programming is a mathematical technique that is a generic
|
alpar@1
|
345 |
method for solving certain systems of equations with linear terms. The
|
alpar@1
|
346 |
real power of LP's are that they have many practical applications and
|
alpar@1
|
347 |
have proven to be a powerful and robust tool.
|
alpar@1
|
348 |
|
alpar@1
|
349 |
The best single source of information on LP's is the Linear Programming
|
alpar@1
|
350 |
FAQ
|
alpar@1
|
351 |
<http://www-unix.mcs.anl.gov/otc/Guide/faq/linear-programming-faq.html>
|
alpar@1
|
352 |
that has information on LP's and MIP's, includes a comprehensive list
|
alpar@1
|
353 |
of available LP software and has many LP references for further study.
|
alpar@1
|
354 |
|
alpar@1
|
355 |
|
alpar@1
|
356 |
Q. How do I determine the stability of an LP solution?
|
alpar@1
|
357 |
|
alpar@1
|
358 |
A. You can perform sensitivity analysis by specifying the --bounds
|
alpar@1
|
359 |
option for glpsol as:
|
alpar@1
|
360 |
|
alpar@1
|
361 |
glpsol ... --bounds filename
|
alpar@1
|
362 |
|
alpar@1
|
363 |
in which case the solver writes results of the analysis to the
|
alpar@1
|
364 |
specified filename in plain text format. The corresponding API routine
|
alpar@1
|
365 |
is lpx_print_sens_bnds() .
|
alpar@1
|
366 |
|
alpar@1
|
367 |
|
alpar@1
|
368 |
Q. How do I determine which constraints are causing infeasibility?
|
alpar@1
|
369 |
|
alpar@1
|
370 |
A straightforward way to find such a set of constraints is to drop
|
alpar@1
|
371 |
constraints one at a time. If dropping a constraint results in a
|
alpar@1
|
372 |
solvable problem, pick it up and go on to the next constraint. After
|
alpar@1
|
373 |
applying phase 1 to an infeasible problem, all basic satisfied
|
alpar@1
|
374 |
constraints may be dropped.
|
alpar@1
|
375 |
|
alpar@1
|
376 |
If the problem has a feasible dual, then running the dual simplex
|
alpar@1
|
377 |
method is a more direct approach. After the last pivot, the nonbasic
|
alpar@1
|
378 |
constraints and one of the violated constraints will constitute a
|
alpar@1
|
379 |
minimal set. The GLPK simplex table routines will allow you to pick a
|
alpar@1
|
380 |
correct constraint from the violated ones.
|
alpar@1
|
381 |
|
alpar@1
|
382 |
Note that the GLPK pre-solver needs to be turned off for the preceding
|
alpar@1
|
383 |
technique to work, otherwise GLPK does not keep the basis of an
|
alpar@1
|
384 |
infeasible solution.
|
alpar@1
|
385 |
|
alpar@1
|
386 |
Also a more detailed methodology has been posted on the mail list
|
alpar@1
|
387 |
archive at
|
alpar@1
|
388 |
<http://mail.gnu.org/archive/html/help-glpk/2003-09/msg00017.html>.
|
alpar@1
|
389 |
|
alpar@1
|
390 |
|
alpar@1
|
391 |
Q. What is the difference between checks and constraints?
|
alpar@1
|
392 |
|
alpar@1
|
393 |
A. Check statements are intended to check that all data specified by
|
alpar@1
|
394 |
the user of the model are correct, mainly in the data section of a
|
alpar@1
|
395 |
MathProg model. For example, if some parameter means the number of
|
alpar@1
|
396 |
nodes in a network, it must be positive integer, that is just the
|
alpar@1
|
397 |
condition to be checked in the check statement (although in this case
|
alpar@1
|
398 |
such condition may be also checked directly in the parameter
|
alpar@1
|
399 |
statement). Note that check statements are performed when the
|
alpar@1
|
400 |
translator is generating the model, so they cannot include variables.
|
alpar@1
|
401 |
|
alpar@1
|
402 |
Constraints are conditions that are expressed in terms of variables and
|
alpar@1
|
403 |
resolved by the solver after the model has been completely generated.
|
alpar@1
|
404 |
If all data specified in the model are correct a priori, check
|
alpar@1
|
405 |
statements are not needed and can be omitted, while constraints are
|
alpar@1
|
406 |
essential components of the model and therefore cannot be omitted.
|
alpar@1
|
407 |
|
alpar@1
|
408 |
|
alpar@1
|
409 |
GLPK Integer Programming
|
alpar@1
|
410 |
|
alpar@1
|
411 |
Q. What is Integer Programming and how does it work?
|
alpar@1
|
412 |
|
alpar@1
|
413 |
A. Integer LP models are ones whose variables are constrained to take
|
alpar@1
|
414 |
integer or whole number (as opposed to fractional) values. It may not
|
alpar@1
|
415 |
be obvious that integer programming is a very much harder problem than
|
alpar@1
|
416 |
ordinary linear programming, but that is nonetheless the case, in both
|
alpar@1
|
417 |
theory and practice.
|
alpar@1
|
418 |
|
alpar@1
|
419 |
|
alpar@1
|
420 |
Q. What is the Integer Optimization Suite (IOS)?
|
alpar@1
|
421 |
|
alpar@1
|
422 |
A. IOS is a framework to implement implicit enumeration methods based
|
alpar@1
|
423 |
on LP relaxation (like branch-and-bound and branch-and-cut). Currently
|
alpar@1
|
424 |
IOS includes only basic features (the enumeration tree, API routines,
|
alpar@1
|
425 |
and the driver) and is not completely documented.
|
alpar@1
|
426 |
|
alpar@1
|
427 |
|
alpar@1
|
428 |
Q. I have just changed an LP to a MIP and now it doesn't work?
|
alpar@1
|
429 |
|
alpar@1
|
430 |
A. If you have an existing LP that is working and you change to an MIP
|
alpar@1
|
431 |
and receive a "lpx_integer: optimal solution of LP relaxation required"
|
alpar@1
|
432 |
204 (==LPX_E_FAULT) error, you probably have not called the LP solution
|
alpar@1
|
433 |
method lpx_simplex() before lpx_integer() . The MIP routines use the LP
|
alpar@1
|
434 |
solution as part of the MIP solution methodology.
|
alpar@1
|
435 |
|