Skip to content

Domain of variable #1734

Closed Answered by jajhall
samuel-casasdray asked this question in Q&A
Apr 26, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Yes, the type of a variable can be set to highspy.HighsVarType.kInteger and then its bounds used to define the range of integer values that it may take. How you do this in practice depends on how you are defining your model.

  • If you are populating an instance of the HighsLp class, then set the entries of the integrality_ vector to the value highspy.HighsVarType.kInteger, and the values of the colLower_ and colUpper_ vectors to the desired bounds.

  • If you have built the model by defining variables and constraints, you call the following highspy method, where n is the number of variables that you want to be integer-valued, indices is the list of length n of the indices of variables to be …

Replies: 1 comment 3 replies

Comment options

jajhall
Apr 26, 2024
Maintainer Sponsor

You must be logged in to vote
3 replies
@samuel-casasdray
Comment options

@jajhall
Comment options

jajhall Apr 26, 2024
Maintainer Sponsor

@samuel-casasdray
Comment options

Answer selected by jajhall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants