Requesting a new type of variable introduction
AnsweredHi! I have been using PuLP previously with the COINOR CBC Engine for projects which needed to be opensourced. Recently I switched to Gurobi (using my academic licenses) and found it to be astonishingly fast.
I am presently working on a specific type of constraint for a specific problem requiring the usage of variables which would be able to take some predefined Integer values. Sure I can implement this using Binary Variables but the purpose of my project is basically to prove that this form of constraint making should be faster as it should decrease the problem size.
I have tried to find the solvers and engines which support such types of variable creation and have recently been helped (https://github.com/coinor/Cbc/discussions/516#discussioncomment3228702).
However, I don't wish to use the CBC Engine as I am certain that it would take enormous time for searching till optimality. I earnestly request you to kindly introduce a new "Bucket" variable type urgently.
I would be extremely eager to share more information as well as the motivation as to why this is highly necessary (https://www.youtube.com/watch?v=YX40hbAHx3s&t=458s).

Hi Santanu,
You can model "Bucket" variables with fixed step sizes by adding an integer variable and a multiple.
E.g. say \(x\in\{3,6,9\}\) you can model this with an integer variable \(z\in\{1,2,3\}\) and have \(x=3z\).
Cheers,
David0 
Unfortunately, I don't have a linear formula for this. The formula for getting the Integer cluster which are the only one's to be used in the variable is a very complex nonlinear equation involving squareroot, floor and the functions value for the term just before it. Therefore I would be separately computing it and then using those results as possible "Bucket Variable Values".
I have thought of major options and have understood that it is necessary I use a variable which uses a select few numbers only (which in my case are positive integers). Therefore I am unable to model this presently in Gurobi which is my first choice since I am sure that I would be able to solve huge problems till optimality which is not possible in case of other solvers.
From my basic understanding, this would be essentially similar to a Binary Variable just that the user would be able to define the list of values from among which the variable must take its values.
0 
Hi Santanu,
I am afraid that the change you request would take a lot of time, and many of the algorithms Gurobi uses would not be as efficient as they are for binary programs.
As a workaround, you could try using indicator variables and constraints (I discussed a bunch of somewhat similar cases here and here), but my intuition tells me that the performance of Gurobi would take a hit if you wanted to use this logic for larger models.
Perhaps someone from Gurobi development team can comment further?
Best regards
Jonasz0 
Hi again Santanu,
This feature will be considered if more people would like this.
Cheers,
David0
Please sign in to leave a comment.
Comments
4 comments