All Questions
40
questions
1
vote
1
answer
167
views
Non integer linear objective in or-tools CP-SAT
It seems that or-tools' CP-SAT solvers allows for non-integer coefficients in a linear objective expression. Am I correct, or is it just that the solver doesn't check for integrity and rounds the ...
1
vote
1
answer
276
views
Are there any hidden differences in OR-Tools' default parameters for a MIP model in Python vs C++?
or-tools-discuss cross post here.
As a disclaimer -- I am very aware that OR-Tools' Python code are just wrappers around their C++ source code. I'm just getting an odd discrepancy between a model ...
0
votes
1
answer
84
views
how the number of employees affects the married employee scheduling problem
My scheduling problem has a specific pattern of 2 days of work followed by 2 days off. Additionally, there is a week off after every 4 weeks of work. The scheduling matrix (P) has five different ...
1
vote
1
answer
687
views
TypeError: unsupported operand type(s) for *: 'IntVar' and 'float' in ortools [closed]
I am trying to implement a constraint as follows:
...
2
votes
1
answer
217
views
Control load per trip in multi trip VRP in ORTools
I have implemented multitrip VRP in ortools (To be specific, solved CVRPTW with virtual depots). Maximum number of trips per vehicle is limited to 2. I want to put a hard constraint that load carried ...
1
vote
1
answer
222
views
Applying weights to assignment problems for linear MIP solvers
In previous posts, A & B, I posed the Movie Theater Problem. In short, the movie theater problem encompasses assigning viewers to seats such that the distance between viewers is maximized, however,...
2
votes
2
answers
182
views
Mixed Integer Programming: Iterative assignment problem
I have a real world problem, which is analogous to the below toy problem, which I call 'The Movie Theater Problem' (TMTP.)
In TMTP, movie viewers are assigned seats which principally balances two ...
1
vote
1
answer
177
views
Simple Constraint Programming Problem: docplex works but equivalent ortools model is infeasible
I have a simple constraint programming model which can be solved using the docplex library, however I am struggling to implement the same model using ...
2
votes
1
answer
86
views
Circuit constraint leading to infeasibility if there are 0 jobs producable one a machine
Using the CP-SAT Solver:
My Model turns infeasible whenever there is no job available for a machine. Not every job can be built on every machine. Example Situtations:
Less jobs than machines
No jobs ...
2
votes
1
answer
325
views
Multiple Knapsack with Varying Values
I wish to assign customers to their nearest distribution hubs. These hubs have maximum capacities however, and if these are breached I would like to assign customers to the next most appropriate hub.
...
2
votes
1
answer
323
views
OR-Tools Cost Function Integration
I am modeling a problem similar to the job shop problem (tasks with start times, duration, and predecessors) and my objective is to minimize the makespan, with Python and OR-Tools.
start[i] is an ...
3
votes
2
answers
1k
views
Simple example of finding Hamiltonian path using Google OR-Tools?
I'd like to test how good/fast OR-Tools is in finding hamiltonian paths on some (big) directed graphs.
But I can't find simple enough (for me) examples.
Something like these ones (or even simpler), ...
1
vote
1
answer
352
views
Circuit constraint respecting the order of the next n jobs / jobs on each machine starting at 0
I am working on a scheduling problem in OR-Tools using the CP-SAT solver.
I'm working with
python but I managed to rebuild this solution as starting point:
Optimal way to ensure optional intervals are ...
6
votes
1
answer
923
views
Python "Coffee Shop Scheduling Problem" - Scheduling Lunches/Breaks
I'm working on an employee scheduling program in python. Having never done this before, I've been researching different libraries that can be used to accomplish the task.
Unfortunately, none of the ...
1
vote
0
answers
400
views
Adding sequence constraints to the assignment problem- Python
This is an online assignment problem and yet can be considered as an assignment problem with a sequence. Assume that workers are coming into the system sequentially and I want to assign a task to them ...
3
votes
1
answer
612
views
Bin Packing with CP Solver
[ [0,5],
[0,4],
[1,6],
[2,4],
[3,6],
[3,2],
[4,5],
[5,5],
[6,4],
[7,3],
[8,2],
[8,3],
[9,5],
[10,3]]
...
1
vote
0
answers
319
views
Set Covering and Column Generation
I need some set covering and column generation examples in OR-Tools python.
If anyone can provide or direct me to some resources that would be great..!
1
vote
1
answer
85
views
Print Intermediate Solutions of Scheduling Problem and tackling FLAGS in jupyter notebook
I tried this code and it goes on and I'm clueless when it'll end so I manually interrupt it.
Is there any way we can see intermediate solutions that are feasible solutions and can we limit time or ...
2
votes
0
answers
153
views
Multiple Depot/Crew Office Bus Driver Scheduling Modelling
I'm working on Bus Driver Schedule with multiple add-on constraints that are complex and hence trying to figure out how this can be achieved.
Reference of Bus Driver Scheduling using OR-Tools:-
https:/...
4
votes
2
answers
613
views
OR-Tools: Partial Solution ignored due to "unknown rate is too large"
With SetHint() from the OR-tools linear solver I am trying to pass a feasible solution to my problem. But I receive the following warning:
...
3
votes
2
answers
3k
views
Travelling salesman problem variant without returning to the starting point
I tried the code provided on the link :
https://developers.google.com/optimization/routing/tsp
The actual requirement is to traverse all paths without returning to the start point with minimum ...
3
votes
0
answers
355
views
Add Variables in Bulk for ortools
I am using the Python ortools to solve large LPs where the number of variables and constraints are in the hundred thousands ($10^5$). Surprisingly, it takes longer ...
2
votes
2
answers
1k
views
Cutting Stock Problem : Mixed Integer Programming
I am asked to solve the following problem:
The problem:
You were asked to repair a farm house with sheets of plywood.
You were given thirty sheets of plywood. (each size = 10ft x 10ft)
The house ...
3
votes
2
answers
194
views
Google OR returning different values depending on language
Lately, I have been working on a CP-SAT model for solving multi-resource flexible job shop problems.
I used the code (1) as an inspiration for building code (2) in Python which works well. Then I had ...
3
votes
1
answer
2k
views
Python, Google OR-Tools, OnlyEnforceIf() method
I am trying to solve a basic puzzle by using Google OR-Tools, this is my first try with OR-Tools and I am trying to learn. I completed almost everything and was ready to conclude the program until I ...
1
vote
1
answer
665
views
Flexible Job Shop Problem with several resources per alternative - Ortools
It has been quite a journey for me to go from 0 to understanding the job shop (js) and the flexible job shop (fjs) examples given by Google's ORTOOLS team.
Now the time has come for me to start ...
4
votes
1
answer
643
views
maximum number of BoolVar 's before or-tools is no longer feasible to use
The standard nurse scheduling problem which is used as an example for OR-Tools (see for example https://developers.google.com/optimization/scheduling/employee_scheduling) attempts to assign boolean ...
3
votes
1
answer
768
views
How to balance the workload of teachers in OR-Tools (maximization of the minimum)
I am very new to optimization and OR-Tools. I am trying to solve a very simple question.
Let's assume that we have $n$ students. Each student needs to be assigned to only one teacher as a supervisor. ...
6
votes
2
answers
705
views
Priority List Constraint
I used the Vehicle Routing Problem example that has the objective of minimizing total distance traveled for each vehicle.
Suppose that each order to pick up for each vehicle at each node has a ...
4
votes
1
answer
651
views
Adding a hard and soft upper bound constraint of number of locations to visit (VRP)
I went through the Vehicle Routing Problem example and was able to replicate it. On the example, there is a constraint added for vehicle maximum distance as shown below:
...
9
votes
3
answers
2k
views
Open source MILP solver for quick “good enough” solution
I have a problem that I have already posted elsewhere in OR.stack, but the question is focused around a large binary MILP (about 1 million decision variables). Ultimately, I am more time constrained ...
3
votes
0
answers
198
views
Power of variable or tools
I'm working with OR Tools in Python and I need to define the objective function an expression of the variables. In particular, the objective function is
$$\frac{c_j}{1.7^{s_j}}$$
with $c_j$ ...
10
votes
1
answer
2k
views
Floating points in OR-Tools
I'm trying to solve an RCPSPDc model (maximizing the net present value instead of a makespan). The objective function is: $\sum\limits_{j \in \text{Tasks}} e^{-\theta\cdot s_{j}}\cdot p_{j}$, where $...
6
votes
1
answer
367
views
Interface for Cbc - COIN-OR
I would like to code some IP/MIP models in python and test them with an open-source solver. As of now, I only know the Cbc - COIN-OR open-source solver.
I have already tried the or-tools interface, ...
8
votes
1
answer
760
views
Travelling salesman problem with given number of locations to visit
There's a great example here of how to find a solution to the travelling salesman problem:
...
6
votes
1
answer
1k
views
Constraint Programming OR-Tools finding Matrix Combinations
As a similar post of mine Find all Combinations of a Matrix I am trying to find matrix combinations with entries $>0$ meaning for a matrix
\begin{bmatrix}
0 & 1 & 3 \\
5 & 2 & 1 \\
...
9
votes
1
answer
624
views
TSP problem: traveller does not visit all nodes - Google OR-tools
Context:
I am dealing with a kind of scheduling problem, in which I have a set of tasks and machines. All tasks must be assigned to machines (not necessary all of them). In addition to that, I must ...
8
votes
3
answers
1k
views
Maximize assigned tasks to each worker
In a scheduling problem I want to assign the maximum number of tasks to one worker before assigning it to another. For example, if I have $10$ tasks and $2$ workers, the best assignment would be $(10, ...
4
votes
1
answer
467
views
Machine Allocation & optimal Utilization using python
Problem statement: Meet the demand which can be met across 2 facilities each having multiple machines where several components are made. The objective is to find the optimal solution to meet the ...
11
votes
1
answer
761
views
How to solve the Cumulative Traveling Salesman Problem using or-tools in python?
The objective of the Cumulative Traveling Salesman Problem (CTSP) is to minimize the sum of arrival times at customers, instead of the total travelling time. This is different than minimizing the ...