[AMPL 18339] MIP gap in Gurobi

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 18339] MIP gap in Gurobi

Timo S.
Hi,

I'm solving a problem several times in a for loop with Gurobi 8.1.0 and with different parameters and a time limit for each solve command. Now i want to know the absolute and relative MIP-gap. I followed the instructions here https://groups.google.com/forum/#!topic/gurobi/tCtJDfC6AhA
Could it be that it is not possible to use display cost.bestbound; in a for loop? I get a 'Bad suffix .bestbound for cost' right at the beginning when i try to run my .run file.
Without the for loop (running the problem only once) it works. Is there any workaround for it?

Thanks for your help.

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 18344] MIP gap in Gurobi

AMPL mailing list
To reference a suffix within a loop, you may need to define the suffix before the loop starts. In your case you would put the command

suffix bestbound OUT;

toward the beginning of your script, before the start of your loop.

(To be precise, Gurobi tells AMPL to define suffix .bestbound if it's not already defined; when this happens you see "suffix bestbound OUT;" after the solve. However, AMPL scans the entire contents of the loop before starting to execute it. So if your script executes its first "solve" after the loop has started, then when AMPL scans the loop it will encounter .bestbound before the solve has had a chance to define that suffix. In that case your script must explicitly define .bestbound before the loop starts.)

--
Robert Fourer
[hidden email]
{#HS:795277245-37912#}
On Wed, Mar 6, 2019 at 5:19 PM UTC, Ampl Modeling Language <[hidden email]> wrote:
Hi,

I'm solving a problem several times in a for loop with Gurobi 8.1.0 and with different parameters and a time limit for each solve command. Now i want to know the absolute and relative MIP-gap. I followed the instructions here https://groups.google.com/forum/#!topic/gurobi/tCtJDfC6AhA
Could it be that it is not possible to use display cost.bestbound; in a for loop? I get a 'Bad suffix .bestbound for cost' right at the beginning when i try to run my .run file.
Without the for loop (running the problem only once) it works. Is there any workaround for it?

Thanks for your help.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.