Sunday, March 6, 2011

AMPL update

1.  AMPL Solver Library
     www.netlib.org/ampl/solvers.tar

2. AMPL FILE FORMAT

 If it would help to take a look at a solver output file, give a command like
"write gTEST;" before "solve;". Then a text version of the output file will
be written to TEST.sol. (Normally this ".sol" file is deleted after AMPL
reads its contents, but the "write" command causes it to be saved.)

3. piecewise linear for minimizing concave
Minimizing a concave piecewise linear function can be done using
binary variables.  Perhaps the second half of
http://orinanobworld.blogspot.com/2010/10/piecewise-linear-functions-in-math.html
(dealing with economies of scale) will shed some light.  If your
piecewise linear function is discontinuous, see
http://orinanobworld.blogspot.com/2010/12/modeling-all-units-discount.html.

4. variable relaxation in AMPL

You can use the ".relax" suffix documented in the AMPL book (section 11.4
under "Relaxing integrality"):
   var anr {i in 1..m} integer >= nrmin[i] <= nrmax[i];
   let {i in 2..m} anr[i].relax := 1;
Note that you can relax an integer variable but you can't "unrelax" a
variable that hasn't been declared as integer (or binary).
One refinement not mentioned in the book is that if you set .relax of a
variable to 2, then the variable will be treated as integer by AMPL's
presolve phase, after which it will be sent as a relaxed variable to the
solver.



No comments:

Post a Comment