Questions tagged [gurobi]

Questions related to the commercial solver Gurobi Optimizer.

Filter by
Sorted by
Tagged with
1
vote
2answers
71 views

How to say to Gurobi solver with Python API to start from a given solution?

I have a binary linear program, where all my variables are binary. So, I have implemented the problem on python with Gurobi solver. I have implemented also a heuristic to find a near-optimal solution. ...
3
votes
1answer
86 views

What fraction of the search space has been searched for ILP?

Is there a way to make Gurobi output (an estimate of) how much of the search space has already been cut off as infeasible? If not with Gurobi are you aware of any binary only (912 of them) ILP solver ...
0
votes
1answer
72 views

How to solve the following linear programming problem using Gurobi (or at least python)?

For an optional ungraded assignment (see it as a complex problem that won't be graded, more to test our skills and knowledge) I was given the following problem. It is not as straightforward as all the ...
3
votes
0answers
48 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 = ...
2
votes
1answer
127 views

Using OR-Tools with .NET and GUROBI

We want to model our MILP problem with Google OR-Tools in .NET, and solve it using GUROBI (solver may change in the next 1-2 years). However, we couldn't find the correct syntax to call GUROBI. https:/...
2
votes
0answers
74 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=...
6
votes
1answer
245 views

Gurobi searches all nodes despite variable initialization

We are trying to solve a large-scale MIQCQP (18K decision variables) problem via Gurobipy (v9.0.3). Gurobi is able to solve this problem in ~13 mins despite whether or not we initialize the decision ...
7
votes
1answer
215 views

Why is Gurobi output in Pyomo returning floating-point values rather than optimal integer solution?

I am hoping someone will be able to point me in the direction of why I am experiencing floating-point outputs rather than simply model.X = [15,15] and model.Z = [15,5] as solutions to this model? Note ...
3
votes
1answer
91 views

Standard Form for LP and MPS

Is there any way I could have Gurobi/CPLEX or any other package write/export MPS and LP files in the standard LP construct loaded with slack variables and transformations required for unsigned vars? ...
7
votes
1answer
229 views

Using the values of variable in the objective function before optimizing

I am facing a problem to multiply a term in objective function. My objective function is : \begin{equation} \min \sum_{t=1}^\top p_{t} \cdot (1+r) \cdot y_{t} \end{equation} where $p$ is the ...
3
votes
1answer
80 views

A tricky Bi-Level Location Problem using VISUM

I'm writing my thesis on the optimal location of Air-Taxi Stations. I'm using PTV VISUM for the transport model where I'll inherit the Origin-Destination demand matrix. I come from transportation ...
4
votes
1answer
349 views

Gurobi: how to add a constraint to make there be only one non-integer value

line1 line2 line3 line4 A 2.3 0 3.1 0 B 0 4 2.2 0 C 1.1 0 0 4.6 Let's say after optimization with certain constraints, my model will generate an optimal production allocation table similar to ...
1
vote
0answers
56 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, ...
0
votes
0answers
54 views

Lower bound very bad. How to improve?

I have the following MILP: \begin{alignat}{2} \nonumber \mbox{minimize } \quad & \phi = \sum_{i=1}^{m-1} \sum_{f=1}^{F} \sum_{\underset{\bar{f} \neq f}{\bar{f}=1}}^F \sum_{h \in H} \left( D_{f \...
1
vote
1answer
61 views

Calculating the Obj Value manually in Gurobi

I have been working on the problem on Facility Location Problem with Gurobi using the example provided by the Gurobi team. ...
2
votes
1answer
74 views

Variable vector violates upper and lower bounds when I hit iteration limit

I have an application where I want to monitor the variables over time. I declare all the variables in my model like this: ...
1
vote
0answers
70 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 ...
2
votes
1answer
171 views

Problem with vehicle routing problem in Gurobi Python

I have a vehicle routing problem solved by linear programming, but I'm confused about the constraints (see the model in figure 1). In the model, $u$ and $x$ are decision variables, and we set node $0$ ...
0
votes
1answer
200 views

Gurobi: How to define constraints that can accept multiple different values? [duplicate]

I have a question about Gurobi. How do I define a constraint that can accept multiple different values? For example, a sample constraint is shown as follows: ...
1
vote
1answer
116 views

How to make the solution of linear programming within the specified elements [duplicate]

The constraint value of a variable must be an element of the specified list.A simple example is shown as follow,in which the value of the...
1
vote
1answer
60 views

gurobipy.GurobiError: Second argument should be a list of Var

The following error was encountered when using LinExpr in gurobi: ...
1
vote
2answers
203 views

How to make the elements of the solution of gurobi belong to the elements of the specified list?

If I want to use the elements of the list as the range of the solution, like list1 = [10,20,50,60,30],and the elements of the solution must belong to the elements of the list The sample example as ...
1
vote
0answers
75 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: ...
1
vote
3answers
354 views

Gurobi does not work any more in Pyomo after getting a new license

I have been using Pyomo with a free Academic license for Gurobi and so far it worked quite well. Now my license expired and I received a new license that is stored in the folder "C:/Gurobi/gurobi....
2
votes
1answer
162 views

Obtaining solver timings from Pyomo

I would like to seek some advice on the following: I am currently using Pyomo to generate my MILP model in Pyomo and solve it using Gurobi, respectively. As the solution process is iterative, I would ...
3
votes
0answers
61 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 ...
2
votes
1answer
219 views

Capacitated Maximum Coverage Location Problem, Python and Gurobi

I am building a variant of the maximum coverage location model and want to limit the amount of points that each "facility" can cover. I am using Gurobi optimization . I have tried using the ...
1
vote
0answers
71 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 \...
0
votes
0answers
93 views

Problems with a MILP

I need some advice, any hints will be appreciated. I have a MILP and I am using Gurobi to solve it. I have a feasible integer solution. When I use mipstart, after ...
2
votes
1answer
201 views

Find multiple solutions using pyomo and gurobi

I am solving a MILP using Gurobi and Pyomo. I would like to obtain as many optimal solutions as possible. Here is what I have so far: ...
1
vote
1answer
67 views

Integral of PWL-Constraint in Gurobi (Java)

In my optimization model, I use piecewise-linear constraints with the output of $y[m]$. The question or problem I have now is whether there is a way in Gurobi (Java) to form the integral for this PWL ...
3
votes
1answer
82 views

Non-Convex QCP model - Used Method in Gurobi

I have the following question: I have a non-convex QCP model. In the parameter description for method it says that "Only barrier is available for continuous QCP models". However, the dual ...
1
vote
1answer
105 views

Method (Algorithm) and Objective used in Gurobi Model

How can I find out which method or algorithm was used to solve my model? When I use GRB.IntParam.Method- to output the method, I get ...
1
vote
0answers
59 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$. ...
3
votes
1answer
538 views

How to find out which constraint causes problems in Pyomo

I have a Pyomo model with many constraints and variables. When solving it with Gurobi, I get the message "Model is infeasible or unbounded". Now I would like to find out which constraints ...
2
votes
0answers
57 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, ...
2
votes
2answers
186 views

Trouble with optional nodes in a VRP model using Gurobi for python

I am currently working on a VRP problem where the vehicles are electric. This means that I have range restrictions, and charging stations as nodes which are optional to visit. In my model I have the ...
3
votes
1answer
182 views

Linearizing a quadratic function with more variables or not in Gurobi?

Suppose I want to set the price $0 \le p_t \le p_{max} $ and based on the price, demand is determined $D_t(p_t)=a-bp_t$. Inventory level at each time is denoted by $I_t$ and it is determined by $I_t= ...
1
vote
0answers
79 views

Strange Result from GurobiPy

I am trying to understand why GurobiPy gives me a strange result for a simple linear programming model coded as below? Why is the optimality gap is 0%? Please let me know if you spot any errors in the ...
0
votes
0answers
94 views

Mixed Integer Programming - Model Formulation for A Resource Allocation Problem

There are a number of orders, which needs to be shipped. For each order, there may be 1 to 3 route options. The problem here is to find out the best allocation (combination) of orders among these ...
4
votes
1answer
146 views

How to add a SOS1 equality constraint?

Most MIP solver's API have special methods to add SOS1-constraints of the form $$ \sum_{i \in I} c_i x_i \leq 1, \tag{1}$$ i.e. at most one of the binary variables $x_i, i \in I$ is allowed to take a ...
1
vote
1answer
142 views

Job Shop Scheduling Problem: jobs are scheduled on the same machine at the same time

I want to solve a job shop scheduling problem. I got $n$ Jobs that have to be scheduled on $k$ Machines. A Job $i$ has 2 or 3 Tasks $j$, and there is a known sequence of the Tasks of a Job. One ...
0
votes
1answer
155 views

How to write this constraint in Gurobi python?

I'm wondering how I can translate this math constraint to gurobi python. $$\forall a \in A, b \in B, x_{ab} \in \{0, 1\}$$ So far I have written: ...
3
votes
1answer
122 views

Gurobi uses 1 core on supercomputer node with 64 cores

I have installed Gurobi 9.1.1 on a supercomputer node with 64 Xeon processors. For the installation I used conda. I access this node via ssh. When running "htop" I see that the process uses ...
4
votes
1answer
216 views

how to implement an optimization function with polynomial in Gurobi (Java)

I have the following problem: I have an objective function with the optimization variable $x$, which looks simplified like this: $ZF = (a+b)*(x+1)$ Here $a$ is simply a constant value. However, behind ...
0
votes
0answers
42 views

Linear equation from pairs of values with conditions in Gurobi (Java)

How can I create a linear equation in Gurobi (Java) from values (x-y value pairs) that also has the following properties: $\forall x \leq 0 \Longrightarrow y = 0$ The linear line/equation should have ...
0
votes
1answer
190 views

if-else query depending on optimization variable in Gurobi (Java)

I am looking for the most elegant solution to the following problem: I have an if-else query that depends on my optimization variable $x_i$. If $a \leq b_i + x_i$, the parameter $c$ should take the ...
2
votes
3answers
101 views

Link a binary variable to continuous variable in Java Gurobi

I have the following problem: Depending on my continuous optimization variable $S_m$, I would like to introduce a binary variable $x_m$, which, depending on the value of $S_m$ (greater or less than 0) ...
10
votes
2answers
685 views

Do LP solvers convert LPs to standard form?

To solve a linear program (LP) using the simplex method one first needs to bring the LP to standard form. This requires replacing every equality constraint with two inequalities and replacing every ...