Glop fails to solve some problems

299 views
Skip to first unread message

Akio Takano

unread,
Mar 10, 2015, 1:30:19 AM3/10/15
to or-tools...@googlegroups.com
Hi,

I've found that glop fails to solve some problems that Clp can solve, returning ABNORMAL. Is this a bug, a known limitation or am I using it in the wrong way?

I've attached a C++ program that demonstrates the issue. To try it, compile lin.cxx and run it, piping lin.input to stdin.
lin.cxx
lin.input

Bruno De Backer

unread,
Mar 10, 2015, 6:47:19 AM3/10/15
to or-tools...@googlegroups.com
Hi,
The coefficients in the problem have a very high dynamic range: some coefficients have a magnitude of 1E-8 while some others have a magnitude of 1E4. Even after scaling, Glop does not manage to reduce the dynamic range enough, and in the ends it returns a solution that is IMPRECISE. In that respect, Glop is more accurate than most other solvers, because it tells when it is not sure about a solution. 

Still, the result status is not converted properly in MPSolver, and MPSolver returns ABNORMAL when Glop gives IMPRECISE.

We will work to correct this issue. In the meantime, you may want to change the scale of the matrix, by changing the units of some variables. A variable x where coefficients 1e-8 appear would be replaced by a variable y = 1e-8 *x, and all the coefficients would be multiplied by 1e8. 

Finally, a simple tip to spare you the time of writing C++ code that enables to reproduce a problem, you can export any model that you create as a protobuf, that
can then be solved using solve.cc in example by using the following code snippet: 


#include "linear_solver/linear_solver2.pb.h"

#include "util/proto_tools.h"


new_proto::MPModelProto exported_model;

solver.ExportModelToNewProto(&exported_model);

WriteProtoToFile("/tmp/lin.pb.txt", exported_model, false, false);


I'm including the file generated with your example.

Cheers,

BdB





--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
BdB
lin.pb.txt

Akio Takano

unread,
Mar 11, 2015, 8:18:37 PM3/11/15
to or-tools...@googlegroups.com
Hi Bruno,


On Tuesday, March 10, 2015 at 7:47:19 PM UTC+9, Bruno De Backer wrote:
Hi,
The coefficients in the problem have a very high dynamic range: some coefficients have a magnitude of 1E-8 while some others have a magnitude of 1E4. Even after scaling, Glop does not manage to reduce the dynamic range enough, and in the ends it returns a solution that is IMPRECISE. In that respect, Glop is more accurate than most other solvers, because it tells when it is not sure about a solution. 

Still, the result status is not converted properly in MPSolver, and MPSolver returns ABNORMAL when Glop gives IMPRECISE.

I see, thank you for your explanation.
 

We will work to correct this issue. In the meantime, you may want to change the scale of the matrix, by changing the units of some variables. A variable x where coefficients 1e-8 appear would be replaced by a variable y = 1e-8 *x, and all the coefficients would be multiplied by 1e8. 

This doesn't seem to work well in my case, because many variables simultaneously have large and small coefficients.

However, simply replacing these small coefficients with 0s seems to help. In my problems this doesn't affect the final outcome much (I'm only interested in the optimal value, not a full solution).


Finally, a simple tip to spare you the time of writing C++ code that enables to reproduce a problem, you can export any model that you create as a protobuf, that
can then be solved using solve.cc in example by using the following code snippet: 

This is good to know. Thanks for the tip!

Thank you,
Takano Akio
Reply all
Reply to author
Forward
0 new messages