How To Code this Integer Programming Model

387 Views Asked by At

I am not sure how to code in GAMS, so I tried coding this in Excel VBA and I am struggling with the complexity...

Excel Solver hit a variable limit (there are ~11,000 input variables in here). Does anyone know how I can code this in GAMS or Cplex or some other software? I have only used Excel VBA or Excel Solver, so I am not sure how to code this model in other software.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

There are a number of options open to you. One is using a "domain specific language" (DSL). GAMS, AMPL, MPL and OPL come to mind, but I'm probably missing others. Each has its own syntax. You write the declaration of the model either in a text file or in an IDE, associate it with data files containing your parameter values (or, if there are not too many parameters and it's a one-time solve, bake them into the model), and then feed the model and data files to a solver. Most of those languages work with multiple solvers. OPL ships with CPLEX Studio (meaning you have the language and interpreter, the CPLEX solver and an IDE in one bundle).

An alternative is to use a general purpose programming language (C, C++, Java, Python, R, Julia, ...) and link it to a solver. Here there is not really a DSL. Instead, there are functions/methods and, for object oriented languages, classes designed to express the model and solve it. Different solvers may provide different APIs. MATLAB (and, I think, Octave) can also be interfaced to some solvers.

Personally, if I were reasonably fluent in a programming language, I'd start there, since in my opinion it's easier to learn an API in a familiar language than a new DSL. Either way, you can probably find documentation and/or training materials once you decide which approach you're going to take.