AnsweredAssumed Answered

Reduce number of Variables. Create a subset of possible options

Question asked by hector.espi on Dec 8, 2017
Latest reply on Dec 11, 2017 by Johannes Müller

(This is a simplified version of my problem)

declarations

  i= 1..1000                         

  j= 1..100                        

 

  x: array(i,j) of mpvar

end-declarations

 

With this formulation I will have 100000 xs. But I know that in x(i,j) for each i   there is only 1   j.

The data table looks like this               i          j

                                                            1          16

                                                            2          3

                                                            3          4....         

 

I have 2 questions:

1. How I write this in Declarations so I only have 1000 xs and not 100000?

2. How do I write a constraint that sweeps in the same way i and j (only the combinations in the data table)?

 

Thanks,

Outcomes