0

I wrote a model in gams but it's infeasible. I suspect to this constraint, I think I didn't write it truly:

image

In my model:

c6(i,e)$(ord(e)<>0).. sum(f$(ord(f)<=ord(e)-1),z(i,f))=l=ord(e)*(1-(z(i,e)-z(i,e-1)));
i, e are sets
alias(e,f);
binary variable z(i,e);

Do you know how to write such summations in GAMS?

Serj-Tm
  • 16,581
  • 4
  • 54
  • 61
Omid
  • 1
  • 1
  • 2
  • Your constraint seems to be OK. I have run it with objective `obj.. x =e= sum((i,e), z(i,e));` and it was feasible. You can try to delete all your constraints and start adding them back one-by-one, to see which one first causes the infeasibility. One observation aside: The `ord()` function is 1-based in GAMS ([see guide](http://www.gams.com/mccarl/mccarlhtml/element_position_ord_and_card.htm)) - it might make difference in your condition `c6(i,e)$(ord(e)<>0)` - when I compare it to your TeX equation. – Honza Osobne May 24 '15 at 14:30
  • Thank you, @HonzaOsobne . I've added constraints one-by-one but it became infeasible by adding c6 (which I was written above). I wrote from a valid article. Maybe the conditions in the summation isn't same with the formula. I've omitted `$(ord(e)<>0)` but the problem haven't been solved. – Omid May 24 '15 at 21:07
  • ok ... can you try to add them in different order, e.g. starting from c6? It seems like a combination of two equations might be causing the infeasibility. I suspect when c6 is added as first, the problem will be feasible, but it will become infeasible later (when one of the other equations is added). You can also try to post your full model. – Honza Osobne May 24 '15 at 22:08

1 Answers1

0
C(i,e)(ord(e)<>1) .. sum(ep$(ord(ep) <= ord(e)-1),z(i,ep))

This code is true and if your model status is 4infeasible, maybe it's better to revise the data structure.

Because it's MIP model maybe model status is integer infeasible. Try to solve it using Relaxed-MIP, RMIP mode.

Aryaei
  • 1
  • 3