home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / internet / faq / englisch / linearprogramming < prev    next >
Encoding:
Text File  |  1995-04-11  |  65.0 KB  |  1,355 lines

  1. Posted-By: auto-faq 2.4
  2. Archive-name: linear-programming-faq
  3. Last-modified: March 1, 1995
  4.  
  5. Linear Programming - Frequently Asked Questions List 
  6. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  7. Posted monthly to Usenet newsgroup sci.op-research 
  8. World Wide Web version: 
  9. http://www.skypoint.com/subscribers/ashbury/linear-programming-faq.html
  10. Plain-text version: 
  11. ftp://rtfm.mit.edu/pub/usenet/sci.answers/linear-programming-faq
  12. Date of this version: March 1, 1995 
  13. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  14.  
  15. "I'll bet with my [inter]net I can get those Things yet!" -- Dr. Seuss 
  16.  
  17.  o Q1. "What is Linear Programming?" 
  18.  o Q2. "Where is there a good code to solve LP problems?" 
  19.  o Q3. "Oh, and we also want to solve it as an integer program."
  20.  o Q4. "I wrote an optimization code. Where are some test
  21.    models?" 
  22.  o Q5. "What is MPS format?" 
  23.  o Q6. "Just a quick question..." 
  24.  o Q7. "What references are there in this field?" 
  25.  o Q8. "How do I access the Netlib server?" 
  26.  o Q9. "Who maintains this FAQ list?" 
  27.  
  28. See also the related Nonlinear Programming FAQ. 
  29.  
  30.  
  31. Q1. "What is Linear Programming?" 
  32. ++++++++++++++++++++++++++++++++++
  33.  
  34. A: (For rigorous definitions and theory, which are beyond the scope
  35. of this document, the interested reader is referred to the many LP
  36. textbooks in print, a few of which are listed in the references
  37. section.) 
  38.  
  39. A Linear Program (LP) is a problem that can be expressed as
  40. follows (the so-called Standard Form): 
  41.  
  42.     minimize   cx
  43.     subject to Ax  = b
  44.                 x >= 0
  45.  
  46. where x is the vector of variables to be solved for, A is a matrix of
  47. known coefficients, and c and b are vectors of known coefficients.
  48. The expression "cx" is called the objective function, and the
  49. equations "Ax=b" are called the constraints. All these entities must
  50. have consistent dimensions, of course, and you can add "transpose"
  51. symbols to taste. The matrix A is generally not square, hence you
  52. don't solve an LP by just inverting A. Usually A has more columns
  53. than rows, and Ax=b is therefore quite likely to be
  54. under-determined, leaving great latitude in the choice of x with
  55. which to minimize cx. 
  56.  
  57. Although all linear programs *can* be put into the Standard Form,
  58. in practice it may not be necessary to do so. For example, although
  59. the Standard Form requires all variables to be non-negative, most
  60. good LP software allows general bounds l <= x <= u, where l and u
  61. are vectors of known lower and upper bounds. Individual elements
  62. of these bounds vectors can even be infinity and/or minus-infinity.
  63. This allows a variable to be without an explicit upper or lower
  64. bound, although of course the constraints in the A-matrix will
  65. need to put implied limits on the variable or else the problem may
  66. have no finite solution. Similarly, good software allows b1 <= Ax
  67. <= b2 for arbitrary b1, b2; there's no need to hide inequality
  68. constraints by the inclusion of explicit "slack" variables, nor to
  69. write the same row twice when it simply has a lower and upper
  70. bound on its sum. Also, LP software can handle maximization
  71. problems just as easily as minimization (in effect, the vector c is
  72. just multiplied by -1). 
  73.  
  74. LP problems are usually solved by a technique known as the
  75. Simplex Method, developed in the 1940's and after. Briefly stated,
  76. this method works by taking a sequence of square submatrices of A
  77. and solving for x, in such a way that successive solutions always
  78. improve, until a point in the algorithm is reached where
  79. improvement is no longer possible. A family of LP algorithms
  80. known as Interior-Point (or Barrier) methods comes from
  81. nonlinear programming approaches proposed in 1958 and further
  82. developed in the late 80's. These methods can be faster for many
  83. (but so far not all) large-scale problems. Such methods are
  84. characterized by constructing a sequence of trial solutions that go
  85. through the interior of the solution space, in contrast to the
  86. Simplex Method which stays on the boundary and examines only
  87. the corners (vertices). Large-scale LP software, whatever the
  88. algorithm, invariably uses general-structure sparse matrix
  89. techniques. 
  90.  
  91. The word "Programming" is used here in the sense of "planning";
  92. the necessary relationship to computer programming was
  93. incidental to the choice of name. Hence the phrase "LP program" to
  94. refer to a piece of software is not a redundancy, although I tend to
  95. use the term "code" instead of "program" to avoid the possible
  96. ambiguity. 
  97.  
  98. LP has a variety of uses, in such areas as petroleum, finance,
  99. forestry, transportation, and the military. 
  100.  
  101.  
  102. Q2. "Where is there a good code to solve LP problems?" 
  103. +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  104.  
  105. A: Nowadays, with good commercial software (i.e., code that you
  106. pay for), models with a few thousand constraints and several
  107. thousand variables can be tackled on a 386 PC. Workstations can
  108. often handle models with variables in the tens of thousands, or even
  109. greater, and mainframes can go larger still. Public domain (free)
  110. codes can be relied on to solve models of somewhat smaller
  111. dimension. The choice of code can make more difference than the
  112. choice of computer hardware. It's hard to be specific about model
  113. sizes and speed, a priori, due to the wide variation in things like
  114. model structure and variation in factorizing the basis matrices; just
  115. because a given code has solved a model of a certain dimension, it
  116. may not be able to solve *all* models of the same size, or in the
  117. same amount of time. 
  118.  
  119. There is a public domain code, written in C, called lp_solve that its
  120. author (Michel Berkelaar, email at michel@es.ele.tue.nl ) says has
  121. solved models with up to 30,000 variables and 50,000 constraints.
  122. The author requests that people retrieve it from
  123. ftp://ftp.es.ele.tue.nl/pub/lp_solve (numerical address at last check:
  124. 131.155.20.126). There is an older version to be found in the
  125. Usenet archives, but it contains bugs that have been fixed in the
  126. meantime, and hence is unsupported. The author also made
  127. available a program that converts data files from MPS-format into
  128. lp_solve's own input format; it's in the same directory, in file
  129. mps2eq_0.2.tar.Z. As an editorial opinion, I must state that
  130. difficult models will give lp_solve trouble; it's not as good as a
  131. commercial code. But for someone who isn't sure what kind of LP
  132. code is needed, it represents a very reasonable first try, since it 
  133. does solve non-trivial-sized models, probably better than any other 
  134. free code that you can get source code for. 
  135.  
  136. For academic users only, on a limited variety of platforms, there is
  137. available a free version of LOQO, which is a linear/quadratic
  138. program solver. Binary executables have been installed at
  139. ftp://elib.zib-berlin.de/pub/opt-net/software/loqo. There are
  140. versions for workstations by IBM, Silicon Graphics, HP, and Sun.
  141. The package includes a subroutine library (libloqo.a), an executable
  142. (loqo), the source for the main part of loqo (loqo.c), and associated
  143. documentation (loqo.dvi and *.eps). The algorithm used is a
  144. one-phase primal-dual-symmetric interior-point method. If you
  145. wish to purchase a commercial version, please contact Bob
  146. Vanderbei (rvdb@Princeton.EDU) for details. 
  147.  
  148. Among the SLATEC library routines is a sparse implementation of
  149. the Simplex method, in Fortran, available at
  150. ftp://netlib2.cs.utk.edu/slatec/src/splp.f. Its documentation states
  151. that it can solve LP models of "at most a few thousand constraints
  152. and variables". 
  153.  
  154. The next several suggestions are for public-domain codes that are
  155. severely limited by the algorithm they use (tableau Simplex); they
  156. may be OK for models with (on the order of) 100 variables and
  157. constraints, but it's unlikely they will be satisfactory for larger
  158. models. 
  159.  
  160.  o For DOS/PC users, there is an LP and Linear Goal
  161.    Programming binary called tslin, at
  162.    ftp://garbo.uwasa.fi/pc/ts (the current file name is
  163.    tslin34.zip, using ZIP compression), or else I suggest
  164.    contacting Prof. Salmi at ts@uwasa.fi . For North
  165.    American users, the garbo server is mirrored on FTP site
  166.    wuarchive.wustl.edu, in directory mirrors/garbo.uwasa.fi. 
  167.  o Also on the garbo server is a file called lp261.zip, having a
  168.    descriptor of "Linear Programming Optimizer by
  169.    ScanSoft". It consists of PC binaries, and is evidently some
  170.    sort of shareware (i.e., not strictly public domain). 
  171.  o There is an ACM TOMS routine for LP, #552, available at
  172.    ftp://netlib2.cs.utk.edu/toms/552. This routine was designed
  173.    for fitting data to linear constraints using an L1 norm, but it
  174.    uses a modification of the Simplex Method and could
  175.    presumably be modified to satisfy LP purposes. 
  176.  o There are books that contain source code for the Simplex
  177.    Method. See the section on references. You should not
  178.    expect such code to be robust. In particular, you can check
  179.    whether it uses a 2-dimensional array for the A-matrix; if
  180.    so, it is surely using the tableau Simplex Method rather than
  181.    sparse methods, and it will not be useful for large models.
  182.    But certainly, if your LP models are dense (and, perforce,
  183.    small), such a code may be suitable, and even preferable
  184.    over a more "sophisticated" sparse code; no snobbism is
  185.    implied by any of these comments! 
  186.  
  187. For Macintosh users there is a package called LinPro that is
  188. available at ftp://ra.nrl.navy.mil/MacSciTech/programming/. Some
  189. users have reported that it performs well, while one correspondent
  190. informs me he had trouble getting it to solve any problems at all;
  191. perhaps this code is sensitive to memory size of the machine. 
  192.  
  193. The following suggestions may represent a low-cost way of
  194. solving LP's if you already have certain software available to you. 
  195.  
  196.  o Some spreadsheet programs have an embedded LP solver, or
  197.    offer one as an installable option. 
  198.  o A package called QSB (Quantitative Systems for Business,
  199.    from Prentice-Hall publishers) has an LP module among its
  200.    routines. 
  201.  o If you have access to a commercial math library, such as
  202.    SAS, IMSL or NAG, you may be able to use an LP routine
  203.    from there. 
  204.  o Mathematical systems MATLAB (The Math Works, Inc.,
  205.    (508) 653-1415, see comment in the NLP FAQ) and
  206.    MAPLE (reference?) also have LP solvers. An interface
  207.    from MATLAB to lp_solve is available from Jeff Kantor
  208.    (Jeffrey.Kantor@nd.edu) in
  209.    ftp://control.cheg.nd.edu/pub/Kantor/matlab/lp_solve. A
  210.    MATLAB toolkit for solving LP models using
  211.    Interior-Point methods, called LIPSOL is available at 
  212.    ftp://ftp.math.umbc.edu/pub/zhang/lipsol - check the
  213.    documentation in this directory (currently in file
  214.    release.beta-2.1) for more information; the current version
  215.    is in subdirectory beta-2. There is an FTP site with
  216.    user-contributed .m files to do Simplex located at 
  217.    ftp://ftp.mathworks.com/pub/contrib/optim/simplex1.
  218.    There's a Usenet newsgroup on MATLAB: 
  219.    comp.soft-sys.matlab. If speed matters to you, then
  220.    according to a Usenet posting by Pascal Koiran
  221.    (koiran@ens-lyon.fr), on randomly generated LP models,
  222.    MATLAB was an order of magnitude faster than MAPLE
  223.    on a 200x20 problem but an order of magnitude slower than
  224.    lp_solve on a 50x100 problem. (I don't intend to get into
  225.    benchmarking in this document, but I mention these results
  226.    just to explain why I choose to focus mostly on special
  227.    purpose LP software.) 
  228.  
  229. If your models prove to be too difficult for free or add-on software
  230. to handle, then you may have to consider acquiring a commercial
  231. LP code. Dozens of such codes are on the market. There are many
  232. considerations in selecting an LP code. Speed is important, but LP
  233. is complex enough that different codes go faster on different
  234. models; you won't find a "Consumer Reports" article to say with
  235. certainty which code is THE fastest. I usually suggest getting
  236. benchmark results for your particular type of model if speed is
  237. paramount to you. Benchmarking can also help determine whether
  238. a given code has sufficient numerical stability for your kind of
  239. models. 
  240.  
  241. Other questions you should answer: Can you use a stand-alone
  242. code, or do you need a code that can be used as a callable library, or
  243. do you require source code? Do you want the flexibility of a code
  244. that runs on many platforms and/or operating systems, or do you
  245. want code that's tuned to your particular hardware architecture (in
  246. which case your hardware vendor may have suggestions)? Is the
  247. choice of algorithm (Simplex, Interior-Point) important to you?
  248. Do you need an interface to a spreadsheet code? Is the purchase
  249. price an overriding concern? If you are at a university, is the
  250. software offered at an academic discount? How much hotline
  251. support do you think you'll need? There is usually a large
  252. difference in LP codes, in performance (speed, numerical stability,
  253. adaptability to computer architectures) and in features, as you
  254. climb the price scale. 
  255.  
  256. At the end of this section is a *very* condensed version of a survey
  257. of LP software published in the June 1992 issue of "OR/MS
  258. Today", a joint publication of ORSA (Operations Research Society
  259. of America) and TIMS (The Institute of Management Science). For
  260. further information I would suggest you read the full article. It's
  261. likely that you can find a copy, either through a library, or by
  262. contacting a member of these two organizations (most universities
  263. have probably several members among the faculty and student
  264. body). This magazine also carries advertisements for many of these
  265. products, which may give you additional information to help make
  266. a decision. 
  267.  
  268. In the table below, I give the name of the software and the phone
  269. number listed in the June 1992 survey. Many of these companies
  270. have toll-free (800) numbers, but for the benefit of people outside
  271. the US I have listed an ordinary phone number where I know of it.
  272. To keep the table short enough to fit here, I decided not to include
  273. postal addresses. I have included, where I know of one, an email
  274. address (information not given in the June 1992 survey), and other
  275. information obtained from non-proprietary sources. For some
  276. companies there may exist European or Asian contact points, but
  277. this is beyond the scope of this document. Consult the full survey
  278. for more information on contacting vendors. 
  279.  
  280. The first part of the table consists of software I deem to be LP
  281. solvers. The second part is software that in some sense is a front
  282. end to the solvers (modeling software). In some cases it becomes a
  283. hazy distinction, but I hope this arrangement of information turns
  284. out to be useful to the reader. 
  285.  
  286. Under "H/W" is the minimum hardware said to be needed to run
  287. the code; generally I conceive of a hierarchy where PC's (and
  288. Macintoshes) are the least powerful, then workstations (WS) like
  289. Suns and RS-6000's, on up to supercomputers, so by the symbol
  290. "^" I mean "and up", namely that most commonly-encountered
  291. platforms are supported beyond the given minimum level. The
  292. code PC2 means PC-286 and above, and PC3 means PC-386 and
  293. above. 
  294.  
  295. Even more so than usual, I emphasize that you must use this
  296. information at your own risk. I provide it as a convenience to those
  297. readers who have difficulty in locating the OR/MS Today survey. I
  298. take no responsibility for errors either in the original article or by
  299. my act of copying it manually, though I will gladly correct any
  300. mistakes that are pointed out to me. 
  301.  
  302. Key to Features:  S=Simplex    I=Interior-Point or Barrier
  303.                   Q=Quadratic  G=General-Nonlinear
  304.                   M=MIP        N=Network
  305.                   V=Visualization
  306. Solver
  307. Code Name    Feat. H/W       Phone        Email address
  308. ---------    ----- --------- ------------ -------------
  309. AT&T KORBX   IQ    WS ^      908-949-8966
  310. Best Answer  S     Mac-Plus  510-943-7667
  311. CPLEX        SIMN  PC3 ^     702-831-7744 info@cplex.com
  312. Excel        SMG   PC/Mac    206-882-8080
  313. FortLP       SM    PC ^      708-971-2337
  314. HS/LP        SM    PC3/VAX   201-627-1424
  315. IBM OSL      SIMNQ PC/WS/IBM 914-433-4740 randym@vnet.ibm.com
  316. INCEPTA      SMV   PC3       416-896-0515
  317. LAMPS        SM    PC3 ^     413-584-1605 al@amsoft.demon.co.uk
  318. LINDO        SMQ   PC ^      312-871-2524 lindo@delphi.com
  319. LOQO         IQ    PC ^      609-258-0876 rvdb@princeton.edu
  320. LP88         S     PC        703-360-7600
  321. LPS-867      SM    PC/RS6000 609-737-6800
  322. MathPro      SMV   PC2/WS    202-887-0296
  323. MILP88       SM    PC        703-360-7600
  324. MILP LO      SV    PC      (+361)149-7531
  325. MINOS        SQG   PC ^      415-962-8719 mike@sol-michael.stanford.edu
  326. MINTO        M     WS        404-894-6287
  327. MPS-III      SMNQ  PC3 ^     703-412-3201
  328. MPSX (see IBM OSL)
  329. MSLP-PC      S     PC        604-361-9778
  330. OMP          SM    PC/VAX/WS 919-847-9997
  331. PC-PROG      SMQ   PC        919-847-9997 Ge.vanGeldorp@lr.tudelft.nl
  332. SAS/OR       SMN   PC ^      919-677-8000
  333. SCICONIC     SM    PC3 ^  (+44)908-585858
  334. STORM        SMN   PC        216-464-1209
  335. TurboSimplex S     PC/Mac    703-351-5272
  336. What If      SMG   PC        800-447-2226
  337. XA           SM    PC ^      818-441-1565 sunsetsoft@aol.com
  338. XPRESS-MP    SM    PC3/Mac ^ 202-887-0296 rcd@dashbh.demon.co.uk
  339.  
  340. Modeling
  341. Code Name          H/W        Phone        Email address
  342. ---------          --------- ------------ -------------
  343. AIMMS              PC3    (+31)023-350935 info@paragon.nl
  344. AMPL               PC3 ^     508-777-9069 ampl@research.att.com
  345. DATAFORM           PC3 ^     703-558-8701
  346. GAMS               PC2 ^     415-583-8840 gams@gams.com
  347. LINGO              PC ^      312-871-2524 lindo@delphi.com
  348. MIMI/LP            WS        908-464-8300
  349. MPL Sys.           PC        703-522-7900
  350. OMNI               PC3 ^     202-627-1424
  351. VMP                PC3/WS    301-622-0694
  352. What's Best!       PC/Mac/WS 800-441-2378 lindo@delphi.com
  353. XPRESS-MP          PC3/Mac ^ 202-887-0296 rcd@dashbh.demon.co.uk
  354.  
  355. The author of the OR/MS Today survey, Ramesh Sharda, has
  356. updated and expanded it in 1993 into a larger report called "Linear
  357. and Discrete Optimization and Modeling Software: A Resource
  358. Handbook". For information, contact Lionheart Publishing Inc.,
  359. 2555 Cumberland Parkway, Suite 299, Atlanta, GA 30339. Phone:
  360. (404)-431-0867. This book is fairly expensive, and geared toward
  361. users whose needs for LP software are considerable. Another book
  362. that became available in November 1993 is the "Optimization
  363. Software Guide," by Jorge More' and Stephen Wright, from SIAM
  364. Books. Call 1-800-447-7426 to order ($24.50, less ten percent if
  365. you are a SIAM member). It contains references to 75 available
  366. software packages (not all of them just LP), and goes into more
  367. detail than is possible in this FAQ. 
  368.  
  369.  
  370. Q3. "Oh, and we also want to solve it as an integer program. 
  371. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  372.  
  373. A: Integer LP models are ones where the answers must not take
  374. fractional values. It may not be obvious that this is a VERY much
  375. harder problem than ordinary LP, but it is nonetheless true. The
  376. buzzword is "NP-Completeness", the definition of which is
  377. beyond the scope of this document but means in essence that, in the
  378. worst case, the amount of time to solve a family of related
  379. problems goes up exponentially as the size of the problem grows,
  380. for all algorithms that solve such problems to a proven answer. 
  381.  
  382. Integer models may be ones where only some of the variables are to
  383. be integer and others may be real-valued (termed "Mixed Integer
  384. LP" or MILP, or "Mixed Integer Programming" or MIP); or they
  385. may be ones where all the variables must be integral (termed
  386. "Integer LP" or ILP). The class of ILP is often further subdivided
  387. into problems where the only legal values are {0,1} ("Binary" or
  388. "Zero-One" ILP), and general integer problems. For the sake of
  389. generality, the Integer LP problem will be referred to here as MIP,
  390. since the other classes can be viewed as special cases of MIP. MIP,
  391. in turn, is a particular member of the class of Discrete
  392. Optimization problems. 
  393.  
  394. People are sometimes surprised to learn that MIP problems are
  395. solved using floating point arithmetic. Although various
  396. algorithms for MIP have been studied, most if not all available
  397. general purpose large-scale MIP codes use a method called
  398. "Branch and Bound" to try to find an optimal solution. Briefly
  399. stated, B&B solves MIP by solving a sequence of related LP
  400. models. (As a point of interest, the Simplex Method currently
  401. retains an advantage over the newer Interior-Point methods for
  402. solving these sequences of LP's.) Good codes for MIP distinguish
  403. themselves more by solving shorter sequences of LP's, than by
  404. solving the individual LP's faster. Even more so than with regular
  405. LP, a costly commercial code may prove its value to you if your
  406. MIP model is difficult. 
  407.  
  408. You should be prepared to solve *far* smaller MIP models than the
  409. corresponding LP model, given a certain amount of time you wish
  410. to allow (unless you and your model happen to be very lucky).
  411. There exist models that are considered challenging, with a few
  412. dozen variables. Conversely, some models with tens of thousands
  413. of variables solve readily. The best explanations of "why" usually
  414. seem to happen after the fact. 8v) But a MIP model with hundreds
  415. of variables should always be approached, initially at least, with a
  416. certain amount of humility. 
  417.  
  418. A major exception to this somewhat gloomy outlook is that there
  419. are certain models whose LP solution always turns out to be
  420. integer, assuming the input data is integer to start with. The theory
  421. of unimodular matrices is fundamental here. It turns out that such
  422. problems are best solved by specialized routines that take major
  423. shortcuts in the Simplex Method, and as a result are relatively
  424. quick- running compared to ordinary LP. See the section on 
  425. Network models for further information. 
  426.  
  427. The public domain code lp_solve, mentioned earlier, accepts MIP
  428. models, as do a large number of the commercial LP codes in the
  429. June 1992 OR/MS Today survey (see section above). There is, in
  430. the April 1994 issue of OR/MS Today, a survey of MIP codes,
  431. which largely overlaps the content of the earlier survey on LP:
  432. "Survey: Mixed Integer Programming" by Matthew Saltzman, pp
  433. 42-51.. 
  434.  
  435. Peter Barth has announced opbdp, an implementation in C++ of an
  436. implicit enumeration algorithm for solving linear 0-1
  437. optimization problems. The algorithm compares well with
  438. commercial linear programming-based branch-and-bound on a
  439. variety of standard 0-1 integer programming benchmarks. He says
  440. that exploiting the logical structure of a problem, using opbdp,
  441. yields good performance on problems where exploiting the
  442. polyhedral structure seems to be inefficient and vice versa. The
  443. package is available via anonymous ftp:
  444. ftp://ftp.mpi-sb.mpg.de/pub/guide/staff/barth/opbdp or www:
  445. http://www.mpi-sb.mpg.de:/guide/staff/barth/barth.html A
  446. Technical Report is included as Postscript-File "mpii952002.ps"
  447. describing the techniques used in opbdp. 
  448.  
  449. I have seen mention made of algorithm 333 in the Collected
  450. Algorithms from CACM, though I'd be surprised if it was robust
  451. enough to solve large models. I am not aware of this algorithm
  452. being available online anywhere. 
  453.  
  454. In [Syslo] is code for 28 algorithms, most of which pertain to some
  455. aspect of Discrete Optimization. 
  456.  
  457. There is a code called Omega that analyzes systems of linear
  458. equations in integer variables. It does not solve optimization
  459. problems, except in the case that a model reduces completely, but
  460. its features could be useful in analyzing and reducing MIP models.
  461. It's available at ftp.cs.umd.edu:pub/omega (documentation is
  462. provided there), or contact Bill Pugh at pugh@cs.umd.edu. 
  463.  
  464. Mustafa Akgul (akgul@bilkent.edu.tr) at Bilkent University 
  465. maintains an archive in ftp://ftp.bilkent.edu.tr/pub/IEOR/Opt.
  466. There is a copy of lp_solve (though I would recommend using the
  467. official source listed in the previous section), and there is
  468. mip386.zip, which is a zip-compressed code for PC's. He also has
  469. a couple of network codes and various other codes he has picked up.
  470. All this is in the further subdirectories LP, PC, and Network. In
  471. addition to the ftp site, there is gopher (gopher.bilkent.edu.tr), Web
  472. (www.bilkent.edu.tr), and archive-server@bilkent.edu.tr. 
  473.  
  474. Bob Craig of AT&T (kat3@uscbu.ih.att.com) has software written
  475. in C, which implements Balas' enumerative algorithm for solving
  476. 0-1 ILP, that he is willing to make available to those who request
  477. it. 
  478.  
  479. The better commercial MIP codes have numerous parameters and
  480. options to give the user control over the solution strategy. Most
  481. have the capability of stopping before an optimum is proved,
  482. printing the best answer obtained so far. For many MIP models,
  483. stopping early is a practical necessity. Fortunately, a solution that
  484. has been proved by the algorithm to be within, say, 1% of
  485. optimality often turns out to be the true optimum, and the bulk of
  486. the computation time is spent proving the optimality. For many
  487. modeling situations, a near-optimal solution is acceptable anyway. 
  488.  
  489. Once one accepts that large MIP models are not typically solved to
  490. a proved optimal solution, that opens up a broad area of
  491. approximate methods, probabilistic methods and heuristics, as well
  492. as modifications to B&B. See [Balas] which contains a useful
  493. heuristic for 0-1 MIP models. See also the brief discussion of
  494. Genetic Algorithms and Simulated Annealing in the Nonlinear
  495. Programming FAQ. 
  496.  
  497. Whatever the solution method you choose, when trying to solve a
  498. difficult MIP model, it is usually crucial to understand the
  499. workings of the physical system (or whatever) you are modeling,
  500. and try to find some insight that will assist your chosen algorithm
  501. to work better. A related observation is that the way you formulate
  502. your model can be as important as the actual choice of solver. You
  503. should consider getting some assistance if this is your first time
  504. trying to solve a large (>100 integer variable) problem. 
  505.  
  506.  
  507. Q4. "I wrote an optimization code. Where are some test models?" 
  508. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  509.  
  510. A: If you want to try out your code on some real-world LP models,
  511. there is a very nice collection of small-to-medium-size ones, with
  512. a few that are rather large, at ftp://netlib2.cs.utk.edu/lp/data,
  513. popularly known as the Netlib collection (although Netlib consists
  514. of much more than just LP). These files (after you uncompress
  515. them) are in a format called MPS, which is described in another
  516. section of this document. Note that, when you receive a model, it
  517. may be compressed both with the Unix utility (use `uncompress` if
  518. the file name ends in .Z) AND with an LP-specific program (grab
  519. either emps.f or emps.c at the same time you download the model,
  520. then compile/run the program to reverse the compression). 
  521.  
  522. Also on netlib is a collection of infeasible LP models, located in
  523. ftp://netlib2.cs.utk.edu/lp/infeas. 
  524.  
  525. There is a collection of MIP models, housed at Rice University in
  526. ftp://softlib.cs.rice.edu/pub/miplib. Send an email message
  527. containing "send catalog" to softlib@rice.edu , to get started, if you
  528. can't access the files by other means. There's also a Travelling
  529. Salesman Problem (TSP) collection in
  530. ftp://softlib.cs.rice.edu/pub/tsplib. 
  531.  
  532. There is a collection of network-flow codes and models at
  533. ftp://dimacs.rutgers.edu/pub/netflow. Another network generator is
  534. called NETGEN and is available at
  535. ftp://netlib2.cs.utk.edu/lp/generators. 
  536.  
  537. The commercial modeling language GAMS comes with about 150
  538. test models, which you might be able to test your code with.
  539. AIMMS also comes with some test models. 
  540.  
  541. There is a collection called MP-TESTDATA available at
  542. Konrad-Zuse-Zentrum fuer Informations-technik Berlin (ZIB) in
  543. ftp://elib.zib-berlin.de/pub/mp-testdata. This directory contains
  544. various subdirectories, each of which has a file named "index"
  545. containing further information. Indexed at this writing are: assign,
  546. cluster, lp, ip, matching, maxflow, mincost, set-parti, steiner-tree,
  547. tsp, vehicle-rout, and generators. 
  548.  
  549. John Beasley maintains the OR-Lib, at
  550. ftp://mscmga.ms.ic.ac.uk/pub/, which contains various
  551. optimization test problems. There is an index in
  552. ftp://mscmga.ms.ic.ac.uk/pub/info.txt. WWW access now available
  553. at http://mscmga.ms.ic.ac.uk/. Have a look in the Journal of the
  554. Operational Research Society, Volume 41, Number 11, Pages
  555. 1069-72. If you can't access these resources, send e-mail to
  556. umtsk99@vaxa.cc.imperial.ac.uk to get started. Information about
  557. test problems can be obtained by emailing o.rlibrary@ic.ac.uk with
  558. the email message being the file name for the problem areas you
  559. are interested in, or just the word "info". 
  560.  
  561.  
  562. Q5. "What is MPS format?" 
  563. ++++++++++++++++++++++++++
  564.  
  565. A: MPS format was named after an early IBM LP product and has
  566. emerged as a de facto standard ASCII medium among most of the
  567. commercial LP codes. Essentially all commercial LP codes accept
  568. this format, but if you are using public domain software and have
  569. MPS files, you may need to write your own reader routine for this.
  570. It's not too hard. See also the comment regarding the lp_solve code,
  571. in another section of this document, for the availability of an MPS
  572. reader. 
  573.  
  574. The main things to know about MPS format are that it is column
  575. oriented (as opposed to entering the model as equations), and
  576. everything (variables, rows, etc.) gets a name. MPS format is
  577. described in more detail in [Murtagh]. A brief description of MPS
  578. format is available at ftp://softlib.cs.rice.edu/pub/miplib 
  579.  
  580. MPS is an old format, so it is set up as though you were using
  581. punch cards, and is not free format. Fields start in column 1, 5, 15,
  582. 25, 40 and 50. Sections of an MPS file are marked by so-called
  583. header cards, which are distinguished by their starting in column 1.
  584. Although it is typical to use upper-case throughout the file (like I
  585. said, MPS has long historical roots), many MPS-readers will
  586. accept mixed-case for anything except the header cards, and some
  587. allow mixed-case anywhere. The names that you choose for the
  588. individual entities (constraints or variables) are not important to
  589. the solver; you should pick names that are meaningful to you, or
  590. will be easy for a post-processing code to read. 
  591.  
  592. Here is a little sample model written in MPS format (explained in
  593. more detail below): 
  594.  
  595. NAME          TESTPROB
  596. ROWS
  597.  N  COST
  598.  L  LIM1
  599.  G  LIM2
  600.  E  MYEQN
  601. COLUMNS
  602.     XONE      COST                 1   LIM1                 1
  603.     XONE      LIM2                 1
  604.     YTWO      COST                 4   LIM1                 1
  605.     YTWO      MYEQN               -1
  606.     ZTHREE    COST                 9   LIM2                 1
  607.     ZTHREE    MYEQN                1
  608. RHS
  609.     RHS1      LIM1                 5   LIM2                10
  610.     RHS1      MYEQN                7
  611. BOUNDS
  612.  UP BND1      XONE                 4
  613.  LO BND1      YTWO                -1
  614.  UP BND1      YTWO                 1
  615. ENDATA
  616.  
  617. For comparison, here is the same model written out in an
  618. equation-oriented format: 
  619.  
  620. Optimize
  621.  COST:    XONE + 4 YTWO + 9 ZTHREE
  622. Subject To
  623.  LIM1:    XONE + YTWO < = 5
  624.  LIM2:    XONE + ZTHREE > = 10
  625.  MYEQN:   - YTWO + ZTHREE  = 7
  626. Bounds
  627.  0 < = XONE < = 4
  628. -1 < = YTWO < = 1
  629. End
  630.  
  631. Strangely, there is nothing in MPS format that specifies the
  632. direction of optimization. And there really is no standard "default"
  633. direction; some LP codes will maximize if you don't specify
  634. otherwise, others will minimize, and still others put safety first and
  635. have no default and require you to specify it somewhere in a
  636. control program or by a calling parameter. If you have a model
  637. formulated for minimization and the code you are using insists on
  638. maximization (or vice versa), it may be easy to convert: just
  639. multiply all the coefficients in your objective function by (-1). The
  640. optimal value of the objective function will then be the negative of
  641. the true value, but the values of the variables themselves will be
  642. correct. 
  643.  
  644. The NAME card can have anything you want, starting in column
  645. 15. The ROWS section defines the names of all the constraints;
  646. entries in column 2 or 3 are E for equality rows, L for less-than 
  647. ( <= ) rows, G for greater-than ( >= ) rows, and N for
  648. non-constraining rows (the first of which would be interpreted as
  649. the objective function). The order of the rows named in this section
  650. is unimportant. 
  651.  
  652. The largest part of the file is in the COLUMNS section, which is
  653. the place where the entries of the A-matrix are put. All entries for
  654. a given column must be placed consecutively, although within a
  655. column the order of the entries (rows) is irrelevant. Rows not
  656. mentioned for a column are implied to have a coefficient of zero. 
  657.  
  658. The RHS section allows one or more right-hand-side vectors to be
  659. defined; most people don't bother having more than one. In the
  660. above example, the name of the RHS vector is RHS1, and has
  661. non-zero values in all 3 of the constraint rows of the problem.
  662. Rows not mentioned in an RHS vector would be assumed to have a
  663. right-hand-side of zero. 
  664.  
  665. The optional BOUNDS section lets you put lower and upper
  666. bounds on individual variables (no * wild cards, unfortunately),
  667. instead of having to define extra rows in the matrix. All the bounds
  668. that have a given name in column 5 are taken together as a set.
  669. Variables not mentioned in a given BOUNDS set are taken to be
  670. non-negative (lower bound zero, no upper bound). A bound of type
  671. UP means an upper bound is applied to the variable. A bound of
  672. type LO means a lower bound is applied. A bound type of FX
  673. ("fixed") means that the variable has upper and lower bounds equal
  674. to a single value. A bound type of FR ("free") means the variable
  675. has neither lower nor upper bounds. 
  676.  
  677. There is another optional section called RANGES that I won't go
  678. into here. The final card must be ENDATA, and yes, it is spelled
  679. funny. 
  680.  
  681.  
  682. Q6. "Just a quick question..." 
  683. +++++++++++++++++++++++++++++++
  684.  
  685.  o Q6.1: What is a modeling language? 
  686.  o Q6.2: How do I diagnose an infeasible LP model? 
  687.  o Q6.3: I want to know the specific constraints that contradict
  688.    each other. 
  689.  o Q6.4: I just want to know whether or not a feasible solution
  690.    *exists*. 
  691.  o Q6.5: I have an LP, except it's got several objective
  692.    functions. 
  693.  o Q6.6: I have an LP that has large almost-independent
  694.    matrix blocks that are linked by a few constraints. Can I
  695.    take advantage of this? 
  696.  o Q6.7: I am looking for an algorithm to compute the convex
  697.    hull of a finite number of points in n-dimensional space. 
  698.  o Q6.8: Are there any parallel LP codes? 
  699.  o Q6.9: What software is there for Network models? 
  700.  o Q6.10: What software is there for the Traveling Salesman
  701.    Problem (TSP)? 
  702.  o Q6.11: What software is there for the Knapsack Problem? 
  703.  o Q6.12: What software is there for Stochastic Programming?
  704.  o Q6.13: I need to do post-optimal analysis. 
  705.  o Q6.14: Do LP codes require a starting vertex? 
  706.  
  707. Q6.1: What is a modeling language? 
  708. -----------------------------------
  709.  
  710. A: This is any code that creates input for an LP (or MIP, or NLP)
  711. code, using a more flexible input than MPS format. There are no
  712. free ones. Modeling languages can be roughly broken into two
  713. classes, column oriented ones, and equation oriented ones. The
  714. former class is older, and includes such commercial products as
  715. OMNI (Haverley Systems) and DATAFORM (Ketron); they tend
  716. to be called "matrix generators" sometimes. Members of the latter
  717. class are GAMS (Scientific Press), LINGO (LINDO Systems),
  718. AIMMS (Paragon Decision Technology) and AMPL (information
  719. is in netlib/opt/ampl.info.Z on the netlib server, or send email to
  720. ampl@research.att.com - see also the WWW home page for
  721. AMPL at ftp://netlib.att.com/netlib/att/cs/home/ampl/ampl.html).
  722. These products have links to various solvers, commercial and
  723. otherwise. 
  724.  
  725. Broadening the question slightly to cover front-ends in general,
  726. it's worth noting that people frequently use spreadsheet programs
  727. as an interface to some LP solvers. 
  728.  
  729. Q6.2: How do I diagnose an infeasible LP model? 
  730. ------------------------------------------------
  731.  
  732. A: A model is infeasible if the constraints are inconsistent, i.e., if
  733. no feasible solution can be constructed. It's often difficult to track
  734. down a cause. The cure may even be ambiguous: is it that some
  735. demand was set too high, or a supply set too low? A useful
  736. technique is Goal Programming, one variant of which is to include
  737. two explicit slack variables (positive and negative), with huge cost
  738. coefficients, in each constraint. The revised model is guaranteed to
  739. have a solution, and you can look at which rows have slacks that are
  740. included in the "optimal" solution. By the way, I recommend a
  741. Goal Programming philosophy even if you aren't having trouble
  742. with feasibility; "come on, you could probably violate this
  743. constraint for a price." 8v) Another approach is Fourier-Motzkin
  744. Elimination (article by Danztig and Eaves in the Journal of
  745. Combinatorial Theory (A) 14, 288-297 (1973). A software system
  746. called ANALYZE was developed by Harvey Greenberg to provide
  747. computer-assisted analysis, including rule-based intelligence; for
  748. further information about this code, and a bibliography of more
  749. than 400 references on the subject of model analysis, contact
  750. Greenberg at HGREENBERG@cudnvr.denver.colorado.edu. A
  751. system based on the MINOS solver, called MINOS(IIS), available
  752. from John Chinneck (chinneck@sce.carleton.ca), can also be used
  753. to identify a so-called Irreducible Infeasible Subset; the IIS feature
  754. is now available in CPLEX (command "display iis") and LINDO
  755. (command "debug"). As a final comment, commercial codes
  756. sometimes have other built-in features to help track infeasibilities.
  757.  
  758. Q6.3: I want to know the specific constraints that contradict each
  759. other. 
  760. ------------------------------------------------------------------
  761.  
  762. A: This may not be a well posed problem. If by this you mean you
  763. want to find the minimal set of constraints that should be removed
  764. to restore feasibility, this can be modeled as an Integer LP (which
  765. means, it's potentially a harder problem than the underlying LP
  766. itself). Start with a Goal Programming approach as outlined above,
  767. and introduce some 0-1 variables to turn the slacks off or on. Then
  768. minimize on the sum of these 0-1 variables. An article covering
  769. another approach to this question is by Chinneck and Dravnieks in
  770. the Spring 1991 ORSA Journal on Computing (vol 3, number 2). 
  771.  
  772. Q6.4: I just want to know whether or not a feasible solution *exists*. 
  773. -----------------------------------------------------------------------
  774.  
  775. A: From the standpoint of computational complexity, finding out if
  776. a model has a feasible solution is essentially as hard as finding the
  777. optimal LP solution, within a factor of 2 on average, in terms of
  778. effort in the Simplex Method; plug your problem into a normal LP
  779. solver with any objective function you like, such as c=0. There are
  780. no shortcuts in general, unless you know something useful about
  781. your model's structure (e.g., if you are solving some form of a
  782. transportation problem, you may be able to assure feasibility by
  783. checking that the sources add up to at least as great a number as the
  784. sum of the destinations). 
  785.  
  786. Q6.5: I have an LP, except it's got several objective functions. 
  787. -----------------------------------------------------------------
  788.  
  789. A: Fundamental to the class of Multiple Criteria models is that
  790. there may no longer be the concept of a unique solution. I am
  791. unaware of any public domain code to approach such problems. I
  792. have seen a reference to MATLAB's Optimization Toolbox. 
  793.  
  794. ADBASE is a package that computes all efficient (i.e.,
  795. nondominated) extreme points of a multiple objective linear
  796. program. It is available without charge for research and
  797. instructional purposes. If someone has a genuine need for such a
  798. code, they should send a request to: Ralph E. Steuer, Faculty of
  799. Management Science, Brooks Hall, University of Georgia, Athens,
  800. GA 30602-6255. 
  801.  
  802. Other approaches that have worked are: 
  803.  
  804.  o Goal Programming (treat the objectives as constraints with
  805.    costed slacks), or, almost equivalently, form a composite
  806.    function from the given objective functions; 
  807.  o Pareto preference analysis (essentially brute force
  808.    examination of all vertices); 
  809.  o Put your objective functions in priority order, optimize on
  810.    one objective, then change it to a constraint fixed at the
  811.    optimal value (perhaps subject to a small tolerance), and
  812.    repeat with the next function. 
  813.  
  814. There is a section on this whole topic in [Nemhauser]. [Schrage]
  815. has a chapter devoted to the subject. [Hwang] has also been
  816. recommended by a reader on Usenet. As a final piece of advice, if
  817. you can cast your model in terms of physical realities, or dollars
  818. and cents, sometimes the multiple objectives disappear! 8v) 
  819.  
  820. Q6.6: I have an LP that has large almost-independent matrix blocks
  821. that are linked by a few constraints. Can I take advantage of this? 
  822. --------------------------------------------------------------------
  823.  
  824. A: Possibly. See section 6.2 in [Nemhauser] for a discussion of
  825. Dantzig-Wolfe decomposition. I am told that the commercial code
  826. OSL has features to assist in doing this. With any other code, you'll
  827. have to create your own framework and then call the LP solver to
  828. solve the subproblems. The folklore is that generally such schemes
  829. take a long time to converge so that they're slower than just solving
  830. the model as a whole, although research continues. For now my
  831. advice, unless you are using OSL or your model is so huge that a
  832. good solver can't fit it in memory, is to not bother decomposing it.
  833. It's probably more cost effective to upgrade your solver, if the
  834. algorithm is limiting you, than to invest your time; but I suppose
  835. that's an underlying theme in a lot of my advice. 8v) 
  836.  
  837. Q6.7: I am looking for an algorithm to compute the convex hull of a
  838. finite number of points in n-dimensional space. 
  839. -------------------------------------------------------------------
  840.  
  841. A: There is a program called qhull, available at
  842. ftp://geom.umn.edu/pub/software/qhull.tar.Z. When you
  843. uncompress it and untar it, it will create a directory called qhull
  844. which has source code plus a README file. It uses the "Beneath
  845. Beyond" method, described in [Edelsbrunner]. A code in C called 
  846. cdd is available at ftp://ftp.efpl.ch/incoming/dma and is written by
  847. Komei Fukuda; download the file named cdd-***.tar.Z, where ***
  848. is the version number (choose the most recent version, which at last
  849. check was 055). It solves the problem stated above, as well as that
  850. of enumerating all vertices. A code in C called rs by David Avis
  851. implements the reverse search method. There is a directory in 
  852. ftp://elib.zib-berlin.de/pub/mathprog/polyth that contains pointers
  853. to some tools for such problems. Other algorithms for such
  854. problems are described in [Swart], [Seidel], and [Avis]. Such topics
  855. are said to be discussed in [Schrijver] (page 224), [Chvatal] (chapter
  856. 18), [Balinski], and [Mattheis] as well. Part of the method
  857. described in [Avis], to enumerate vertices, is implemented in a
  858. Mathematica package called VertexEnum.m at
  859. ftp://cs.sunysb.edu/pub/Combinatorica, in file VE041.Z. 
  860.  
  861. Q6.8: Are there any parallel LP codes? 
  862. ---------------------------------------
  863.  
  864. A: The vendors for OSL, CPLEX and XPRESS-MP each have
  865. announced parallel implementations of Branch and Bound solvers
  866. for MIP. Jeffrey Horn (horn@cs.wisc.edu) has compiled a
  867. bibliography of papers relating to research on parallel B&B. There
  868. is an survey article by Gendron and Crainic in the journal
  869. Operations Research, Vol. 42 (1994), No. 6, pp. 1042-1066. 
  870.  
  871. I'm not aware of any implementations (beyond the "toy" level) of
  872. general sparse Simplex or interior-point solvers on parallel
  873. machines. If your particular model is a good candidate for
  874. decomposition (see topic, above) then parallelism could be very
  875. useful, but you'll have to implement it yourself. Here's what I say
  876. to people who write parallel LP solvers as class projects: 
  877.  
  878. You are probably working with the tableau form of the Simplex
  879. method. This method works well for small models, but it is
  880. inefficient for most real-world models because such models are
  881. usually <1% dense. Sparse matrix methods dominate here. It may
  882. well be true that you can get good parallel speedups with your
  883. code, but I'd wager that by the time you get to problems with 1000
  884. rows, any parallel-dense LP code will be slower than a single-
  885. processor sparse code. And, worse yet, I think it's generally
  886. accepted that no one currently knows how to do a good (i.e.,
  887. scalable) parallel sparse LP code. I wouldn't be harping on this
  888. point, except that most people's interest in parallelism is because of
  889. the promise of scalability, in which case large-scale considerations
  890. are important. Writing even a single-processor large-scale LP
  891. code is a multi-year project, realistically. The point is, don't get
  892. too enthralled by speedups in your code, unless there's something
  893. to what you are doing that I haven't guessed. 
  894.  
  895. Q6.9: What software is there for Network models? 
  896. -------------------------------------------------
  897.  
  898. A: Special cases of this problem are the Transportation Problem,
  899. the Assignment Problem, and the Shortest Path Problem. Some
  900. commercial LP solvers include a network solver. See [Kennington],
  901. which contains some source code for Netflo, a code available at
  902. ftp://dimacs.rutgers.edu/pub/netflow/mincost/solver-1, but I don't
  903. know the copyright situation (I always thought you had to buy the
  904. book to get the code). Other network solvers are on this same 
  905. DIMACS server in ftp://dimacs.rutgers.edu/pub/netflow. Another
  906. text containing Fortran code is [Bertsekas]; an on-line for source
  907. code that may be related to this is 
  908. ftp://LIDS.MIT.EDU/pub/bertsekas/RELAX for minimum cost
  909. flow problems. Simiarly, [Burkard] contains Fortran code for the
  910. Assignment Problem. There is an ACM TOMS routine, #548,
  911. located at ftp://netlib2.cs.utk.edu/toms/548, that solves the
  912. Assignment problem using the Hungarian Method. An article in
  913. the ORSA Journal on Computing in 1991 by Kennington and Wang
  914. investigated the performance of some algorithms. 
  915.  
  916. The following software for Network models is available by
  917. sending mail to "ftp-request@theory.stanford.edu". To obtain the
  918. desired software, put the following as the SUBJECT: 
  919.  
  920.     "send csmin.tar"    to get the cost scaling min-cost flow/
  921.                         transportation problem code (CS).  (current
  922.                         version 1.2)
  923.     "send splib.tar"    to get the library of shortest paths codes and
  924.                         problem generators.
  925.     "send csas.tar"     to get the assignment problem codes (CSA).
  926.     (A maximum flow code was to be available in the Fall of 1994.)
  927.  
  928. Technical reports describing the above implementation are also
  929. available. The SUBJECT line should contain the following. 
  930.  
  931.     "send stan-cs-92-1439.ps"    to get the CS implementation report.
  932.     "send stan-cs-93-1480.ps"    to get the SPLIB report.
  933.     "send stan-cs-93-1481.ps"    to get the CSA implementation report.
  934.  
  935. Q6.10: What software is there for the Traveling Salesman Problem (TSP)?
  936. -----------------------------------------------------------------------
  937.  
  938. A: TSP is a famously hard problem that has attracted many of the
  939. best minds in the field. Solving for a proved optimum is
  940. combinatorial in nature; methods have been explored both to give
  941. proved optimal solutions, and to give approximate but "good"
  942. solutions. To my knowledge, there aren't any commercial products
  943. to solve this problem, nor are there any public domain codes
  944. available by anonymous FTP. For a bibliography, check the Integer
  945. Programming section of [Nemhauser], particularly the references
  946. with the names Groetschel and/or Padberg in them. A good
  947. reference is [Lawler]. There are some heuristics for getting a
  948. "good" solution in the article by Lin and Kernighan in Operations
  949. Research, Vol 21 (1973), pp 498-516. [Syslo] contains some
  950. algorithms and Pascal code. Numerical Recipes [Press] contains
  951. code that uses Simulated Annealing. [Bentley] is said to contain a
  952. description of how to write a TSP code. Code for a solver can be
  953. obtained via instructions in [Volgenant]. Bob Craig of AT&T
  954. (kat3@uscbu.ih.att.com) has software written in C, for both exact
  955. solution and heuristics, that he is willing to make available to those
  956. who request it. Likewise, Chad Hurwitz (churritz@crash.cts.com),
  957. offers a code called tsp_solve for heuristic and optimal solution, to
  958. those who email him. 
  959.  
  960. Q6.11: What software is there for the Knapsack Problem? 
  961. --------------------------------------------------------
  962.  
  963. A: As with the TSP, I don't know of any commercial solvers for
  964. this specific problem. Any good MIP solver should be able to be
  965. used, although any given instance of this problem could be
  966. difficult. Specialized algorithms are said to be available in [Syslo]
  967. and [Martello]. Bob Craig of AT&T (kat3@uscbu.ih.att.com) has
  968. software written in C, for both exact solution and heuristics, that
  969. he is willing to make available to those who request it. 
  970.  
  971. Q6.12: What software is there for Stochastic Programming? 
  972. ----------------------------------------------------------
  973.  
  974. A: [Thanks to Derek Holmes, dholmes@engin.umich.edu, for this
  975. text.] Your success solving a stochastic program depends greatly on
  976. the characteristics of your problem. The two broad classes of
  977. stochastic programming problems are recourse problems and
  978. chance- constrained (or probabilistically constrained) problems. 
  979.  
  980. Recourse Problems are staged problems wherein one alteranates
  981. decisions with realizations of stochastic data. The objective is to
  982. minimize total expected costs of all decisions. The main sources of
  983. code (not necessarily public domain) depend on how the data is
  984. distributed and how many stages (decision points) are in the
  985. problem. For discretely distributed multistage problems, a good
  986. package called MSLiP is available from Gus Gassman
  987. (gassmann@ac.dal.ca, written up in Math. Prog. 47,407-423) Also,
  988. for not huge discretely distributed problems, a deterministic
  989. equivalent can be formed which can be solved with a standard
  990. solver. STOPGEN, available via anonymous FTP from this author
  991. is a program which forms deterministic equiv. MPS files from
  992. stopro problems in standard format (Birge, et. al., COAL
  993. newsletter 17). The most recent program for continuously
  994. distributed data is BRAIN, by K. Frauendorfer
  995. (frauendorfer@sgcl1.unisg.ch, written up in detail in the author's
  996. monograph ``Stochastic Two-Stage Programming'', Lecture Notes
  997. in Economics & Math. Systems #392 (Springer-Verlag). 
  998.  
  999. CCP problems are not usually staged, and have a constraint of the
  1000. form Pr( Ax <= b ) >= alpha. The solvability of CCP problems
  1001. depends on the distribution of the data (A &/v b). I don't know of
  1002. any public domain codes for CCP probs., but you can get an idea of
  1003. how to approach the problem by reading Chapter 5 by Prof. A.
  1004. Prekopa (prekopa@cancer.rutgers.edu) Y. Ermoliev, and R. J-B.
  1005. Wets, eds., Numerical Techniques for Stochastic Optimization
  1006. (Series in Comp. Math. 10, Springer-Verlag, 1988). 
  1007.  
  1008. Both Springer Verlag texts mentioned above are good introductory
  1009. references to Stochastic Programming. This list of codes is far
  1010. from comprehensive, but should serve as a good starting point. 
  1011.  
  1012. Q6.13: I need to do post-optimal analysis. 
  1013. -------------------------------------------
  1014.  
  1015. A: Many commercial LP codes have features to do this. Also called
  1016. Ranging or Sensitivity Analysis, it gives information about how
  1017. the coefficients in the problem could change without affecting the
  1018. nature of the solution. Most LP textbooks, such as [Nemhauser],
  1019. describe this. Unfortunately, all this theory applies only to LP. 
  1020.  
  1021. For a MIP model with both integer and continuous variables, you
  1022. could get a limited amount of information by fixing the integer
  1023. variables at their optimal values, re-solving the model as an LP,
  1024. and doing standard post-optimal analyses on the remaining
  1025. continuous variables; but this tells you nothing about the integer
  1026. variables, which presumably are the ones of interest. Another MIP
  1027. approach would be to choose the coefficients of your model that
  1028. are of the most interest, and generate "scenarios" using values
  1029. within a stated range created by a random number generator.
  1030. Perhaps five or ten scenarios would be sufficient; you would solve
  1031. each of them, and by some means compare, contrast, or average the
  1032. answers that are obtained. Noting patterns in the solutions, for
  1033. instance, may give you an idea of what solutions might be most
  1034. stable. A third approach would be to consider a goal-programming
  1035. formulation; perhaps your desire to see post-optimal analysis is an
  1036. indication that some important aspect is missing from your model. 
  1037.  
  1038. Q6.14: Do LP codes require a starting vertex? 
  1039. ----------------------------------------------
  1040.  
  1041. A: No. You just have to give an LP code the constraints and the
  1042. objective function, and it will construct the vertices for you. Most
  1043. codes go through a so-called two phase method, wherein the code
  1044. first looks for a feasible solution, and then works on getting an
  1045. optimal solution. The first phase can begin anywhere, such as with
  1046. all the variables at zero (though commercial codes typically have a
  1047. so-called "crash" algorithm to pick a better starting point). So, no,
  1048. you don't have to give a code a starting point. On the other hand, it
  1049. is not uncommon to do so, because it can speed up the solution time
  1050. tremendously. Commercial codes usually allow you to do this (they
  1051. call it a "basis", though that's a loose usage of a specific linear
  1052. algebra concept); free codes generally don't. You'd normally want
  1053. to bother with a starting basis only when solving families of
  1054. related and difficult LP's (i.e., in some sort of production mode). 
  1055.  
  1056.  
  1057. Q7. "What references are there in this field?" 
  1058. +++++++++++++++++++++++++++++++++++++++++++++++
  1059.  
  1060. A: What follows here is an idiosyncratic list, a few books that I
  1061. like or have been recommended on the net. I have *not* reviewed
  1062. them all. 
  1063.  
  1064. Regarding the common question of the choice of textbook for a
  1065. college LP course, it's difficult to give a blanket answer because of
  1066. the variety of topics that can be emphasized: brief overview of
  1067. algorithms, deeper study of algorithms, theorems and proofs,
  1068. complexity theory, efficient linear algebra, modeling techniques,
  1069. solution analysis, and so on. An small and unscientific poll of
  1070. ORCS-L mailing list readers in 1993 uncovered a consensus that 
  1071. [Chvatal] was in most ways pretty good, at least for an
  1072. algorithmically oriented class. For a class in modeling, a book
  1073. about a commercial code would be useful (LINDO, AMPL, GAMS
  1074. were suggested), especially if the students are going to use such a
  1075. code; and I have always had a fondness for [Williams]. I have
  1076. marked with an arrow ("->") books that received positive mention
  1077. in this poll (I included my own votes too 8v) ). The lack of an
  1078. arrow does not imply anything negative about a textbook, only that
  1079. no one responded to the survey to say they'd used it for a class and
  1080. liked it. 
  1081.  
  1082. General reference 
  1083. ------------------
  1084.  
  1085.  o Nemhauser, Rinnooy Kan, & Todd, eds, Optimization,
  1086.    North-Holland, 1989. (Very broad-reaching, with large
  1087.    bibliography. Good reference; it's the place I tend to look
  1088.    first. Expensive, and tough reading for beginners.) 
  1089.  
  1090. Books containing source code 
  1091. -----------------------------
  1092.  
  1093.  o Best and Ritter, Linear Programming: active set analysis
  1094.    and computer programs, Prentice-Hall, 1985. 
  1095.  o Bertsekas, D.P., Linear Network Optimization: Algorithms
  1096.    and Codes, MIT Press, 1991. 
  1097.  o Bunday and Garside, Linear Programming in Pascal,
  1098.    Edward Arnold Publishers, 1987. 
  1099.  o Bunday, Linear Programming in Basic (presumably the
  1100.    same publisher). 
  1101.  o Burkard and Derigs, Springer Verlag Lecture Notes in
  1102.    Math Systems #184 (the Assignment Problem and others). 
  1103.  o Kennington & Helgason, Algorithms for Network
  1104.    Programming, Wiley, 1980. (A special case of LP; contains
  1105.    Fortran source code.) 
  1106.  o Lau, H.T., A Numerical Library in C for Scientists and
  1107.    Engineers, CRC Press, 1994. (Contains a section on
  1108.    optimization.) 
  1109.  o Martello and Toth, Knapsack Problems: Algorithms and
  1110.    Computer Implementations, Wiley, 1990. (Contains Fortran
  1111.    code, comes with a disk - also covers Assignment
  1112.    Problem.) 
  1113.  o Press, Flannery, Teukolsky & Vetterling, Numerical
  1114.    Recipes, Cambridge, 1986. (Comment: use their LP code
  1115.    with care.) 
  1116.  o Syslo, Deo & Kowalik, Discrete Optimization Algorithms
  1117.    with Pascal Programs, Prentice-Hall (1983). (Contains code
  1118.    for 28 algorithms such as Revised Simplex, MIP, networks.)
  1119.  
  1120. LP textbooks 
  1121. -------------
  1122.  
  1123.  o -> Bazaraa, Jarvis and Sherali. Linear Programming and
  1124.    Network Flows. (Grad level.) 
  1125.  o -> Chvatal, Linear Programming, Freeman, 1983.
  1126.    (Undergrad or grad.) 
  1127.  o -> Daellenbach and Bell, A User's Guide to LP. (Good for
  1128.    engineers, but may be out of print.) 
  1129.  o -> Ecker & Kupferschmid, Introduction to Operations
  1130.    Research. 
  1131.  o Ignizio, J.P. & Cavalier, T.M., Linear Programming,
  1132.    Prentice Hall, 1994. (Covers usual LP topics, plus interior
  1133.    point, multi-objective and heuristic techniques.) 
  1134.  o Luenberger, Introduction to Linear and Nonlinear
  1135.    Programming, Addison Wesley, 1984. (Updated version of
  1136.    an old standby.) 
  1137.  o -> Murtagh, B., Advanced Linear Programming,
  1138.    McGraw-Hill, 1981. (Good one after you've read an
  1139.    introductory text.) 
  1140.  o Murty, K., Linear and Combinatorial Programming. 
  1141.  o Nazareth, J.L., Computer Solution of Linear Programs,
  1142.    Oxford University Press, New York and Oxford, 1987. 
  1143.  o Nering, E.D. & Tucker, A.W., Linear Programs and Related
  1144.    Problems, Academic Press, 1993. 
  1145.  o -> Schrijver, A., Theory of Linear and Integer
  1146.    Programming, Wiley, 1986. (Advanced) 
  1147.  o -> Taha, H., Operations Research: An Introduction, 1987. 
  1148.  o -> Thie, P.R., An Introduction to Linear Programming and
  1149.    Game Theory, Wiley, 1988. 
  1150.  o -> Williams, H.P., Model Building in Mathematical
  1151.    Programming, Wiley 1993, 3rd edition. (Little on
  1152.    algorithms, but excellent for learning what makes a good
  1153.    model.) 
  1154.  
  1155. Interior-Point LP (popularly but imprecisely called "Karmarkar") 
  1156. -----------------------------------------------------------------
  1157.  
  1158.  o Arbel, Ami, Exploring Interior-Point Linear Programming,
  1159.    MIT Press, 1993. Includes small-scale IBM PC software
  1160.    (binary only). 
  1161.  o -> Fang and Puthenpura, Linear Optimization and
  1162.    Extensions. (Grad level textbook, also contains some
  1163.    Simplex and Ellipsoid. I heard mixed opinions on this one.) 
  1164.  o Lustig, Marsten & Shanno, "Interior Point Methods for
  1165.    Linear Programming: Computational State of the Art",
  1166.    ORSA Journal on Computing, Vol. 6, No. 1, Winter 1994,
  1167.    pp. 1-14. Followed by commentary articles, and a rejoinder
  1168.    by the authors. 
  1169.  
  1170. Documentation for commercial codes (may be suitable as a classroom
  1171. text) 
  1172. ------------------------------------------------------------------
  1173.  
  1174.  o Bisschop & Entriken, AIMMS: The Modeling System,
  1175.    Paragon Decision Technology, 1993. 
  1176.  o -> Brooke, Kendrick & Meeraus, GAMS: A Users' Guide,
  1177.    The Scientific Press, 1988. 
  1178.  o -> Fourer, Gay & Kernighan, AMPL: A Modeling
  1179.    Language for Mathematical Programming, The Scientific
  1180.    Press / Boyd & Fraser, 1992. (Comes with DOS "student"
  1181.    version including MINOS and CPLEX.) 
  1182.  o -> Greenberg, H.J., Modeling by Object-Driven Linear
  1183.    Elemental Relations: A User's Guide for MODLER,
  1184.    Kluwer Academic Publishers, 1993. 
  1185.  o -> Schrage, L., LINDO: An Optimization Modeling
  1186.    System, The Scientific Press, 1991. 
  1187.  
  1188. Other publications 
  1189. -------------------
  1190.  
  1191.  o Ahuja, Magnanti & Orlin, Network Flows, Prentice Hall,
  1192.    1993. 
  1193.  o Avis & Fukuda, "A Pivoting Algorithm for Convex Hulls
  1194.    and Vertex Enumeration of Arrangements and Polyhedra",
  1195.    Discrete and Computational Geometry, 8 (1992), 295--313.
  1196.  o Balas, E. and Martin, C., "Pivot And Complement: A
  1197.    Heuristic For 0-1 Programming Problems", Management
  1198.    Science, 1980, Vol 26, pp 86-96. 
  1199.  o Balinski, M.L., "An Algorithm for Finding all Vertices of
  1200.    Convex Polyhedral Sets", SIAM J. 9, 1, 1961. 
  1201.  o Bentley, J.L., "Writing Efficient Programs," Prentice Hall,
  1202.    1982. 
  1203.  o Bondy & Murty, Graph Theory with Applications. 
  1204.  o Edelsbrunner, Algorithms in Combinatorial Geometry,
  1205.    Springer Verlag, 1987. 
  1206.  o Forsythe, Malcolm & Moler, Computer Methods for
  1207.    Mathematical Computations, Prentice-Hall. 
  1208.  o -> Gill, Murray and Wright, Numerical Linear Algebra
  1209.    and Optimization, Addison-Wesley, 1991. 
  1210.  o Greenberg, H.J., A Computer-Assisted Analysis System for
  1211.    Mathematical Programming Models and Solutions: A
  1212.    User's Guide for ANALYZE, Kluwer Academic
  1213.    Publishers, 1993. 
  1214.  o Hwang & Yoon, Multiple Attribute Decision Making :
  1215.    Methods and Applications, Springer-Verlag, Lecture Notes
  1216.    #186. 
  1217.  o Lawler, Lenstra, et al, The Traveling Salesman Problem,
  1218.    Wiley, 1985. 
  1219.  o Mattheis and Rubin, "A Survey and Comparison of
  1220.    Methods for Finding All Vertices of Convex Polyhedral
  1221.    Sets", Mathematics of Operations Research, vol. 5 no. 2
  1222.    1980, pp. 167-185. 
  1223.  o More' & Wright, Optimization Software Guide, SIAM
  1224.    Books, 1993. 
  1225.  o Murty, Network Programming, Prentice Hall, 1992. 
  1226.  o Papadimitriou & Steiglitz, Combinatorial Optimization.
  1227.    (Also contains a discussion of complexity of Simplex
  1228.    method.) 
  1229.  o Reeves, C.R., ed., Modern Heuristic Techniques for
  1230.    Combinatorial Problems, Halsted Press (Wiley), 1993.
  1231.    (Contains chapters on tabu search, simulated annealing,
  1232.    genetic algorithms, neural nets, and Lagrangian relaxation.) 
  1233.  o Seidel, "Constructing Higher-Dimensional Convex Hulls at
  1234.    Logarithmic Cost per Face", 1986, 18th ACM STOC,
  1235.    404--413. 
  1236.  o Smale, Stephen, "On the Average Number of Steps in the
  1237.    Simplex Method of Linear Programming", Math
  1238.    Programming 27 (1983), 241-262. 
  1239.  o Swart, "Finding the Convex Hull Facet by Facet", Journal
  1240.    of Algorithms, 6 (1985), 17--48. 
  1241.  o Volgenant, A., Symmetric TSPs, European Journal of
  1242.    Operations Research, 49 (1990) 153-154. 
  1243.  
  1244. On-Line Papers and Bibliographies 
  1245. ----------------------------------
  1246.  
  1247.  o Computational Mathematics Archive (London and South
  1248.    East Centre for High Performance Computing)
  1249.    http://www.lpac.qmw.ac.uk/SEL-HPC/Articles/GeneratedHtml/math.opt.html
  1250.  o Bibliography of books and survey papers on combinatorial
  1251.    optimization compiled by Brian Borchers
  1252.    (borchers@nmt.edu),
  1253.    ftp://archives.math.utk.edu/teaching.materials/bibliography/comb.opt.
  1254.  o Bibliography of books and papers on Interior-Point
  1255.    methods (taking 4 megabytes storage with over 1300
  1256.    entries!?!) in ftp://netlib2.cs.utk.edu/bib/intbib.bib,
  1257.    compiled by Dr. Eberhard Kranich
  1258.    (puett@math.uni-wuppertal.de). 
  1259.  o An interior point archive has been set up at Argonne, to
  1260.    maintain a list of links to papers that can be downloaded.
  1261.    Use
  1262.    http://www.mcs.anl.gov/home/otc/InteriorPoint/index.html
  1263.    as the URL. Related to this Web page is a mailing list. For
  1264.    information on using it, send mail to
  1265.    majordomo@mcs.anl.gov with one line containing one of: 
  1266.     o subscribe interior-point-methods 
  1267.     o who interior-point-methods 
  1268.     o info interior-point-methods 
  1269.     o help 
  1270.  o Information related to Semidefinite Programming is at
  1271.    ftp://orion.uwaterloo.ca/pub/henry/teaching/co769g/readme.html
  1272.  
  1273.  
  1274. Q8. "How do I access the Netlib server?" 
  1275. +++++++++++++++++++++++++++++++++++++++++
  1276.  
  1277. A: If you have FTP access, you can try "ftp netlib2.cs.utk.edu",
  1278. using "anonymous" as the Name, and your email address as the
  1279. Password. Do a "cd (dir)" where (dir) is whatever directory was
  1280. mentioned, and look around, then do a "get (filename)" on anything
  1281. that seems interesting. There often will be a "README" file,
  1282. which you would want to look at first. Another FTP site is
  1283. netlib.att.com although you will first need to do "cd netlib" before
  1284. you can cd to the (dir) you are interested in. Alternatively, you can
  1285. reach an e-mail server via "netlib@ornl.gov", to which you can
  1286. send a message saying "send index from (dir)"; follow the
  1287. instructions you receive. This is a list of sites mirroring the netlib
  1288. repository: 
  1289.  
  1290.  o Norway netlib@nac.no 
  1291.  o England netlib@ukc.ac.uk 
  1292.  o Germany anonymous@elib.zib-berlin.de 
  1293.  o Taiwan netlib@nchc.edu.tw 
  1294.  o Australia netlib@draci.cs.uow.edu.au 
  1295.  
  1296. For those who have WWW (Mosaic, etc.) access, one can access
  1297. Netlib via the URL http://www.netlib.org. Also, there is, for X
  1298. window users, a utility called xnetlib that is available at
  1299. ftp://netlib2.cs.utk.edu/xnetlib (look at the "readme" file first). 
  1300.  
  1301.  
  1302. Q9. "Who maintains this FAQ list?" 
  1303. +++++++++++++++++++++++++++++++++++
  1304.  
  1305. A>:  John W. Gregory     jwg@cray.com or ashbury@skypoint.com  
  1306.      Applications Dept.  Cray Research, Inc., Eagan, MN 55121  612-683-3673
  1307.  
  1308. This article is Copyright 1995 by John W. Gregory. It may be
  1309. freely redistributed in its entirety provided that this copyright
  1310. notice is not removed. It may not be sold for profit or incorporated
  1311. in commercial documents without the written permission of the
  1312. copyright holder. Permission is expressly granted for this
  1313. document to be made available for file transfer from installations
  1314. offering unrestricted anonymous file transfer on the Internet. 
  1315.  
  1316. The material in this document does not reflect any official position
  1317. taken by Cray Research, Inc. While all information in this article is
  1318. believed to be correct at the time of writing, it is provided "as is"
  1319. with no warranty implied. 
  1320.  
  1321. If you wish to cite this FAQ formally (hey, someone actually asked
  1322. me this), you may use: 
  1323.  
  1324.   Gregory, John W. (jwg@cray.com) "Linear Programming FAQ",
  1325.   (1995) Usenet sci.answers.  Available via anonymous FTP
  1326.   from rtfm.mit.edu in
  1327.   /pub/usenet/sci.answers/linear-programming-faq
  1328.  
  1329. There's a mail server on that machine, so if you don't have FTP
  1330. privileges, you can send an e-mail message to
  1331. mail-server@rtfm.mit.edu containing: 
  1332.  
  1333.     send usenet/sci.answers/linear-programming-faq
  1334.  
  1335. as the body of the message to receive the latest version (it is posted
  1336. on the first working day of each month). This FAQ is cross-posted
  1337. to news.answers and sci.op-research. If you have access to a World
  1338. Wide Web server (Mosaic, Lynx, etc.), you can use 
  1339. ftp://rtfm.mit.edu/pub/usenet/sci.answers/linear-programming-faq.
  1340. ftp://rtfm.mit.edu/pub/usenet/news.answers/linear-programming-faq.
  1341. ftp://rtfm.mit.edu/pub/usenet/sci.op-research/linear-programming-faq.
  1342.  
  1343. In compiling this information, I have drawn on my own knowledge
  1344. of the field, plus information from contributors to Usenet groups
  1345. and the ORCS-L mailing list. I give my thanks to all those who
  1346. have offered advice and support. I've tried to keep my own biases
  1347. (primarily, toward the high end of computing) from dominating
  1348. what I write here, and other viewpoints that I've missed are
  1349. welcome. Suggestions, corrections, topics you'd like to see
  1350. covered, and additional material, are all solicited. Send email to 
  1351. jwg@cray.com 
  1352.  
  1353.  
  1354. END linear-programming-faq 
  1355.