# Questions tagged [or-tools]

Questions related to or-tools, Google's open-source software suite for optimization

61 questions
Filter by
Sorted by
Tagged with
60 views

### Extracting CNF representation of my problem from SAT solver

As I know, any SAT solver such as or-tools or cplex cp optimizer converts a given problem to CNF form in the first place. Is it possible to extract the resulting CNF representation from or-tools or ...
112 views

### OR-Tools, How to avoid dividing by zero

Problem: There is an order to fabricate some products of total number, let's say 200 (all products are the same). We have some number of factories, let's say 5. Every factory has different number of ...
168 views

### Using VRPy and OR-tools in Python to solve the DCVRP

This question is a follow-up to this one. Since I understand the complexity of the problem I have been underestimating, I turned my attention to off-the-shelf solvers, like VRPy and OR-tools. I would ...
96 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: ...
122 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 ...
403 views

### find suboptimal solution, if no optimal solution exists?

I am using or-tools linear solver. and my problem ends up having no optimal solution. how can I tell the solver to find a suboptimal solution?
46 views

### Modified bus scheduling problem question in ortools

Has been crossposted in stackoverflow. I want to solve the bus scheduling problem using ortools with some minor modifications. In my case, the max number of drivers is known. The modifications I would ...
82 views

### Mixed Integer Programming - Model Formulation for A Resource Allocation Problem

There are a number of orders, which needs to be shipped. For each order, there may be 1 to 3 route options. The problem here is to find out the best allocation (combination) of orders among these ...
39 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 ...
64 views

### CP-SAT _ Summing variables under conditions

I have been working lately on scheduling optimization using CP-SAT in OR-TOOLS and now I'm at the point where I need to start considering due dates in my model. I didn't want to put them as ...
78 views

### Problem with setting up gurobi with OR-tools

I am trying to setup Gurobi with Google OR-Tools with the function pywraplp.Solver.CreateSolver("GUROBI"). The function returns None, which could occur if ...
163 views

### modify pickup and delivery problem to only delivery scenario in google OR-tools

I am using Google OR Tools for solving the capacitated vehicle routing problem.I want to implement optimization solution for delivery problem.For example there is one storage location which load all ...
298 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 ...
143 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 ...
307 views

### OR-TOOLS : delivery node with multiple possible pickup nodes

I am using ortools to model a VRP with pickup and delivery constraints, where pickups can be done at different nodes. For example, if node A has a demand, it must be picked at node B or C. Here is how ...
103 views

### Production planning for a video game economy

I'm a software developer who likes to play a video game that has a complex economy. I realized that the type of problem I'm trying to solve mimics real life operations research problems, and I am ...
190 views

### OR-TOOLS : is it possible to partially fulfill a demand?

I am working on a vehicle routing problem with or-tools. Is it possible to partially fulfill a demand? I know it is possible to drop nodes with the disjunction constraints. But in this case, a node is ...
405 views

### How to know which constraint in CP-SAT did not meet the feasibility gap

Is there any systematic way to retrieve some information on the constraint that caused infeasibility in Or.Tools CP-SAT? ...
95 views

### How to model a set of integer variables getting assigned different values than another set of integer variables

Assume we have variables $x_1, x_2, x_3, x_4$ that each can belong to $\{1,2,...,10\}$. How can we model a constraint that variables $x_1, x_2$ get assigned different values than $x_3, x_4$? Because ...
282 views

Assume we have two variables $x,y \in S$ where $S=\{1,2, \dots, 1000\}$. Also, we are given a partition of set $S$ as: $S_1 = \{1,2, \dots, 249\}$ $,S_2 = \{250, \dots, 499\}$ $,S_3 = \{500, \dots, ... 0answers 80 views ### Best known results on the flexible jobshop benchmarks Is there a website that compiles the best known results on the flexible jobshop problem ? I know there was a blog post/article by Quintiq, a (deleted) blog post on CP Optimizer, some more recent ... 1answer 111 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 ... 0answers 42 views ### High-mix manufacturing capacity I'm not an expert in OR but I would like to determine what is the maximum manufacturing capacity of a plant (or how much a plant can produce of mix products). Each person in the plant has a known set ... 1answer 107 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 ... 1answer 217 views ### Best way to solve an allocation problem I have the following problem: I have products with different attributes (price, weight, category) and I have a list of clients. Every client has an "affinity value" with every product, the ... 1answer 124 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. ... 1answer 156 views ### Is it possible to solve VRP using OR-Tools CpModel, instead of RoutingModel? Is it possible to solve VRP using OR-Tools CpModel, instead of RoutingModel? I want to do synchronized VRP, which is combining vehicle routing and scheduling constraints 2answers 224 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 ... 2answers 583 views ### How to add logical OR constraint in OR-Tools? Let's say nurses normally do 1 shift for d in all_days: for s in all_shifts: model.Add(sum(shifts[(n, d, s)] for n in all_nurses) == 1) But I want to ... 0answers 70 views ### Fixed cost associated to SlackVar(waiting time cost) [CVRPTW] I'm modeling a CVRPTW with some features: Each type of vehicle has a cost per km and a fixed cost per trip. To calculate these costs, I am using these methods for this: ... 1answer 158 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: ... 2answers 551 views ### CP-SAT over CBC for MIP, is it worthwhile? I am working in an integer optimization problem. All of the decision variables are binary, and the objective is to minimize some cost function. I currently am implementing CBC, but I have been reading ... 1answer 288 views ### Solving vehicle routing problem in java I am trying to solve vehicle routing problem in java and I am looking for libraries for the same. I did a POC using google or-tools and it seems to be solving all my use cases. I would like to know if ... 1answer 561 views ### CP-SAT ortools - Is there any complete list of possible/available StringParameters for the CpSolver? I wonder if there is any list of string parameters documented. So far, I only know max_time_in_seconds and num_search_workers. ... 1answer 123 views ### Optimal way to ensure optional intervals are consecutive in OR-Tools I am trying to solve a scheduling problem in OR-Tools. There are lots of "events" that need to be scheduled to "blocks" (essentially half-days). I am naturally using optional intervals for the events. ... 1answer 512 views ### Solution time out for VRPTW in or-tools I am experimenting around with or-tools and somehow I can't get a solution for the VRPTW problem for any of the instances I have tested from Gehring & Homberger ... 2answers 371 views ### How to measure model quality in OR-Tools? After creating my model for a problem, what steps should I take to test if a change in the model is actually helpful or not? In Python, ... 1answer 220 views ### How exactly does OptionalIntervalVar work in OR-Tools? I created OptionalIntervals for a number of tasks: ... 1answer 270 views ### TSP with constraints in OR Tools I am completely new to OR Tools, but what I have tried so far seems very powerful. I have, however, run into a problem that I cannot seem to figure out how to solve. I am trying to model a TSP ... 1answer 585 views ### assigning values to IntVar if and only if BoolVar, else zero [or-tools] If I have an IntVar s[j] stored in a vector s, is it possible to iterate for (a period of ... 0answers 118 views ### OptionalIntervalVar enforced but not working OR-TOOLS I'm using OptionalIntervalVar and then maximizing the starts. The optimal solution is not affecting the other variables that creates the ... 0answers 120 views ### Modelling issue with precedence constraint in OR-Tools I'm trying to solve an RCPSPDc model It is infeasible, although Ilog Cplex solves it, so I think I have a modelling issue. I have more constraints but the precedence is the one that makes it ... 1answer 137 views ### ValidateModel or tools in c++ and proto problems I'm trying to validate my model, this is the relevant part of my code: ... 0answers 82 views ### Modelling issue with rcpsp and boolean expressions I'm trying to solve an RCPSPDc problem in OR-Tools with CP-SAT solver. In my RCPSPDc model (with discount rate) i want to set this objective: $$\max_{s}\sum_{j\in J}\text{profit}_{j}\cdot \frac{1}{(1+... 1answer 733 views ### Cumulative Constraint OR-Tools I'm trying to solve an rcpsp model. I can't find documentation for the AddCumulative function of OR-Tools. How should this function be used? I want to write this ... 1answer 234 views ### Precedence Constraint in OR-Tools I'm trying to write this constraint in C++ and add it to my model (addLessOrEqual):$$\text{start}_{i}+\text{duration}_{i}\le\text{start}_{j}$$for an (i,j) arc ... 0answers 110 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$... 1answer 549 views ### Floating points in ORtools 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$...
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 \\ ...