Questions tagged [cp-sat]

9 questions
2
votes
2 answers

Adding multiple choice constraints to cp_model, ortools

I'm following this tutorial https://developers.google.com/optimization/scheduling/job_shop of the Job Shop problem as I have a similar task, except I need an extra constraint which I can't figure out how to add. I want to add a constraint that (in…
0
votes
0 answers

AddAtMostOne or-tools but add at most x instead of one

I'm following https://developers.google.com/optimization/scheduling/employee_scheduling / https://developers.google.com/optimization/scheduling/job_shop in python to help me with a task. [] I want to add a constraint similar to AddAtMostOne, but I…
0
votes
1 answer

Is there any way to add "Not" constraint for AddLinearExpressionInDomain besides creating a complementary set of domain in CP-SAT?

x is a variable with lower and upper bounds 0 and 20. x_is_in_the_defined_domain is a bool variable indicating what its name tells. The defined_domain is [1, 3], [5, 7]. We can link x and x_is_in_the_defined_domain by finding its complementary set…
John
  • 1,779
  • 3
  • 25
  • 53
0
votes
1 answer

How to run the solving process step by step

When we have defined a relatively complicated model, the solving process could be long. One way is to cut the long solving process into phases. We can find a quick and feasible solution first with an initial objective, AND then resume the solving…
John
  • 1,779
  • 3
  • 25
  • 53
0
votes
1 answer

AddNoOverlap2D takes no arguments?

i have a python plugin i'm trying to write some parts of in C# but adding no overlap 2D seems to confuse me. in python it takes model.AddNoOverlap2D(x_intervals,y_intervals) in C# i tried but the function takes no arguments? so tried to run it…
Sonny Hansen
  • 620
  • 1
  • 5
  • 18
0
votes
1 answer

Is there any smarter way to constrain the max size of continuous tasks with ortools cp-sat

In pharceutical industry, the changeover/cleaning events are typically very long and may even need different level of operator resource. As a result, they need to modelled carefully when we schedule the tasks and events. This is still something we…
John
  • 1,779
  • 3
  • 25
  • 53
0
votes
0 answers

OR-Tools employee scheduling: Consecutive shift only if employee worked the 1st shift

I have been sitting with the or tools shift scheduling sat https://github.com/google/or-tools/blob/master/examples/dotnet/ShiftSchedulingSat.cs Currently an employee can work a max of 3 consecutive days- working An employee can work between 45 and…
0
votes
0 answers

Google Or tools Employee scheduling based on required number of employees to work in that shift

I am having an issue regarding scheduling in google or tools. I am trying to build scheduler based on how many employees needed for a shift so during the day I need 10 and then from 17:00 to 20:00 (night shift) I may need anything from 10% to 100%…
0
votes
0 answers

Google OR: Assigning a shift in a row

The following problem arose, I wrote a restriction that some shift must be scheduled twice during the week, And this is not entirely correct, I need the shifts to go in a row, and only the last day on which the train operates is issued. That is, if…
Rnisa
  • 1
  • 1