All Questions
1,290
questions
0
votes
0
answers
18
views
Maximizing sum of And()ed BoolVars in Python ortools
Given a set of cards, I have a list of combos that each involve one or more of these cards. I want to find a subset of these cards of a fixed size (DECKSIZE), that optimizes the number of combos that ...
0
votes
1
answer
15
views
How to add a constraint that a linear expression is outside bounds that are variables?
I want to add the constraint that abs(x) >= y with x and y being variables.
The following code fails because AddBoolOr doesn't suppport BoundedLinearExpression as arguments.
model = cp_model....
-1
votes
1
answer
28
views
Guidance required with Python VRP Time Window Problem (using Google OR Tools)
I'm trying to solve the Vehicle Route Optimisation with Time Window constraints using Google's OR Tools in Python. The problem here I'm solving is - I want to deliver packages to the customer, where ...
0
votes
1
answer
20
views
How can i use "max" function in Google OR tools
Objective function is sigma(max (0, C_i\[i\] - d_i\[i\]))
my code is ..
Obj = sum(\[max(0, C_i\[i\] - d_j\[i\]) for i in range(1, job_num+1)\])
error is ...
File "/Library/Frameworks/Python....
0
votes
1
answer
31
views
or-tools vrp mutually exclusive disjunction sets?
I am using or-tools vrp framework, and I am trying to create mutually exclusive paths.
Suppose I have 7 different locations [0,1,2,3,4,5,6]. I would like to make my vrp either visit [0,1,2,6] or [3,4,...
0
votes
1
answer
21
views
Scheduling problem : how to hanlde stock variation hover tasks
I'm trying to optimize a job shop manufacturing problem. I've managed to implement my constraints of tasks depending on the end of other tasks, optimization with respect to target dates and earliest/...
1
vote
0
answers
35
views
Google OR-Tools Max number vehicles for zone
I'm beginner in constraint programming and I'm using Google or-tools library in my c# program.
In my problem nodes belong to zones, characterised by a maximum number of vehicles in transit towards ...
2
votes
2
answers
29
views
Using a CP sat solver, I want to use 2 conditions in an "OnlyEnforceIf" but can't find how
I am using a CP-sat solver by google or tools and I am adding some constraints to my variables.
There is a constraints that should be enforce if 2 bool variables are True. However I can't manage to ...
0
votes
1
answer
28
views
Python ortools stops without stack trace
I use cp_sat from ortools.sat.python to solve a constraint programming problem. However, my Python interpreter just stops in the middle of a solve, without printing a stacktrace.
from ortools.sat....
0
votes
0
answers
28
views
OR-Tools providing incorrect solution for VRP with no depot
I have a distance matrix with first row and column set to zeros. I try to run the code provided on the VRP website (Or-Tools) and it provides me with the following solution. This is obviously not the ...
0
votes
2
answers
61
views
Or-tools is not giving the best route for a matrix with floating point distances
I have this function to find the best route:
from ortools.constraint_solver import pywrapcp, routing_enums_pb2
import numpy as np
def sin_restriccion(matriz_input, indices_input):
# Convertir el ...
0
votes
1
answer
38
views
Or-tools: How to use BoolVar/ Change bounds of exisitng IntVar
I wanted to expand the job shop problem for the CP-Sat Solver by adding optional tasks,that don't have to be executed. But my problem is that I don't really know how "remove" a task from the ...
0
votes
1
answer
35
views
Where can I find detailed information about OR-TOOLS solver parameters for VRP?
I would like to study in detail how OR-Tools works for VRP.
As I understand it, the solver first finds some feasible solution and then improves it by local search methods.
Is there a detailed ...
0
votes
0
answers
19
views
VRP time limit constraint
In my particular VRP (Vehicle Routing Problem), I have a certain number of locations to visit starting from the depot. Each vehicle has a maximum time to complete its journey. The objective is to find ...
0
votes
0
answers
35
views
How to implement OR Tools Vehicle Routing Problem with Time Windows?
I ran the official code that Google has in its documentation.
It considers that there are 4 vehicles, Time Windows for all location, allow waiting time and maximum time per vehicle. When I copy and ...