Questions tagged [cp-sat-solver]

Questions relating to the Google CP-SAT solver, available through OR-Tools.

105 questions
0
votes
1 answer

How to use AddMultiplicationEquality to add constrain?

I have a list of numbers below for example. And the constrain is that two adjacent numbers' gap should be both positive or negative, or one of two numbers equaling to zero, that is to say that one positive and one negative(eg. 3 and -1) is…
MindHacks
  • 931
  • 2
  • 7
  • 9
0
votes
1 answer

ORTools task allocation optimization with duration

I am using or-tools solution like https://github.com/google/or-tools/blob/master/examples/python/task_allocation_sat.py to allocate tasks to time slots where each task has periodicity and each time slot has capacity (how much tasks in max could be…
0
votes
1 answer

ORTools CP-Sat Solver Channeling Constraint dependant of x

I try to add the following constraints to my model. my problem: the function g() expects x as a binary numpy array. So the result arr_a depends on the current value of x in every step of the optimization! Afterwards, I want the max of this array…
0
votes
1 answer

Does OR-tools CP-SAT solver supports "reflection" methods such as x.Min() and x.Max()?

I'm porting my old (from 2010) OR-tools CP solver models to the CP-SAT solver (in Python3). There are quite a few differences between these systems, but most are quite easy to port to the CP-SAT solver. However, one thing I haven't found in the…
hakank
  • 6,629
  • 1
  • 17
  • 27
0
votes
0 answers

Google or-tools sequence maximization

I am trying to maximize a sequence of shifts for 5 workers in a year. Let's say I have 3 shifts(1, 2, 3) and break(B). Then I get as an input a sequence of shifts, let's say I get '111222333BBBBBB'. What I need to do with it is maximize the number…
0
votes
1 answer

CP-SAT to balance task assignment

Dears, I'm wondering if CP-SAT as any built-in function that allow me to balance the number of tasks assigned to the users. Now I'm calculating the variance and I'm minimizing it in the objective function, so it would be great to have the…
0
votes
1 answer

Possible integer overflow in constraint: linear

Dears, I'm using CP-SAT in python. I have two variables: pippo = model.NewIntVar(-93372036854775808,9123372036854775807, 'pippo') test = model.NewIntVar(-93372036854775808,9123372036854775807, 'test') and the following decision variables: for r in…
0
votes
1 answer

OR-Tools optimization eith CP-Sat

I'm solving an optimization problem in python with OR-Tools / CP-sat solver. I'm using a file that takes some hours to reach optimal solution. Is there any way of seeing in the terminal how the process is going, like the best solution found so far,…
Giulietta
  • 21
  • 2
0
votes
1 answer

Employee Shift Scheduling with Multiple Work Centers over time horizon

I'm new to ORTools and trying to implement an algo for employee scheduling problem involving multiple shifts and work centers over month using…
0
votes
2 answers

Performance issue in CP-SAT

Dears, I'm having performance issues on the code below. I know it is challenging to forecast 435 variables, but if i find the way to run the model below for a big amount of variables it will be great for me, otherwise if you can suggest alternative…
-1
votes
2 answers

What does OR-Tools' CP-SAT favor the first variable?

I have a function that solves the Stigler Diet problem using the CP-SAT solver (instead of the linear solver) and minimizes error (instead of minimizing the quantity of food). Initially, I was trying to use AddLinearConstraint to specify the minimum…
Travis
  • 1,998
  • 1
  • 21
  • 36
-1
votes
1 answer

Feasibility of Google OR Tools for large scale FJSSP

I want to solve FJSSP and have made a working code snippent for the same. I want to know how scalable is it for large problems (for 10 X 10 and 100 X 100). How much time will it take to solve? Will it be possible to get results in acceptable time…
-1
votes
1 answer

Model infeasible when fixing some variables in OrTools CP-SAT

I have a boolean variable in Ortools CP-SAT, let's say x. That variable is in a constraint say y = -5 * x. I have two other constraints in the model that are model.Add(y >= 0).OnlyEnforceIf(z) and model.Add(y < 0).OnlyEnforceIf(z.Not()). When I try…
-1
votes
1 answer

Get Empty solution using OR-TOOLS for optimization problem

I'm trying to solve optimaztion problem of assigning doctor to surgry and for room when the main goal is to minimize the number of docotors. I have start and end time, number of surgeries and number of rooms. I try to use OR-TOOLS to solve the…
-1
votes
1 answer

CP-SAT is slow when it creates the goal function

Could you explain to me what CP-SAT does when it created the goal function? With big models this action is very slow. the function is the following: sum(sum(self.suggested_decisions[r][d]*( …
1 2 3 4 5 6
7