Skip to content
New issue

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

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

Already on GitHub? # to your account

Removed constraints #189

Merged
merged 14 commits into from
Dec 10, 2024
Merged

Removed constraints #189

merged 14 commits into from
Dec 10, 2024

Conversation

termoshtt
Copy link
Member

@termoshtt termoshtt commented Dec 6, 2024

  • Introduce ommx.v1.RemovedConstraint message
    • This consists of ommx.v1.Constraint and removed reason, and stored in ommx.v1.Instance and ommx.v1.ParametricInstance.
    • This is created when the constraint is relaxed. This PR introduces new API Instance::relax_constraint to create a relaxed instance, and revert it with Instance::restore_constraint.
    • Removed reason is stored as short string removed_reason and string-string pair removed_reason_parameters because these are designed for human-readability rather than API re-usability
  • Instance::evaluate converts RemovedConstraint into EvaluatedConstraint as usual Constraints. These are merged into ommx.v1.Solution since users would also want to show the breakage of removed constraints with non-removed constraints

@termoshtt termoshtt self-assigned this Dec 6, 2024
@termoshtt termoshtt added the proto Changes in protobuf schema label Dec 6, 2024
@termoshtt termoshtt force-pushed the removed-constraints branch from 33fdbc2 to 771df1b Compare December 9, 2024 09:07
@termoshtt termoshtt added the rust Changes in Rust SDK label Dec 10, 2024
@termoshtt termoshtt marked this pull request as ready for review December 10, 2024 08:02
@termoshtt termoshtt merged commit e2bba8c into main Dec 10, 2024
29 checks passed
@termoshtt termoshtt deleted the removed-constraints branch December 10, 2024 08:13
termoshtt added a commit that referenced this pull request Dec 24, 2024
… removed constraints (#251)

- As removed constraints has been introduced in #189, this PR adds
`feasible_unrelaxed` field in `ommx.v1.Solution` and `SampleSet` to
represent the `State` is feasible in terms of removed constraints.
- `Instance.relax_constraint` and `Instance.restore_constraint` has been
exposed in Python SDK
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
proto Changes in protobuf schema rust Changes in Rust SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant