Skip to main content
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
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
14 votes

Case Studies and Real Problems for Teaching Optimization and Modelling

The INFORMS Transactions on Education is devoted to works about education in OR. There you can find many cases already used by teachers in their courses, along with material for instructors.
Alberto Franzin's user avatar
14 votes

How to read open-source code of a solver (Or-tools, OptaPlanner, Minotaur, etc.)?

I read through the code of several solvers before developing Tulip.jl. To be honest, unless you are yourself developing a solver/interface, or need to reproduce an author's implementation, there is ...
mtanneau's user avatar
  • 4,183
12 votes
Accepted

Warm start CPLEX using google or-tools

See answer on https://github.com/google/or-tools/issues/1444 This is not implemented. I welcome pull requests. You can have a look at the code in the Gurobi or Scip interface files.
Laurent Perron's user avatar
10 votes

Case Studies and Real Problems for Teaching Optimization and Modelling

There are lots of resources that contain optimization models and whose codes. Some of them are as follows: 1) Supply chain: Operations and supply management: The core A deep dive into strategic ...
A.Omidi's user avatar
  • 8,960
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,667
10 votes
Accepted

Is there an open-source equivalent to LocalSolver?

The simple answer is no. While I haven't used LocalSolver myself, I sell a solver that solves similar types of problems (Octeract Engine) so I get asked this type of question a lot for my own solver. ...
Nikos Kazazakis's user avatar
9 votes
Accepted

Maximize assigned tasks to each worker

Why quadratic? just use a larger (linear) weight for tasks assigned to worker 1.
Laurent Perron's user avatar
9 votes

Google - OR tools for workforce scheduling problems

In addition to the answer from @Mehdi... I've recently started to work with OR-tools and find it very nice for prototyping. The Python interface allowed me to produce a first version of my model ...
JakobS's user avatar
  • 2,767
9 votes
Accepted

Travelling salesman problem with given number of locations to visit

Thanks to @Laurent Perron for their answer - I've tried modifying the code as follows, and it appears to work fine: ...
ignoring_gravity's user avatar
9 votes
Accepted

How to measure model quality in OR-Tools?

Time to solve (to proven optimality) is certainly a good choice. I don't know that I would be excited about number of conflicts. You could look at the ratio of objective value on that problem ...
prubin's user avatar
  • 39.6k
9 votes
Accepted

CP-SAT ortools - Is there any complete list of possible/available StringParameters for the CpSolver?

As many things in Google, OR-Tools uses Protocol Buffers to serialize data. Here's a list of all .proto files in OR-Tools: https://github.com/google/or-tools/...
Stradivari's user avatar
  • 1,414
9 votes
Accepted

CP-SAT over CBC for MIP, is it worthwhile?

CP-SAT is a full fledged (non-mixed) integer programming solver (linear relaxation, presolve, cuts, branching heuristics). It is geared towards optimization, and is actually not very good at ...
Laurent Perron's user avatar
9 votes
Accepted

How to Model Path Being Only Through Adjacent Cells

A standard approach for modeling a path from source $s$ to sink $t$ in a directed graph with node set $N$ and arc set $A$ is to let continuous variable $x_{ij} \ge 0$ represent the flow along the arc $...
RobPratt's user avatar
  • 32.8k
8 votes
Accepted

Interface for Cbc - COIN-OR

There are several packages I can think of with an interface to CBC: Pyomo PuLP MIP
EhsanK's user avatar
  • 5,874
8 votes
Accepted

Precedence Constraint in OR-Tools

What you want is: AddLessOrEqual(LinearExpr(starts[j]).AddConstant(durations[j]), starts[succ[j][s]]) You might also want to take a look at the examples (ending ...
Stradivari's user avatar
  • 1,414
8 votes

Google - OR tools for workforce scheduling problems

I used OR-tools for TSP and VRP. These are my observations: 1- It provides a good quality solution in reasonable time. However, it is not the optimal solution and in some cases you can find much ...
Mehdi's user avatar
  • 683
8 votes
Accepted

Open source MILP solver for quick “good enough” solution

When I use CBC from time to time, it returns the best solution it has found even if it runs into the time limit. I guess, in your case, it has not even found a feasible solution. I call it this way: ...
T_O's user avatar
  • 186
8 votes

How to add logical OR constraint in OR-Tools?

Introduce a binary variable $x_{d,s}$ and change the right hand side to $1+2x_{d,s}$.
RobPratt's user avatar
  • 32.8k
8 votes

Travelling salesman problem variant without returning to the starting point

A TSP with a fixed starting point and no return to start, can be solved as an ordinary TSP with all the in-going arcs to the starting point having a cost of zero. That way the return to the starting ...
Sune's user avatar
  • 6,647
8 votes

Is there an open-source equivalent to LocalSolver?

To our knowledge, there is no equivalent of Hexaly (formerly LocalSolver) in open source and no equivalent of Hexaly in the market. Hexaly's uniqueness, and thus innovation, comes from the two key ...
Hexaly's user avatar
  • 2,986
7 votes

Google - OR tools for workforce scheduling problems

Workforce scheduling describes many different problems. The best technology for those is IMO CP-SAT (see the introduction, the reference manual in the CP-SAT sections and a set of recipes). A ...
Laurent Perron's user avatar
7 votes
Accepted

Cumulative Constraint OR-Tools

If you look at OR-Tools: CumulativeConstraint, AddCumulative takes a variable as argument, so if it is constant, create a variable with a fixed domain. It returns ...
Laurent Perron's user avatar
7 votes

Floating points in OR-Tools

In many of its solvers, OR-Tools only accept integers (see Laurent Perron's comment below). Something like that: ...
mrBen's user avatar
  • 521
7 votes
Accepted

Constraint Programming OR-Tools finding Matrix Combinations

You get the same result $2^{\operatorname{len}(y)}$ times because $y_i$ is not constrained. You can see that by adding this to your callback: ...
Stradivari's user avatar
  • 1,414
7 votes

TSP problem: traveller does not visit all nodes - Google OR-tools

(already answered on S.O. ) You should have a look at Jobshop scheduling example with transitions In particular, it maintains a graph of direct successor between tasks on the same machine.
Laurent Perron's user avatar
7 votes

CP-SAT over CBC for MIP, is it worthwhile?

CP solvers can find optimal solutions (given enough time and memory). Essentially, like the "bound" part of branch-and-bound, each time you find a feasible solution you redefine feasibility to include ...
prubin's user avatar
  • 39.6k
7 votes

Open source MILP solver for quick “good enough” solution

Interestingly enough, one of the best source-open (!= open source) solvers is often overlooked: SCIP (download here); there is a Python interface (PySCIPOpt), too. The parameter you need is ...
Marco Lübbecke's user avatar
7 votes

find suboptimal solution, if no optimal solution exists?

If your linear program does not have an optimal solution one of three things might be the case: The solver didn't find the optimal solution, even though it exists. This might be due to runtime or ...
PSLP's user avatar
  • 2,401

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