Questions tagged [gurobi]

Gurobi is a commercial optimization solver for linear programming (LP), quadratic programming (QP), quadratically constrained programming (QCP), mixed-integer linear programming (MILP), mixed-integer quadratic programming (MIQP), and mixed-integer quadratically constrained non-convex programming (MIQCP).

As described on Wikipedia:

The Gurobi Optimizer is a commercial optimization solver for linear programming (LP), quadratic programming (QP), quadratically constrained programming (QCP), mixed integer linear programming (MILP), mixed-integer quadratic programming (MIQP), and mixed-integer quadratically constrained programming (MIQCP).

Problems can be defined and solved via Gurobi's interactive shell or one of its many programming languages interfaces: C, C++, Java, Microsoft, .NET, Python, MATLAB, R.

1089 questions
-1
votes
1 answer

Gurobi implementing a constraint with the sum of the multiplication of sums with python

I am using gurobi with gurobipy to implement a linear programm. While implementing the following constraint, I get a failur. With and and as indices sets. My minimal example looks like import gurobipy as grb m = grb.Model() set_I =…
-1
votes
1 answer

Failed to create solver with name 'gurobipy': Failed to set executable for solver asl. name=gurobipy either does not exist or it is not executable

I am reciving this error and I do not know what to do? WARNING: Failed to create solver with name 'gurobipy': Failed to set executable for solver asl. File with name=gurobipy either does not exist or it is not executable. To skip this…
-1
votes
1 answer

ApplicationError: Solver (gurobi) did not exit normally

I'm using gurobi academic license and i've followed every steps to activate the license but i get the following error whenever i call the gurobi solver on model which i wrote in pyomo : ERROR: Solver (gurobi) returned non-zero return code…
ali prm
  • 1
  • 1
-1
votes
2 answers

The gap still keeps 100% in running Gurobi model

I am solving a mixed-integer linear programming model on Python platform using the solver Gurobi. However, The gap of the model still keeps 100 % during the long-running time. I am trying to use the codes to limit the running time. The solution is…
-1
votes
1 answer

Solver interface needed for MIQP problem Gurobi/MATLAB

I am somewhat new to Gurobi and I had a question regarding which solver interface to use for solving an MIQP problem using MATLAB and Gurobi as a solver. I have already successfully solved some MILP problems using the intlinprog function in MATLAB…
-1
votes
1 answer

Gurobi OR Constraint and Inequality Constraint in Python

I'm implementing an OR logic with Gurobi. Specifically, I have two decision variables $x$ and $y$ and I want $x \neq y$. However, Gurobi doesn't support inequalities. So I tried to use OR logic like $x >= y + \epsilon OR y >= x + \epsilon$. I've…
Francis
  • 189
  • 1
  • 11
-1
votes
1 answer

How can I add conditional binary variable to GUROBI

I am working on mathematical modeling using Gurobi as a solver and python as an interface. In my model, I would like to create a binary variable but the variable is allowed to take a value of 1 if a>=1 else 0 where a is another decision variable in…
-1
votes
1 answer

Gurobi quicksum syntax in c++

I need the Syntax to create a sum in a Gurobi-constraint in c++: EXAMPLE: I have the variables: x[i][j] and the constraint: sum over all i's from x[i][j] <= 1 for all j's in Gurobi Python it is: for i in [list of i's]: model.addConstr(x[i,j]…
DvdFrcK
  • 33
  • 5
-1
votes
1 answer

optimization comparison between cvxpy and gurobi

There are number of jobs to be assigned to number of resources each with a score (performance indicator) and cost. The resource assignment problem (RAP) objective is to maximize assignment scores considering the budget. Constraints: Each resource…
-1
votes
1 answer

Linear problem for chemical composition of a formulation

Dears, I´m writing a Linear Program for optimization. One of my goals is to recommend to my supplier which raw material mix to use in its product formulation in order to optimally fulfill my nutrient needs in several locations.…
-1
votes
1 answer

How to round up in gurobi python?

I am working on a math model using Python. I have 4 datasets: 1. Trucks=[1:263] 2. Slots=[0:23] 3. Companies=[0:3] 4. Blocks=[0:7] 2 binary decision variables X and Y and 1 binary dependent decision variable Z (Z=X+Y). I want to add the…
-1
votes
1 answer

Understanding Gurobi Python as a Beginner

I am novice in Gurobi Language. I am trying to solve some LPs and MIPs using GurobiPy, so the approach I thought I would take was to look at some examples how to add constraints and all. But in the examples provided by Gurobi website, the actual…
Rio
  • 23
  • 6
-1
votes
1 answer

Can't i use the variable in a formula?

I'm coding a math model using gurobiy, but an error occurs. the error is 'Var' object cannot be interpreted as an integer. i tried to solve it using search, but I don't have enough information. spi: required space of block i cft: area of factory f…
boroboro
  • 31
  • 8
-1
votes
2 answers

How to run gurobi on colab

I have the gurobi solver installed on my computer. Is there a way I can connect and use it on Google Colab? Can this be done without connecting to the local runtime?
Pranjal
  • 57
  • 1
  • 7
-1
votes
1 answer

Find the value of each term in the objective function

I want to calculate each one of the three terms in the objective function alone gurobi python. how can I do that? The first term : c*(te[i]+to[i]+t[i,s])*X[i,b,s] for i in Trucks for b in Blocks for s in Slots The second term: d[b,s]*X[i,b,s] for i…