[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] loop for for mathprog
From: |
Gabor Retvari |
Subject: |
Re: [Help-glpk] loop for for mathprog |
Date: |
Wed, 15 Nov 2006 18:15:54 +0100 |
User-agent: |
KMail/1.9.3 |
On Tuesday 14 November 2006 20:26, Andrew Makhorin wrote:
> > In my optimization work, I almost always use the
> > API of a solver instead of a modeling language.
> > The reason is that I usually want to solve another
> > problem related to the first and its solution.
> > Absent a reliable mechanism for converting variable
> > names to variable indices this can be difficult.
> > Being able to do the following from within code would be a good thing:
> > read a problem specified in a modeling language
> > solve problem
> > update problem
> > solve problem
> > rinse and repeat as necessary
> > print solution in convenient form.
> >
> > Being able to convert names to indices would facilitate
> > the update problem and print solution steps.
>
> I encountered a similar problem, however, I cannot formalize that.
> Looks like there must be another, more complicated API level, which
> provides a more convenient indexing mechanism to access the
> variables and constraints.
well, this was exactly the reason why I implemented the Math::GLPK module for
Perl, which makes it possible to create, solve, analyze, manipulate and
reoptimize LP instances from within Perl scripts with remarkable simplicity:
http://qosip.tmit.bme.hu/~retvari/Math-GLPK.html
using Perl I was able to avoid having to use the cumbersome C API, but still
was able to go well beyond the capabilities of contemporary MathProg. e.g.,
it takes some 10 lines of Perl code to implement a simple script to perform
sensitivity analysis, and I also have a complete column generation framework
written entirely in Perl lurking around somewhere... and if you are not fond
of Perl, I am sure that you can easily find Python or MATLAB bindings out
there.
quite frankly, using Perl skyrocketed my productivity. give Math::GLPK a try,
and I promise you won't regret...
best regards,
Gabor