Jonasz Staszek
-
Community Moderator
- Total activity 302
- Last activity
- Member since
- Following 0 users
- Followed by 0 users
- Votes 13
- Subscriptions 124
Comments
Recent activity by Jonasz Staszek-
You can do it via indicator constraints. Perhaps this post will give you an idea of how to go about this. Additionally, I would suggest that you have a look at this entry concerning the creation of...
-
Yes, exactly in the same fashion. You first generate the presolved model: > reduced_model = model.presolve() and then you store it in your desired location: > reduced_model.write("reduced_model.lp"...
-
Assuming \(x\) corresponds to the variable matrix and \(v\) to some coefficients, I'd imagine the following to work: model.setObjective(x @ v @ x, GRB.MAXIMIZE) Best regardsJonasz
-
You seem to be using the matrix expressions for \(v\) and \(x\), is this correct? If yes, you need to define your objective as MQuadExpr. If you store your variables and parameters in (tuple)dicts,...
-
Hi Jonas, now I get it - Matthias was mentioning an update method on the tupledict storing variables, and not on the variable objects themselves. Tupledict as such is an extension of a Python objec...
-
Hi Elina, AFAIK it is the presolved model. Perhaps someone from the Gurobi team can confirm this? The log suggests that presolve added both constraints and variables. This could be due to the linea...
-
Hi Elias, you could for example use NetworkX to construct your graph and then simply iterate over its nodes and their respective predecessors and successors to build your constraints. For your toy ...
-
Hi Mustafa, Could you please share a formulation of the mathematical model (LP, MIP, ...) you are trying to solve? Rather than code, a mathematical formulation would be useful. An angle, in which a...
-
Hi Alessandro, thanks for the clarification. Assuming your Gurobi model is properly defined as model, there are several approaches you could try: 1. If you need only optimal values for your sensiti...
-
Hi Jose, as far as I know, each gp.Model() is a separate object in Python, and hence, it will contain all the constraints and variables which were added to it. If your models are not too big, you c...