GAMS/CPLEX: big M, indicator variable problem

Hello GAMS pro’s!

I am currently working on a model which includes a big M notation (–> big M is variable, based on input parameters).
I faced the problem, that some instances were not able to solve (infeasible/unbounded), but I know the model is right.
So I found out that GAMS/CPLEX sometimes cannot handle big M formulations appropriately. The models then solved when I adapted big M manually. But it needs to work automated, as I want to solve several instances.

I tried indicator variables, as described in http://www.gams.com/solvers/cpxindic.htm.

Now the problem:
my constraint reads like follows: constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))

So I first reformulated it as x(t,i) =e= sum((i), z(t,h,i)) with the following in the option file: indic constraint5(t,i)$z(t,h,j) 0 which gave the error “uncontroled set for h”. The reformulation indic constraint5(t,i)$sum((h), z(t,h,i) 0 also delivered an error. I guess the summation is not possible in the indicator file.

So I tried to circumvent that by introducing an additional variable and constraint, which assignes “h(t,i)” the value of “sum((i), z(t,h,i))”

Rewriting the constraint then as x(t,i) =e= h(t,i) with the following in the option file: indic constraint5(t,i)$h(t,i) 0 provides me with the system error “gmsgennx.exe has encountered a problem and needs to close. We are sorry for the inconvenience”

Can anyone help on that?

Thanks a lot!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Nobody with an idea?

Am Donnerstag, 7. Februar 2013 14:49:46 UTC+1 schrieb JapanGo:

Hello GAMS pro’s!

I am currently working on a model which includes a big M notation (–> big M is variable, based on input parameters).
I faced the problem, that some instances were not able to solve (infeasible/unbounded), but I know the model is right.
So I found out that GAMS/CPLEX sometimes cannot handle big M formulations appropriately. The models then solved when I adapted big M manually. But it needs to work automated, as I want to solve several instances.

I tried indicator variables, as described in http://www.gams.com/solvers/cpxindic.htm.

Now the problem:
my constraint reads like follows: constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))

So I first reformulated it as x(t,i) =e= sum((i), z(t,h,i)) with the following in the option file: indic constraint5(t,i)$z(t,h,j) 0 which gave the error “uncontroled set for h”. The reformulation indic constraint5(t,i)$sum((h), z(t,h,i) 0 also delivered an error. I guess the summation is not possible in the indicator file.

So I tried to circumvent that by introducing an additional variable and constraint, which assignes “h(t,i)” the value of “sum((i), z(t,h,i))”

Rewriting the constraint then as x(t,i) =e= h(t,i) with the following in the option file: indic constraint5(t,i)$h(t,i) 0 provides me with the system error “gmsgennx.exe has encountered a problem and needs to close. We are sorry for the inconvenience”

Can anyone help on that?

Thanks a lot!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Dear JapanGo,

Well, yes, I do. (Though I wouldn’t consider myself a GAMS-pro, with approx. 4 months’ experience.)
Thanks for sharing that webpage, which I had no knowledge of, so I’d really like to thank you for that information!
The problem is the syntax: yet you were so close. Your binary variable is x(t,i) and not z(t,h,i). (Or at least, that’s how bigM parameters are usually used, if your binary variable is somehow z(t,h,i) the syntax error is similar)

Let me thankfully repeat your basic constraint:
constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))
now, with the correct syntax, according to the site:
c5(t,i) … sum(h,z(t,h,i))=e=0

and in the optfile you put:
indic c5(i,t)$x(t,i) 0

I hope I helped you out, if not, please share with us some details on your formulation and/or try multiple ways as described in your reference.

Kind regards,

Henry Vermue

On Monday, February 18, 2013 3:45:45 PM UTC+1, JapanGo wrote:

Nobody with an idea?

Am Donnerstag, 7. Februar 2013 14:49:46 UTC+1 schrieb JapanGo:

Hello GAMS pro’s!

I am currently working on a model which includes a big M notation (–> big M is variable, based on input parameters).
I faced the problem, that some instances were not able to solve (infeasible/unbounded), but I know the model is right.
So I found out that GAMS/CPLEX sometimes cannot handle big M formulations appropriately. The models then solved when I adapted big M manually. But it needs to work automated, as I want to solve several instances.

I tried indicator variables, as described in http://www.gams.com/solvers/cpxindic.htm.

Now the problem:
my constraint reads like follows: constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))

So I first reformulated it as x(t,i) =e= sum((i), z(t,h,i)) with the following in the option file: indic constraint5(t,i)$z(t,h,j) 0 which gave the error “uncontroled set for h”. The reformulation indic constraint5(t,i)$sum((h), z(t,h,i) 0 also delivered an error. I guess the summation is not possible in the indicator file.

So I tried to circumvent that by introducing an additional variable and constraint, which assignes “h(t,i)” the value of “sum((i), z(t,h,i))”

Rewriting the constraint then as x(t,i) =e= h(t,i) with the following in the option file: indic constraint5(t,i)$h(t,i) 0 provides me with the system error “gmsgennx.exe has encountered a problem and needs to close. We are sorry for the inconvenience”

Can anyone help on that?

Thanks a lot!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Henry, glad I could help you.
Thanks for your help also.

I had a mistake in my thinking: variable z is determing x, so I thought I have to modle it the way I modeled it.
But for the solve process it does not matter, the solution has to be feasible, no matter which way round.
Using the binary variable x in the option file worked.

Thanks!

Am Montag, 18. Februar 2013 16:19:43 UTC+1 schrieb Henry JW Vermue:

Dear JapanGo,

Well, yes, I do. (Though I wouldn’t consider myself a GAMS-pro, with approx. 4 months’ experience.)
Thanks for sharing that webpage, which I had no knowledge of, so I’d really like to thank you for that information!
The problem is the syntax: yet you were so close. Your binary variable is x(t,i) and not z(t,h,i). (Or at least, that’s how bigM parameters are usually used, if your binary variable is somehow z(t,h,i) the syntax error is similar)

Let me thankfully repeat your basic constraint:
constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))
now, with the correct syntax, according to the site:
c5(t,i) … sum(h,z(t,h,i))=e=0

and in the optfile you put:
indic c5(i,t)$x(t,i) 0

I hope I helped you out, if not, please share with us some details on your formulation and/or try multiple ways as described in your reference.

Kind regards,

Henry Vermue

On Monday, February 18, 2013 3:45:45 PM UTC+1, JapanGo wrote:

Nobody with an idea?

Am Donnerstag, 7. Februar 2013 14:49:46 UTC+1 schrieb JapanGo:

Hello GAMS pro’s!

I am currently working on a model which includes a big M notation (–> big M is variable, based on input parameters).
I faced the problem, that some instances were not able to solve (infeasible/unbounded), but I know the model is right.
So I found out that GAMS/CPLEX sometimes cannot handle big M formulations appropriately. The models then solved when I adapted big M manually. But it needs to work automated, as I want to solve several instances.

I tried indicator variables, as described in http://www.gams.com/solvers/cpxindic.htm.

Now the problem:
my constraint reads like follows: constraint5(t,i)… x(t,i)*bigM =g= sum(h, z(t,h,i))

So I first reformulated it as x(t,i) =e= sum((i), z(t,h,i)) with the following in the option file: indic constraint5(t,i)$z(t,h,j) 0 which gave the error “uncontroled set for h”. The reformulation indic constraint5(t,i)$sum((h), z(t,h,i) 0 also delivered an error. I guess the summation is not possible in the indicator file.

So I tried to circumvent that by introducing an additional variable and constraint, which assignes “h(t,i)” the value of “sum((i), z(t,h,i))”

Rewriting the constraint then as x(t,i) =e= h(t,i) with the following in the option file: indic constraint5(t,i)$h(t,i) 0 provides me with the system error “gmsgennx.exe has encountered a problem and needs to close. We are sorry for the inconvenience”

Can anyone help on that?

Thanks a lot!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\