Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Relaxing Integer Variables/ Parameters

27 views
Skip to first unread message

Matts Davids

unread,
Nov 20, 2024, 10:17:52 AM11/20/24
to am...@googlegroups.com
Hello team,

I am trying to solve a problem that includes a set of integer parameters. Is there a way to relax the integer parameter and make it a continuous parameter? May you suggest how I can write that in the script?

For now I have them define such as:
#in the model script I have:

param C_Max:= 6;

param R_Max := 3;


param c integer in 1..C_Max;

param r integer in 1..R_Max;


#in the run script I have:

param value {2..C_Max, 1..R_Max};

param bestobj default -Infinity;

param best_c;

param best_r;

suffix bestbound OUT;


for {cval in 2..C_Max, rval in 1..R_Max} {

let c := cval;

let r := rval;


option gurobi_options 'nonconvex=2 bestbound=1 nodelim=1';

solve;


if obj.bestbound > bestobj then {


option gurobi_options 'nonconvex=2';

solve;


if obj > bestobj then {

display cval, rval, obj;

let value[cval,rval] := obj;

let bestobj := obj;

let best_c := c;

let best_r := r;

}

}

}


display value;


I hope to hear from you soon.


Best regards,

Davids

AMPL Google Group

unread,
Nov 21, 2024, 12:51:35 PM11/21/24
to AMPL Modeling Language
Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25063-relaxing-integer-variables-parameters/1984/2

To reply, click the red "Reply" button that follows the response. (Do not send an email reply to this message.)


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2768918479-130496#}
--
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 ampl+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ampl/CAGnfZd64msZNKpgy-8bUz5NGm%2B5xmv-nOzaWhHY2J1qHJw3nSw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages