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
-2
votes
1 answer

A function does not take all values of a list when I pass it as a parameter

I have two lists l=[0,1,7,10] and ll=[1,7,10], I want to use this lists as parameters of a function, the function uses this lists, ll, and l, in "for" cycles to iterate. When I pass the list my function does not take all the elements, specifically…
Héctor Alonso
  • 181
  • 1
  • 2
  • 12
-2
votes
1 answer

Python - passing a result to a list

I'm using Python to solve an integer program using Gurobi. After defining all variables and constraints, I'm getting the following answers for my integer variable x[i,j]. x(0,0) 0.0 x(0,1) 0.0 x(0,2) 1.0 x(0,3) 1.0 x(1,0) 0.0 x(1,1) 0.0 x(1,2)…
ccc
  • 574
  • 2
  • 9
  • 22
-2
votes
1 answer

How can I debug this Spyder/Python code?

Since I wrote this syntax as a variable in the spyde IDE/python and the error is invalid syntax this is my code: from gurobipy import* try: m = Model('operating_room') #Data b= [1,2,3] n= [1,2,3,4,5,6,7,8,9,10] j=…
-2
votes
3 answers

How to exclude zeros from a list

I am writing a linear program in python gurobi and I am trying to create some constraints only including a multiplication of the elements of two lists but excluding the zeros. More specifically: A is a list that contains only positive or zero…
Thomas
  • 31
  • 1
  • 7
-2
votes
1 answer

Modify a python code to solve a sequence of linear programs where a lower bound of a variable is being incremented by 1

Using Gurobi and Python I could optimally solve a linear problem for a given situation. However, when I am given a range in which a lower bound for one of the variable can increase in an increment of 1, I could not figure how to write the right…
-3
votes
1 answer

Which solver is suitable for bilevel problems, CPLEX or Gurobi?

I am trying to model a bi-level problem using a solver. I wonder about CPLEX and Gurobi: which one is the best choice? Based on my research, there is no important difference between these two, or am I wrong?
Aprilis
  • 17
  • 1
  • 8
-3
votes
1 answer

Getting conditional merged list of disjoint lists in python

Given a set of I={0,1,2,3,4}, my code produces feasible optimal routes and the results are look like below: x[0,2]=1, x[2,4]=1, x[4,3]=1 (meaning go from node 0 to node 2 then from 2 to 4, then from 4 to 3) and remaining x[i,j]=0 ( x[0,1]=0…
MASOUD
  • 41
  • 1
  • 6
-3
votes
1 answer

Coding summation i > j in networkx

I am using networkx (and gurobi) to calculate shortest path between nodes in a set of nodes. However I need to calculate the summation of all shortest paths in a particular way that is, Sum for all i > j of dij where dij is shortest path between…
Art Zahar
  • 155
  • 1
  • 3
  • 7
1 2 3
72
73