Skip to main content
62 votes
Accepted

What are the advantages of commercial solvers like Gurobi or Xpress over open source solvers like COIN-OR or CVXPY?

Disclaimer: I am currently working for a commercial solver company (Gurobi) and have worked before on another commercial solver (IBM CPLEX). Hence, my opinion may be biased, but still I am trying to ...
Tobias Achterberg's user avatar
23 votes

What are the advantages of commercial solvers like Gurobi or Xpress over open source solvers like COIN-OR or CVXPY?

No, the situation isnĀ“t the same for OR libraries. There are several reasons for this, among them being Performance: The difference is relevant, with an emphasis on Mixed Integer Programming (linear ...
dhasson's user avatar
  • 1,687
22 votes

What is the purpose of libraries like Pyomo and Google OR tools?

Pyomo is an algebraic modeling language and allows users to easily represent optimization problems at a high-level (by defining variables, constraints, objective, etc.). Pyomo then provides interfaces ...
Bethany Nicholson's user avatar
22 votes

What are the advantages of commercial solvers like Gurobi or Xpress over open source solvers like COIN-OR or CVXPY?

I think the short answer is: speed. Most optimization problems solved in the OR world are computationally intractable, they cannot be solved in reasonable time as the size of the data increases. A ...
Kuifje's user avatar
  • 13.5k
20 votes

What is the purpose of libraries like Pyomo and Google OR tools?

OR-Tools is a set of solver: A very popular Routing Library built on top of a traditional constraint programming solver An award winning ...
Laurent Perron's user avatar
17 votes
Accepted

How does a warm start work in LP/MIP?

For the simplex algorithms, warmstarting a solver typically means installing a near-optimal basis and using that as a starting point instead of doing a crash or slack basis as a first step. This works ...
Philipp Christophel's user avatar
16 votes

What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP?

The term "local optimum" is a little misleading here. Assuming your MIP is linear (or at least convex), every local minimum is also a global minimum, so there is no such thing as "getting stuck in a ...
LarrySnyder610's user avatar
15 votes

Presolve is cutting down a lot of binary variables. Should I rethink my formulation?

First of all, the log output of a solver should not change your mind about the formulation you use. Most of the times, one can not imagine how such geometric spaces look like and it is hard to guess ...
independentvariable's user avatar
15 votes
Accepted

What does "Concurrent spin time" mean in the Gurobi log and what does choosing Method=3 do?

Performing parallel operations deterministically often leads to some overhead and threads waiting or idling - this is the spin time. A non-deterministic or opportunistic parallel mode does not have ...
mattmilten's user avatar
  • 1,653
15 votes
Accepted

No "not equals" constraint in Gurobi

If you want $x_1\neq x_2$, you can linearize $|x_1-x_2|\ge \varepsilon$, where $\varepsilon$ is your tolerance. You can do this by introducing a boolean variable $y=1$ if and only if $x_1-x_2\ge \...
Kuifje's user avatar
  • 13.5k
13 votes

What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP?

As pointed out by others here, in principle a branch-and-cut based solver can't get stuck, it can just continue until in the worst case it enumerated all integer solutions. Of course that might take ...
Philipp Christophel's user avatar
13 votes
Accepted

Why is there not a feasible solution for a MIP?

Yes - such a question can be answered by looking at the irreducible inconsistent subsystem (IIS). From the Gurobi documentation: An IIS is a subset of the constraints and variable bounds with the ...
CMichael's user avatar
  • 1,333
12 votes

Model conversion as fast as gurobipy and solved by open source solvers

You can use model.write("mymodel.lp") to generate an LP file (similarly for .mps and other common formats) that you can pass in ...
ttnick's user avatar
  • 566
12 votes
Accepted

How to model a mixed-integer linear programming formulation in Python using Gurobi?

Here is the complete implementation for the above-mentioned model. ...
Mostafa's user avatar
  • 2,104
12 votes

Modeling and solvers

I can't address the specifics of Python, Pyomo, Gurobi or GAMS, but I can address the general question of using a modeling language (such as GAMS) versus building the model directly in a general ...
prubin's user avatar
  • 39.3k
12 votes
Accepted

Do LP solvers convert LPs to standard form?

No, state of the art LP solvers do not do that. They do bring the problem into a computational form that suits the algorithm used. Note that in the case of simplex algorithms, modern solvers use the ...
Philipp Christophel's user avatar
12 votes
Accepted

What exactly is the optimality-gap or what does it say in integer linear programming?

In a minimization problem, the lower bound will be a value below which the objective value cannot go. The upper bound will be the objective value of the best solution found so far. The lower bound is ...
prubin's user avatar
  • 39.3k
11 votes

When should I use dual Simplex over primal Simplex?

Dual simplex is the method of choice for resolving an LP if you have an optimal solution and you change the problem by modifying the feasible region. Ranging the RHS, adding cuts or branching in MIP, ...
mjsaltzman's user avatar
11 votes

What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP?

Gurobi and CPLEX use (very sophisticated) variants of the branch-and-bound algorithm. In Mixed Integer Programs, there can be both continuous and integer variables. It turns out that the integer ...
Kevin Dalmeijer's user avatar
11 votes
Accepted

Decision Variable Value from a Set (Gurobi)

I don't think directly, but one way to model that would be to: define a parameter as the vector of the possible values: $p = [0,50,100]$ define three binary decision variables that each correspond to ...
E. Tucker's user avatar
  • 1,317
11 votes

Settings for a faster solution of a MILP (GUROBI, python)

You could try changing the parameter mipfocus to 2 or 3 (https://www.gurobi.com/documentation/9.0/refman/mipfocus.html) in order to let Gurobi focus more on improving the bound or proving optimality. ...
user3680510's user avatar
  • 3,655
11 votes

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

Let $x_{p,\ell}$ be the continuous variables in your table. Introduce integer variables $y_{p,\ell}$ and binary variables $z_{p,\ell}$, and impose linear constraints \begin{align} -z_{p,\ell} \le x_{...
RobPratt's user avatar
  • 32.3k
10 votes
Accepted

When does Gurobi add cuts from callback

Assuming you are using more than a single thread, then Gurobi performs all work you code in the callbacks with a single thread. All remaining threads process the branch and bound nodes (without doing ...
Albert Schrotenboer's user avatar
10 votes

Presolve is cutting down a lot of binary variables. Should I rethink my formulation?

Complementing the other good answers, please note that presolve is concerned with problem input data and tries to eliminate variables using logical reductions. While a huge reduction in the number of ...
Ehsan's user avatar
  • 2,463
10 votes

What is the purpose of libraries like Pyomo and Google OR tools?

Different solvers have their own interfaces (for example Cplex studio by IBM). You can use the specific syntax for those IDE or interfaces to input your model and then use the solver to solve it. ...
Oguz Toragay's user avatar
  • 8,652
10 votes

How can I identify the reason that makes a MILP model hard for solvers such as CPLEX?

MILPs are NP-hard. People make a big deal about NP-hardness for a reason - in the worst case they are very, very hard to solve. There is a short, easy to understand exposition of this by @Johan ...
Mark L. Stone's user avatar
10 votes

What are the advantages of commercial solvers like Gurobi or Xpress over open source solvers like COIN-OR or CVXPY?

(Full disclosure: I run a solver company) The state of the art Unlike ML, in the optimisation space commercial software is unfortunately on average superior to open-source alternatives. This does not ...
Nikos Kazazakis's user avatar
10 votes
Accepted

No, Gurobi, I really do want this variable to be binary

Gurobi has apparently been listening to you and others with similar concerns. Gurobi 9.1 was just released and introduces a new parameter IntegralityFocus to ...
Mark L. Stone's user avatar
10 votes

Problem is infeasible with Gurobi, feasible with cbc (but can't access objective value)

If I read the lp file and try solving with CPLEX: So I think your assumption is correct: the bug comes from CBC, as CPLEX and GUROBI both return infeasible. The CPLEX log also tells you which row is ...
Kuifje's user avatar
  • 13.5k
10 votes
Accepted

Dealing with Symmetry. Commercial solver defaults vs manual implementations

There might be automatic settings and tunings inside the solver that are not perfect and might choose not to use orbital branching for an instance although it might be beneficial. In that case the ...
Philipp Christophel's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible