inventory management problem

Hi guys,

I’m currently having a problem getting my model to work as an integer problem, if I remove the integer constraint I get a feasible solution, but with the constraint I do not. I hope this is the right place to ask such a question.

This is the GAMS code I have problems with:

  • OM.gms

$eolcom //
option iterlim=999999999; // avoid limit on iterations
option reslim=300; // timelimit for solver in sec.
option optcr=0.0; // gap tolerance
option solprint=ON; // include solution print in .lst file
option limrow=100; // limit number of rows in .lst file
option limcol=100; // limit number of columns in .lst file
//--------------------------------------------------------------------

Sets

t ‘months’ /January, February, March, April, May, June, July, August, September, October, November, December/
;

Parameters
D(t) ‘Shipment forecast for month t’
/ January 4400
February 4400
March 6000
April 8000
May 6600
June 11800
July 13000
August 11200
September 10800
October 7600
November 6000
December 5600 /

I_0(t) ‘initial inventory’ /January 240/
W_0(t) ‘initial workers’ /January 160/

Hc ‘Hiring cost’ /1800/
Lc ‘Lay off cost’ /1200/
holding ‘holding cost’ /8/
regular ‘regular salary’ /2400/
overtime ‘overtime salary /3300/

;


Variables

Q(t) ‘Production Plan for month t’
I(t) ‘Inventory in month t’
W(t) ‘Workers in month t’
O(t) ‘Overtime workers in month t’
Ht(t) ‘people hired in month t’
Lt(t) ‘People laid off in month t’
Z ’Total cost’
;

Integer Variables Q, Ht, Lt, O, W, I;

Q.Lo(t) = 0;
W.Lo(t) = 0;
I.Lo(t) = 0;
O.Lo(t) = 0;
Lt.Lo(t) = 0;
Ht.Lo(t) = 0;



equations

cost ‘objective’
inventory_balance ‘Inventory Control’
capacity ‘maximum production capacity per month’
worker_balance ‘hiring and laying off’
linear ‘linear function combining production and workers’
;

cost … Z =e= sum(t, I(t)holding + O(t) * overtime + HcHt(t) + LcLt(t) + regularW(t));
inventory_balance(t) … I(t) =e= I(t-1) + Q(t) - D(t) + I_0(t);
capacity(t) … Q(t) =l= 13000;
worker_balance(t) … W(t) =e= W(t-1) + Ht(t) - Lt(t) + W_0(t);
linear(t) … Q(t) =e= 40*(W(t) + O(t));


Model OM /all/ ;

Solve OM using mip minimizing Z ;

// now write solution (this will show up in the bottom of the program)

// the objective (optimization solution):
DISPLAY Z.L;

// the variables which form the solution:
DISPLAY Q.L;
DISPLAY I.L;
DISPLAY W.L;
DISPLAY O.L;
DISPLAY Ht.L;
DISPLAY Lt.L;


and I get the following terminal output:

Reading data…
Starting Cplex…
Row ‘inventory_balance(January)’ infeasible, all entries at implied bounds.
Presolve time = 0.00 sec.
MIP status(119): integer infeasible or unbounded
CPLEX Error 1217: No solution exists.
Problem is integer infeasible.
— Restarting execution
— OM.gms(84) 2 Mb
— Reading solution for model OM
— OM.gms(97) 3 Mb
*** Status: Normal completion
— Job OM.gms Stop 10/25/13 00:11:28 elapsed 0:00:00.069


I hope someone can help me,

sincerely

David


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.
For more options, visit https://groups.google.com/groups/opt_out.

David it could be because gams sets a upper limit of 100 on int variables by default. You can over ride this by setting

W.up(t)= (a high number);

Or setting an execution option in the gams ide option tab as shown below.

Pf4=0
On Oct 25, 2013 2:01 AM, “David Carlsen” wrote:

Hi guys,

I’m currently having a problem getting my model to work as an integer problem, if I remove the integer constraint I get a feasible solution, but with the constraint I do not. I hope this is the right place to ask such a question.

This is the GAMS code I have problems with:

  • OM.gms

$eolcom //
option iterlim=999999999; // avoid limit on iterations
option reslim=300; // timelimit for solver in sec.
option optcr=0.0; // gap tolerance
option solprint=ON; // include solution print in .lst file
option limrow=100; // limit number of rows in .lst file
option limcol=100; // limit number of columns in .lst file
//--------------------------------------------------------------------

Sets

t ‘months’ /January, February, March, April, May, June, July, August, September, October, November, December/
;

Parameters
D(t) ‘Shipment forecast for month t’
/ January 4400
February 4400
March 6000
April 8000
May 6600
June 11800
July 13000
August 11200
September 10800
October 7600
November 6000
December 5600 /

I_0(t) ‘initial inventory’ /January 240/
W_0(t) ‘initial workers’ /January 160/

Hc ‘Hiring cost’ /1800/
Lc ‘Lay off cost’ /1200/
holding ‘holding cost’ /8/
regular ‘regular salary’ /2400/
overtime ‘overtime salary /3300/

;


Variables

Q(t) ‘Production Plan for month t’
I(t) ‘Inventory in month t’
W(t) ‘Workers in month t’
O(t) ‘Overtime workers in month t’
Ht(t) ‘people hired in month t’
Lt(t) ‘People laid off in month t’
Z ’Total cost’
;

Integer Variables Q, Ht, Lt, O, W, I;

Q.Lo(t) = 0;
W.Lo(t) = 0;
I.Lo(t) = 0;
O.Lo(t) = 0;
Lt.Lo(t) = 0;
Ht.Lo(t) = 0;



equations

cost ‘objective’
inventory_balance ‘Inventory Control’
capacity ‘maximum production capacity per month’
worker_balance ‘hiring and laying off’
linear ‘linear function combining production and workers’
;

cost … Z =e= sum(t, I(t)holding + O(t) * overtime + HcHt(t) + LcLt(t) + regularW(t));
inventory_balance(t) … I(t) =e= I(t-1) + Q(t) - D(t) + I_0(t);
capacity(t) … Q(t) =l= 13000;
worker_balance(t) … W(t) =e= W(t-1) + Ht(t) - Lt(t) + W_0(t);
linear(t) … Q(t) =e= 40*(W(t) + O(t));


Model OM /all/ ;

Solve OM using mip minimizing Z ;

// now write solution (this will show up in the bottom of the program)

// the objective (optimization solution):
DISPLAY Z.L;

// the variables which form the solution:
DISPLAY Q.L;
DISPLAY I.L;
DISPLAY W.L;
DISPLAY O.L;
DISPLAY Ht.L;
DISPLAY Lt.L;


and I get the following terminal output:

Reading data…
Starting Cplex…
Row ‘inventory_balance(January)’ infeasible, all entries at implied bounds.
Presolve time = 0.00 sec.
MIP status(119): integer infeasible or unbounded
CPLEX Error 1217: No solution exists.
Problem is integer infeasible.
— Restarting execution
— OM.gms(84) 2 Mb
— Reading solution for model OM
— OM.gms(97) 3 Mb
*** Status: Normal completion
— Job OM.gms Stop 10/25/13 00:11:28 elapsed 0:00:00.069


I hope someone can help me,

sincerely

David


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.
For more options, visit https://groups.google.com/groups/opt_out.


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.
For more options, visit https://groups.google.com/groups/opt_out.

Cheers :slight_smile: that solved my problem!


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.
For more options, visit https://groups.google.com/groups/opt_out.