Morpheus
Morpheus

Reputation: 3543

Gurobi python interface, fixing a variable

I am trying to solve a MIP using column generation.

In the master problem LP I want to fix a variable. This variable refers to an arc being used and I want to indicate that the arc should definitely be used.

Now, I think I can achieve this in two ways. Either setting the fixed cost of the arc to 0 and hence it will be definitely used or setting the lower bound and upper bound of the arc variable to 1 (essentially fixing the variable to 1). My question is, does fixing a variable (setting lower and upper bounds to 1) add more constraints in the master LP (and hence affecting the column generation) or not.

Upvotes: 2

Views: 349

Answers (1)

Greg Glockner
Greg Glockner

Reputation: 5653

No, changing the variable bounds (the LB and UB attributes) does not add any new constraints to a model; the bounds are simply handled within the simplex algorithm. This is true for any mainstream LP solver that uses the simplex method, not just Gurobi.

Upvotes: 3

Related Questions