CSE 190 - Using AMPL and LP solver packages to solve LP problemsAMPLAMPL stands for "A Mathematical Programming Language". It is a language for modeling various kinds of mathematical and computational problems in an easy and compact way. You can check out the AMPL website and the wiki page to get more information on AMPL.In this tutorial, we will learn to convert our LP problem formulations to AMPL format and use an LP solver to solve them. Basic AMPL ExampleWe will show a simple example that would serve as a guide to convert programs to AMPL
This program will convert to the following AMPL program
The converted program is surprisingly clear. Here are the key points of the translation
This simple example will help you get most of the problems formulated into AMPL. For more advanced problems you can consult Section 4 and 5 of this tutorial http://www.columbia.edu/~dano/courses/4600/lectures/6/AMPLTutorialV2.pdf. There are a number of other AMPL tutorials available on the net too. LP Solver PackageAMPL by itself will not do anything. To actually solve the problem, you have to use an LP solver. A solver is a program that can take a problem specified in AMPL format and produce solutions. AMPL supports a large number of LP solvers, however, by default it uses the MINOS solver. It is also supported by Windows, Linux and Mac.Another LP solver is BPMPD. It can be found at http://www.neos-server.org/neos/solvers/lp:bpmpd/AMPL.html. For this course, we will stick to BPMPD as the default LP solver package. Finding SolutionsNow that you have your model file, there are two options to actually solve your LP formulation. You can download AMPL and MINOS for your system from the downloads section of AMPL website.Alternatively, you can submit your problem formatted in AMPL data format to http://www.ampl.com/TRYAMPL/startup.html. You will need to upload your model file (and optionally a data file) and specify the commands to get solution information on the next page. For using the BPMPD solver, you can upload your model file at http://www.neos-server.org/neos/solvers/lp:bpmpd/AMPL.html Setting up the Standalone AMPL programYou will need the AMPL and MINOS program from the downloads section of the AMPL website. Get the version for your operation system. On Windows, these are standalone executable files. You need to put both of these executable in the same directory. We will refer to the standalone executable version of AMPL as ampl.Once you have AMPL on your machine, the following commands will be useful.
|