Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added categorical data example #932

Merged
merged 3 commits into from
Dec 3, 2024
Merged

Added categorical data example #932

merged 3 commits into from
Dec 3, 2024

Conversation

Joao-Dionisio
Copy link
Collaborator

No description provided.

@Joao-Dionisio Joao-Dionisio marked this pull request as ready for review December 2, 2024 16:37
@Joao-Dionisio Joao-Dionisio merged commit 083efc6 into master Dec 3, 2024
16 checks passed
@Joao-Dionisio Joao-Dionisio deleted the categorical-data branch December 3, 2024 08:31
@Jiunixo
Copy link
Contributor

Jiunixo commented Dec 11, 2024

Hello,
Thank you for your work and all these nice and pedagogic examples.
Trying this specific one, I think that the following constraints are missing :

  • each employee must be assigned to exactly one shift
# 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)

So, if you test the original example with cost = {
"Alice": [2,4,1],
"Bob": [3,3,2],
"Charlie": [3,3,3]
},
then Bob is assigned to 2 shifts and Charlie to none.
I can create issue and PR if it helps.

@Joao-Dionisio
Copy link
Collaborator Author

Oops, you're exactly right @Jiunixo, thank you for pointing it out! If you wouldn't mind creating a PR, I can merge it straight away :)

Jiunixo added a commit to Jiunixo/PySCIPOpt that referenced this pull request Dec 11, 2024
@Jiunixo
Copy link
Contributor

Jiunixo commented Dec 11, 2024

It's done there #939
I'm not very used to GitHub, don't hesitate to tell me if something goes wrong : )

Joao-Dionisio pushed a commit that referenced this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants