Skip to main content

Questions tagged [gurobi]

Questions related to the commercial solver Gurobi Optimizer.

58 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
0 answers
201 views

Ill-conditioned LP in Benders decomposition

I have implemented a Benders decomposition for a constrained network flow but the LP solver (Gurobi) warns me of the ill-conditioning of the subproblem dual LP. As you can see below, the coefficients ...
Mauricio Zambon's user avatar
7 votes
0 answers
879 views

Having trouble with objective function in Python: "GurobiError: Variable not in model". What else could I try?

I am trying to figure out how I can write this objective function into python using Gurobi. I have to minimize the sum of the product of three dictionary's values. The reason I am confused is that ...
Jacob Myer's user avatar
5 votes
0 answers
57 views

Gurobi - Is finding a feasible solution when optimizing a lot harder than finding a feasible solution?

The code is working fine but I feel as my intuition could be wrong. I first set up my problem as: $$\min_{f(x)\leq F} g(x) $$ and gurobi was unable to find a feasible solution. I then relaxed ...
John's user avatar
  • 51
5 votes
0 answers
124 views

Scale of largest CPLEX/Gurobi execution

I am trying to understand the CO2 emission of large scale optimization using CPLEX or Gurobi. Is there a published literature which addresses the compute usage of large scale executions?
Omar Shehab's user avatar
5 votes
0 answers
120 views

Reduce overhead Gurobi Python getting and setting attributes

I am using Gurobi 9.5.1 in Python 3.10. In the context of column generation I request the duals of the master problem and set them in the objective of the subproblem. This is done repeated times. <...
rllb's user avatar
  • 51
3 votes
0 answers
145 views

Does Gurobipy exploits sparsity of the optimization problem?

What happens when a (sparse) csr matrix / array is submitted to Gurobi (via Cvxpy framework in python). Does it exploit the sparsity Information about the matrix or ...
pqrz's user avatar
  • 470
3 votes
0 answers
166 views

Pyomo: Compute IIS, remove corresponding constraint and resolve

I am using pyomo together with a bunch of solvers (gurobi, cbc, etc.). I am able to compute the IIS (with gurobi, not cbc), and write it in a *.ilp file. What I ...
Meth's user avatar
  • 424
3 votes
0 answers
55 views

PWL constraints efficiency

So, I'm trying to optimize MILP, which has PWL constraints. I use gurobi, and when I'm optimizing model without those constraints, gurobi finds solution in a matter ...
Aisec Nory's user avatar
3 votes
0 answers
101 views

Automatic quadratization of constraints in pyomo for gurobi

Gurobi 9 can solve QCQPs, and QCQPs capture all of polynomial optimization by the obvious trick that e.g. a cubic term $x_1 x_2 x_3$ can be turned into a quadratic term $y x_3$ and a constraint $y = ...
Martin Koutecký's user avatar
3 votes
0 answers
76 views

Linearization of a quadratic model, what is the difference while using gurobi?

I have a quadratic model of parking $N$ cars in $S$ separate lanes as follows. Each car has an arrival time and a departure time. Departure follow the last in first out principle. The objective is to ...
OR Junior's user avatar
  • 541
2 votes
0 answers
51 views

Parameter Tuning Tool in Gurobi using Julia

I need to solve a hard MIP model using Gurobi. There is a tool to set the best parameters combination to solve this problem called "Parameter Tunning". How can I find parameter tuning using ...
Angelo Aliano Filho's user avatar
2 votes
0 answers
89 views

Branching the product of binary and continuous variable in Gurobi

I have a binary variable (X) multiplying a continuous variable (Y). I know I can linearize by adding an auxiliary variable (I have that model working), but I now want to do my own branching in the ...
orpanter's user avatar
  • 517
2 votes
0 answers
241 views

OR constraint in Gurobi - Python

I'm new to Gurobi in Python and I am wondering if there is way to code the following constraints: 1- $\sum x_i =0$ for all $i\in A$ OR for all $i \in B$ where A and B are distinch sets of integers ...
M.Badaoui's user avatar
  • 185
2 votes
0 answers
68 views

Multi Commodity VRP Time Windows Paper

I have been wondering is there any paper that who discuss multi commodity with four index/indices like this formulation below: $$ \begin{gathered} \sum_{k} \sum_{c} F_{j, j, c, k}=1 \quad \forall j \\ ...
overboxed's user avatar
  • 593
2 votes
0 answers
77 views

Determining the number of nodes within a cycle for an MILP problem

I have a MILP problem that requires knowing the number of nodes within a cycle (there will be multiple depending on inputs). I believe this will involve tracing nodes/values within cycles using the ...
user9899's user avatar
2 votes
0 answers
311 views

Solving minimax problems with Gurobi

I want to solve a problem of the form $\min_x\max_y f(x,y)$ using Gurobi, where $x,y\in [0,1]$. Is there a simple way to model this in Gurobi? I've seen examples where the domain of $y$ is finite, but ...
Eli C's user avatar
  • 21
2 votes
0 answers
182 views

Gurobi c++: Getting constraint matrix

I'm trying to get the constraint matrix from a Gurobi model in C++. In Python, one can get this by simply calling a method that will populate a scipy object (see this post). However, in a C++ fashion, ...
gdragotto's user avatar
2 votes
0 answers
357 views

Find multiple solutions in Pyomo with Gurobi

I am fairly new to Pyomo and Gurobi. I'd like to find 20 sets of different solutions that meet the following constraints. ...
ssswokao's user avatar
2 votes
0 answers
95 views

CPU time on Linux with Gurobi

I am solving a MILP model in C++ using Gurobi 10.1. I retrieve the CPU time of my C++ program under Linux via the following commands: ...
Pratim's user avatar
  • 29
2 votes
0 answers
305 views

Gurobi is unable to give an optimal solution even when it exists

I am trying to solve Logarithmic Fuzzy Preference Programming (LFPP) for criteria weight evaluation, based on fuzzy comparisons between criteria, and I am solving it with Gurobi in Python 2.7. It is a ...
Milovan's user avatar
  • 21
2 votes
0 answers
112 views

Efficient way to do user rescaling of variable in Gurobi

Is there a better way than the code below to the rescaling of variable in a model after the model has been build with Gurobi? Like some build in function or a direct manipulation of the column object? ...
user3680510's user avatar
  • 3,655
1 vote
0 answers
47 views

Integrality gap vs Gurobi Gap

I was wondering what the difference is between the integrality gap (i.e. best known solution in relation to the LP relaxation) and the gap from the MIP solver from Gurobi, for example. As I understand ...
ornewbie's user avatar
1 vote
0 answers
71 views

Solve scheduling model using a greedy heurisitc

I have the following scheduling problem. Relatively simple and not very complex (only serves as an example). The indexes are $I$ worker, $T$ days and $J$ shift. The decision variable is $x_{ijt}$, ...
Uni ewr's user avatar
  • 71
1 vote
0 answers
56 views

Does getting the second optimal solution in a general MILP require solving a MILP again?

This general question popped into my mind if finding all optimal solutions takes not much more time than finding just one optimal solution in a MILP why not gettting all of them in Gurobi?
Red shoes's user avatar
  • 153
1 vote
0 answers
33 views

Modeling start point constraint for TSP in the Dantzig-Fulkerson-Johnson formulation

I'm trying to use the DFJ formulation to solve TSPLib problems using JuMP and Gurobi. I want to add a constraint to the starting point by fixing either the start or the end to the first node (because ...
skittish's user avatar
1 vote
1 answer
167 views

Conditional Statements in an LP model

I am currently working on a large workforce/manpower planning model for an aviation company. This model should decide whether to hire a new pilot or to let pilots fly overtime. It has two skillsets. ...
Adri's user avatar
  • 11
1 vote
0 answers
104 views

min matrix norm with gurobi v10+

I was trying to use Gurobi for a minimization problem like so: $$ \min\|M-TX\|_1 $$ where all three terms are matrices. $X$ is the nonnegative decision variable(s) of compatible size. $M$ and $T$ are ...
Brannon's user avatar
  • 900
1 vote
0 answers
140 views

How to get seed from grbtune and set it in Gurobi?

I have tuned my model with grbtune and depending on the seed used, the runtime changes a lot: For example: ...
armset's user avatar
  • 73
1 vote
0 answers
45 views

Finding the solutions using pyomo and gurobi

I have a code that uses pyomo and gurobi but when i try to run it, it doesn't give me the optimal solutions, just says that they exist. What can i do?
Joana Domingos's user avatar
1 vote
0 answers
75 views

Does Gurobi solve QCQMIPs with Quadratic terms faster with then Bi-Linear terms in general?

Based on the color distance function defined here i try to find $n$ RGB colors with large inter set color distances and good color distance to white. ...
worldsmithhelper's user avatar
1 vote
0 answers
132 views

How to solve this problem with Gurobi add-in Opensolver excel

My main problem is that, when I try to solve an optimization using Gurobi with the OpenSolver add-in, I get the error that there is no feasible solution. To summarize, my variable $X_i$ has a maximum ...
ADMGYP's user avatar
  • 49
1 vote
0 answers
155 views

How to see fix constraint violations found with IIS

I'm running a simple MCNF model to see if my network is balanced. I'm using Gurboi in Python and with the IIS I can see that there are 2 constraint violations making it infeasible. How do I fix these ...
Emma Kuttler's user avatar
1 vote
0 answers
765 views

How to eliminate large matrix coefficients and large RHS warning in Gurobi

I'm solving a large network flow problem using Gurobi to do Benders decomposition in Python. The imported .csvs contain values that typically fall in either zero, the range of [20,200], or with a ...
Emma Kuttler's user avatar
1 vote
0 answers
113 views

Pooling problem, Gurobi example

I tried to model and solve this Pooling problem below. I used Excel and Opensolver and used Couenne solver to get the .nl problem file. I then used Neos Knitro and Scip 8 to (try to) solve the problem....
user9050's user avatar
  • 119
1 vote
0 answers
156 views

Hybrid metaheuristic and linear program?

I have a Linear program (LP) that can solve problem X with two objective functions a and b, I use the weighted sum method. I use Gurobi solver when I optimize the objective alone, the problem takes a ...
MAJID majid's user avatar
1 vote
0 answers
309 views

Problem with Piecewise constraint in Gurobi

I am facing a problem in my model with piecewise constraints that is making my one of the decision variables equal to zero for every value. My objective function is: \begin{equation} \min \sum_{t=...
salidi's user avatar
  • 99
1 vote
0 answers
197 views

How to use gurobi to plan production and minimize the times of changeovers

Suppose we have two lines: L1 and L2. Suppose we have 4 product types: A1, ...
John's user avatar
  • 141
1 vote
0 answers
139 views

Multiple conditions in indicator constraint of Gurobi

I'm working on a vehicle routing problem, in which a vehicle need to pick up amounts of things in some nodes. I'm trying to solve it by Gurobi optimizer. Except for meeting the time windows of each ...
kaiyu wei's user avatar
  • 133
1 vote
0 answers
137 views

How can I set the solution of gurobi to be a multiple of 10 instead of all integers?

For example, the solution for gurobi has two solutions, as follows: [10,20,50,70] [55,79,30,80] I only want to output solutions that contain only multiples of 10. The sample example as follow: ...
Zying's user avatar
  • 57
1 vote
0 answers
136 views

Binary variable with two criteria in Gurobi (Java)

I have the following problem in Gurobi (Java). I have a binary variable $b$ that is supposed to be $1$ or $0$ depending on my optimisation variable $x$. It should be true that $b = 1$ if $c_1 \le x \...
Handballer73's user avatar
1 vote
0 answers
121 views

Quadratic optimization in Gurobi with constraint

I have a question of understanding in Gurobi: I have an objective function in which my optimization variable x is squared. I have solved this bsiher by a quadratic objective function with $x$, $x$. ...
Handballer73's user avatar
1 vote
0 answers
154 views

Expansion heuristic using gurobi reduced cost / shadow price (LP)

Gurobi 9.0.0 // C++ // LP Let us assume the following problem with three nodes: (1)-----(2)-----(3) node (1) is producing ...
Mitch's user avatar
  • 93
0 votes
0 answers
71 views

Improving the lower bound

Good afternoon. I have a very difficult to a MIP model. I have tried several different strategies to reduce the gap. I am using Gurobi and in this case, I already have an incumbent solution. I've set &...
Angelo Aliano Filho's user avatar
0 votes
1 answer
75 views

Gurobi - Problem with adding a non-linear constraint to a column object

I have implemented the following Column Generation model in Gurobi. Unfortunately, I currently have the problem that the constraint in the master problem is not linear and therefore I cannot add the ...
nflgreaternba's user avatar
0 votes
1 answer
88 views

How can I add columns from the subproblem to the master problem in my column generation model?

I have one last question about my column generation model. I am currently trying to implement it in code, and I am successfully solving the subproblem. So I can solve the dual values of the master ...
nflgreaternba's user avatar
0 votes
0 answers
132 views

Pyomo + Gurobi Scheduling Tasks within Working Hours

I initially posted this on stackoverflow and got redirected here. You can view the old post with formatted tables here: StackOverflow Post I have a python schedule optimization script using pyomo and ...
Phil Franjo's user avatar
0 votes
0 answers
119 views

Troubleshooting Gurobi Import Errors in Jupyter Notebook on Compute Canada HPC server

I am trying to use Gurobi optimization software in a Jupyter notebook on a Compute Canada HPC server, but I am running into issues importing the gurobipy module in Python. I have loaded the Gurobi ...
Andrew's user avatar
  • 163
0 votes
0 answers
56 views

Optimization for a capacity problem

I have a csv file with a table with 5 columns: dueDateTime, cover, phone, simcard, tablet. This file has the amount of items for cover, phone, simcard, tablet. I have the size of the items: we have ...
Andreas K's user avatar
0 votes
0 answers
90 views

why the -1 in basis column for simplex tableau?

When I look at the tableau generated by Gurobi for a simple 3D problem with five constraints, I get this: I expected to not have a -1 in basis columns 4, 5, 6 (referring to slack variables 1, 2, 3 if ...
Brannon's user avatar
  • 900
0 votes
0 answers
73 views

Lagrange relaxation / subgaradient algorithm Sensivity to input data

I am implementing a Lagarange relaxation with subgradient method to find a lower bound for a minization problem, I tried to find the complicating constraints. I found an upper bound with relatively ...
ABDE's user avatar
  • 1