The University of York

[Photo]Matt Probert

Address: Department of Physics, University of York, Heslington, York YO10 5DD, U.K.
Office: Room P/A021, Department of Physics
Telephone: (+44) (0)1904 432239 (Departmental secretary 432201)
Fax: (+44) (0)1904 432214
E-mail: mijp1@york.ac.uk
Main home page (this page): http://www-users.york.ac.uk/~mijp1/
Standard staff page: http://www.york.ac.uk/physics/people/academic/probert


1st Year Mathematical Modelling - Linear Programming

For MS Windows users, there is a free time-limited trial download of a useful tool for solving linear programming problems available from Lindo.com.

A different freely available tool that is released under the LGPL and hence is not restricted is lp_solve. The latest version is freely available here although you will need to sign up to Yahoo groups first (which is a short and cost-free exercise). The version mirrored here is the somewhat older v3.1a (December 2000) whilst the current version includes executables for MS Windows. I have included a simple DOS executable, some example programs and the full source tarball for those that want to build it themselves on any operating system of their choice.

Note that this version of the program is a "command line" program, i.e. there is no fancy GUI. In order to use the program, you need to tell it what calculation to do by creating a suitable input file. Several example input files are included below: note that the syntax is crucial, so when creating your own input files it is VERY IMPORTANT to obey the rules (e.g. placing of spaces, colons, commas and semicolons) exactly!

To use this program you must first download it, along with the example inputs files, into your own filespace (e.g. right-click and select "Save Target As" or similar). If you are running a Windows OS, you then need to open up a command prompt (e.g. Start/Programs/Accessories/Command Prompt or similar). Once in DOS, you need to change to whichever directory(folder) you saved the target in, and then execute from there. Note that the program takes its input from "standard input", so if you want it to read from a file you need to redirect standard input. To do this, if you have both the executable and the required input file in the current directory, you just need to type:

lp_solve < ex1.lp

and the results will be written to the screen.


 
 

If you have any helpful comments or suggestions to make, then they may be mailed to me here.Last updated: 07/11/2007.