ompr icon indicating copy to clipboard operation
ompr copied to clipboard

Request regarding index

Open nipnipj opened this issue 5 years ago • 2 comments

Hello!

I'm new to ompr. The following suggestion might be already implemented. I think it would be better if once the indexes for a variable were stablished with add_variable they do need to be written again in other functions like set_objetive or add_constraint. This would make easier to handle Multi-dimensional Index sets.

nipnipj avatar Jan 03 '21 03:01 nipnipj

Thanks for the suggestion. Can you elaborate a bit what you mean?

dirkschumacher avatar Jan 10 '22 15:01 dirkschumacher

Hello!

I'm new to ompr. The following suggestion might be already implemented. I think it would be better if once the indexes for a variable were stablished with add_variable they do need to be written again in other functions like set_objetive or add_constraint. This would make easier to handle Multi-dimensional Index sets.

The added feature couldn't hurt. But many (most?) formulations have constraints that use only a subset of variables based on categories. E.g. in a product mix problem where only some products use only some specific raw material. So the index subsets of the constraints would only include the products that use the specific material. So in those cases the subsets of the indexes would still have to be explicitly articulated for those constraints. Of course a formulation could be completely dense using zero values for some coefficients, but that is not generally advised.

sbmack avatar Jan 10 '22 16:01 sbmack