[FlopCpp] Problem using FlopC++ with GLPK

Tim Hultberg Tim.Hultberg at eumetsat.int
Sun Sep 27 03:30:16 EDT 2009


Hi Michal,
   you are (at least partially) wrong. Flopc++ does have a feature (addRow) to facilitate in the update&resolve situation. 

MP_model::addRow lets you specify a row using the flopc++ model which will then generate and add a row to the Osi model. An example of this is in stochbenders.cpp. 

In cuttingStock.cpp, on the contrary, columns are added directly using the underlying Osi object similarly to what you describe.

Cheers, Tim 

PS One more thing: Flopc++'s own data structures are abstract syntax trees representing the model (not a particular problem intance), so when you do an attach/minimize/maximize the (problem instance) data are not only written to the Osi object, but first they are generated from the symbolic model and the MP_data.

==================================================>
- Finally, one general FlopC++ comment: as far as I understand it, Flop
has its own data structures and writes data into the Osi object first
when asked to (using attach() or minimize() or maximize()).
This becomes important if you want to change the model after it has been
attached to the solver (a typical case would be change something and
resolve): you would be changing the Flop object, not the Osi object! And
the only way to solve this updated Flop model would be to create a new
Osi and solve it, losing all the advantages of fast resolve. [Tim, if
you read this and I am wrong, please correct me - I would love to be
wrong here..]
Anyway, the way I work with Flop is as follows: I write the model in
Flop and attach() it to the Osi. If I then want to change something, I
would change it in the Osi directly - but I would still be using Flop to
get me the indices of the variables and constraints I would be changing.
For example, if I want to change obj. coefficient of variable x(4), I
would use Flop to give me the index of the variable in the Osi object
and then use the Osi method to change the given obj. coeff. Very easy
(really!).
In other words, Flop is very useful also in the update&resolve
situation, one just has to remember to change the Osi model, not the
Flop model...




More information about the FlopCpp mailing list