Skip to main content

## Comments

4 comments

• Gurobi Staff

Just to make sure I understand it correctly: you get these very strange values like 1e+69 or 1e-310 in the model, even though you never added those coefficients in your Python program?

My guess is that something in your program is wrong. You could debug the situation by writing out the MPS file after every single Python command that adds something to the model. Then, you can probably identify the model modification code that introduces those bogus coefficients.

Regards,

Tobias

Dear Tobias

Thanks for your prompt reply. Yes, these coefficients are not added in our Python program. The decision variables named d are just added with the command m.addVars(group_ids, clique_ids, dialog_ids, name='d'). They should have a coefficient of zero in the objective function.

I ran the program 200 times on my Windows machine and every time the coefficients are zero (see extract from the LP file below). I thus believe that the Python program is ok. The very large coefficients only occur (sometimes) when we run the exact same code on a Linux machine. Would you recommend to set the coefficients of zero explicitly when we generate the objective function as a linear expression?

Here is the extract from the LP file we obtain in every run on the Windows machine

+ 0 d[1224,2,0] + 0 d[1224,3,0] + 0 d[1224,4,0] + 0 d[1225,1,0]

+ 0 d[1225,2,0] + 0 d[1225,3,0] + 0 d[1225,4,0] + 0 d[1226,1,0]

+ 0 d[1226,2,0] + 0 d[1226,3,0] + 0 d[1226,4,0] + 0 d[1227,1,0]

+ 0 d[1227,2,0] + 0 d[1227,3,0] + 0 d[1227,4,0] + 0 d[1228,1,0]

+ 0 d[1228,2,0] + 0 d[1228,3,0] + 0 d[1228,4,0] + 0 d[1229,1,0]

+ 0 d[1229,2,0] + 0 d[1229,3,0] + 0 d[1229,4,0] + 0 d[1230,1,0]

+ 0 d[1230,2,0] + 0 d[1230,3,0] + 0 d[1230,4,0] + 0 d[1231,1,0]

+ 0 d[1231,2,0] + 0 d[1231,3,0] + 0 d[1231,4,0]

Subject To

• Gurobi Staff

This is really strange and seems to point to a bug, either in your code or in ours. Would it be possible to send me the Python code that produces this issue? Ideally, you would first simplify and reduce the Python code as much as possible to get a minimal size example that still shows the weird behavior.

Regards,

Tobias

Unfortunately, the code is confidential. But I will try to create a toy example that produces the same issue. Meanwhile, we will set the coefficients of all decision variables explicitly and see if the issue can be resolved in this way.

Thanks for your help!

Kind regards

Philipp

Please sign in to leave a comment.