We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb4ea2b commit 6f51e81Copy full SHA for 6f51e81
examples/finished/categorical_data.py
@@ -51,6 +51,10 @@
51
for s in shift_to_int.values():
52
model.addCons(sum(x[e, s] for e in employees) == 1)
53
54
+# Each employee must be assigned to exactly one shift
55
+for e in employees:
56
+ model.addCons(sum(x[e, s] for s in shift_to_int.values()) == 1)
57
+
58
# Employees can only work shifts they are available for
59
for e in employees:
60
0 commit comments