Student Scheduling CP-SAT Precedence #2286
-
Hi there, I am trying to solve a problem that is a variation of the Job Shop problem. I have a set of classes, each of them have a number of credit hours and you try to divide them equally for each semester. (Semester is min 13 credit-hours and max 21 credit-hours) But unlike the Job Shop problem, I also need the following:
My CodeI tried to make a simple program using the CP-SAT solver to solve for class picking while minimizing total semesters but my program does not take into account classes taken to minimize semester time. Here is what I wrote
Is their a way to solve this with using all of OR-Tools suite or just CP-SAT? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please start reading and And yes, this should fit perfectly with CP-SAT. |
Beta Was this translation helpful? Give feedback.
-
In addition to the resources Laurent mentioned, I also find the official examples very good: As for your code, maybe something like: model.Add(order["a"] < order["d"]).OnlyEnforceIf([classes["a"], classes["d"]]) And remember that python sees model.Minimize(sum(order[c] for c in class_names)) |
Beta Was this translation helpful? Give feedback.
Please start reading
the developer guide on CP-SAT
and
the CP-SAT cookbook
And yes, this should fit perfectly with CP-SAT.