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
16
votes
7 answers

mathematical optimization library for Java --- free or open source recommendations?

Does anyone know of such a library that performs mathematical optimization (linear programming, convex optimization, or more general types of problems)? I'm looking for something like MATLAB, but with the ability to handle larger problems. Do I have…
13
votes
2 answers

Get constraints in matrix format from gurobipy

I coded my model in gurobipy and I want to get the matrix of constraints and vector of cost. Is there any way to access those?
12
votes
2 answers

Solving an integer linear program: why are solvers claiming a solvable instance is infeasible?

I'm trying to solve integer programming problems. I've tried both use SCIP and LPSolve For example, given the final values of A and B, I want to solve for valA in the following C# code: Int32 a = 0, b = 0; a = a*-6 + b + 0x74FA - valA; b = b/3 + a +…
Craig Gidney
  • 17,763
  • 5
  • 68
  • 136
11
votes
1 answer

Google colaboratory run code locally

Is it possible to run Google Colaboratory scripts in my computer locally? If not, why it has been designed in that way? I would like to work collaboratively in short code scripts without having to use version control systems such as Github and being…
11
votes
5 answers

Python passing callback function in a class

I have to try to move from the non-class-based coding style into class-based coding style, but facing an issue. The optimize() function takes a callback function mycallback(). The code works perfectly fine in Non-class-based method, but when I moved…
twfx
  • 1,664
  • 9
  • 29
  • 56
9
votes
2 answers

How to resolve ImportError in Gurobi?

I am trying to run this example given in gurobi's example model. I am using python 3.5 with gurobi 7.0.2. When I run the code, I get the following error. Traceback (most recent call last): File "test.py", line 1, in from gurobipy…
Wasi Ahmad
  • 35,739
  • 32
  • 114
  • 161
8
votes
1 answer

Cannot compile Gurobi examples in version 7.5.1

I just updated Gurobi to version 7.5.1 on Linux (Ubuntu)--this is the newest version available. Problem Any time I try to compile any code that uses Gurobi--for example, the examples included in /opt/gurobi751/linux64/examples, I just get a string…
David M.
  • 381
  • 3
  • 10
8
votes
1 answer

Speed of CPLEX vs CPLEX using SCIP

I am new to LP and have only briefly used PuLP in Python. Why is there a speed difference between SCIP 3.2.1 - CPLEX 12.63 and CPLEX 12.6.3? Doesn't SCIP still use CPLEX for solving? Why will someone use SCIP with CPLEX solver, instead of using…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
8
votes
1 answer

gurobi - Error code = 10004 Unable to retrieve attribute 'X'

I am getting an error in my c++/gurobi file: Error code = 10004 Unable to retrieve attribute 'X' I read that this might have something to do with labels? But I don't see how there is a problem. It works for some input files, but not for others. So I…
dorien
  • 5,265
  • 10
  • 57
  • 116
8
votes
3 answers

Gurobi python get value of the defined variable

How do i get the value of the variable that i have define previously(using addVar) in gurobi python? I need to compare the value of the gurobi variable and then perform calculations to reach to my objective variable. The same has to be done before…
7
votes
0 answers

GUROBI: 'Missing constraint index' when adding constraint in Python

Trying to add the following constraint in Gurobi/Python: Code N_SERVERS = 5 #number of servers C_SERVER = [1]*N_SERVERS N_NODES = 3 #number of nodes C_NODES = [2]*N_NODES #create…
cherryp
  • 79
  • 1
  • 2
7
votes
2 answers

How to set MIP start (initial solution) with Gurobi solver from PuLP?

I'm using the PuLP module in Python to formulate a mixed integer program. I am trying to work out how to set a MIP start (i.e. a feasible solution for the program to start from) via the PuLP interface. Details on how to set MIP start are given…
kabdulla
  • 5,199
  • 3
  • 17
  • 30
7
votes
3 answers

How to disable the calculations log of pulp

I am using "pulp" in python together with GUROBI to solve some optimization problems. For example, the calculations log for GUROBI is: Optimize a model with 12 rows, 25 columns and 39 nonzeros Coefficient statistics: Matrix range [1e+00,…
m0_as
  • 451
  • 1
  • 5
  • 13
6
votes
2 answers

Comparison between CPLEX and Gurobi

Gurobi and CPLEX are solvers that have been very popular in recent years. CPLEX is easier for academics in terms of the license. It is also said to be very high in performance. But Gurobi is claimed to be the fastest solver in recent years, with…
Aydin
  • 167
  • 1
  • 7
6
votes
1 answer

Does Pyomo support generation of multiple solutions?

I've been using Gurobi to solve an MILP problem, and Pyomo for generating the model. Gurobi supports returning a Solution pool, and I want to be able to generate multiple solutions using this pool. Is this supported in Pyomo? I've tried using…
Suhas Pai
  • 63
  • 4
1
2 3
72 73