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

NL Formulation #34

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

k8culver
Copy link
Collaborator

@k8culver k8culver commented Dec 21, 2024

A continuation of @jlalbers work on the NL implementation. Fixed merge conflicts and integrated new features into both the NL and CQM formulations. Replaces PR #29

The NL model has changed quite a bit so please do a thorough review

Original Description:
"Nonlinear solver formulation and implementation for the employee scheduling demo. Update summary below:

Nonlinear formulation of the employee scheduling problem featured in the demo
Ability to select CQM or Nonlinear solver to run the demo
ModelParams dataclass to simplify passing of parameters to model creation/running functions
Update CQM manager constraint formulation so that max_consecutive_shifts can be passed directly to run_cqm instead of having to pass max_consecutive_shifts + 1
Add dwave-optimization>=0.3.0 to requirements.txt to allow scalar constant broadcasting
Requesting input on the following items:

Any other input on the formulation? After the formulation review I attempted to implement the array-based constraint for isolated days off as suggested, but the solver struggled with feasibility for this constraint even using long time limits so I reverted to the previous formulation. The only other change was boosting the objective value of preferred shifts from 2 to 100 which helped the solver assign more preferred shifts with less runtime.
Should we stick with the default time limit for NL or use some heuristic to calculate an appropriate one? I find that the NL solver struggles to find good solutions with the default time limit. I played around with using a heuristic assigning the time limit to the largest dimension of the assignments BinaryVariable but there might be a better way to do it. Currently the default time limit is used.
Should we allow the user to select a time limit when running the NL version? If so, should we also allow a time limit when running CQM? CQM performs well with the default time limit but NL struggles."

@k8culver k8culver self-assigned this Dec 21, 2024
@k8culver k8culver force-pushed the feature/nl-formulation branch from 49815c3 to 4780226 Compare December 24, 2024 00:17
@k8culver k8culver force-pushed the feature/nl-formulation branch from 4780226 to d8e2cbd Compare December 24, 2024 00:25
@k8culver k8culver marked this pull request as ready for review December 24, 2024 18:27
@k8culver k8culver mentioned this pull request Dec 24, 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.

2 participants