Skip to content

Commit

Permalink
Fixed categorical data example #932 (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiunixo authored Dec 11, 2024
1 parent cb4ea2b commit 6f51e81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/finished/categorical_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
for s in shift_to_int.values():
model.addCons(sum(x[e, s] for e in employees) == 1)

# Each employee must be assigned to exactly one shift
for e in employees:
model.addCons(sum(x[e, s] for s in shift_to_int.values()) == 1)

# Employees can only work shifts they are available for
for e in employees:
for s in shift_to_int.values():
Expand Down

0 comments on commit 6f51e81

Please sign in to comment.