AnsweredAssumed Answered

Problems reducing number of integer variables

Question asked by hector.espi on Dec 9, 2017
Latest reply on Dec 11, 2017 by Susanne.Heip

I am trying to reduce the number of binary variables created in the model, but I am still having issues.

This is a simplified version of my code.

 

declarations

  Clients= 1..1000                        

  Depots= 1..100                       

 

  CLIENTS_DEPOTS_COMB: array(Clients, Depots) of integer

end-declarations

 

initializations from 'table.dat'

CLIENTS_DEPOTS_COMB

end-initializations

 

declarations                                         

  vars: dynamic array(Clients, Depots) of mpvar       

end-declarations

 

forall(c in Clients, d in Depots | exists(CLIENTS_DEPOTS_COMBS(c,d)) ) create(vars(c,d))

 

forall(c in Clients, d in Depots | exists(CLIENTS_DEPOTS_COMBS(c,d)) ) (vars(c,d)) is binary

 

 

I am getting 100000 vars. But in the table CLIENTS_DEPOTS_COMB there is only 3000 combinations, so I am expecting only 3000 vars.

The data table looks like this              

CLIENTS_DEPOTS_COMB : [

(1 1)

(1 4)

(1 10)

(2 9)

(3 77)....

.

What could be the reason I am not getting only 3000 vars?

Thank you

Outcomes