Originally posted by: MatteoDenitto
Hi all,
i'm new here and i hope this is the right place to post my question.
I'm using Cplex to solve differents LP problems. Those problems differ only for the objective function they have to maximize, all the constraints in all the problems are the same. Due to this i thought to create a .lp file to load in order to speed up the resolution time. In few words my routine is:
if not exist the .lp file{
create .lp file
}
else {
load .lp file
update the objective function
}
solve the model
The first time, when the model is created, the solver works well and all constraints are respected. But when i load and try to solve it, some constraints are broken.
So i tried this:
-
create a model
-
solve it
-
write it
-
load it
-
rewrite it
-
solve it
the solutions were different, in the loaded one some constraints were not respected. I watched the .lp file with a text editor and i noticed that in some constraints the order of the variables that partecipate in it were switched, keeping inalterate the sense of the constraint. An example: if the const the 1st time is A+B-C < 10 when i rewrite it the constraints became -C+A+B < 10.
Has anyone solved this issue before? How can i face this situation?
Thanks.
p.s.
i used Cplex in Matlab on windows 7. To write and load the model i used the writeModel() and loadModel() routines provided by Cplex.
#CPLEXOptimizers#DecisionOptimization