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

ommx.v1.ParametericInstance and Instance.penalty_method in Python SDK #200

Merged
merged 19 commits into from
Dec 12, 2024

Conversation

termoshtt
Copy link
Collaborator

@termoshtt termoshtt commented Dec 10, 2024

@termoshtt termoshtt self-assigned this Dec 10, 2024
termoshtt added a commit that referenced this pull request Dec 11, 2024
…change (#202)

Split from #200 about Rust SDK side.

- `to_qubo` looks converting non-QUBO instance into QUBO, but this
function only converts its format.
termoshtt added a commit that referenced this pull request Dec 11, 2024
Split from #200 

Breaking change
---------
- Rename `Instance::check_decision_variables` to
`Instance::validate_decision_variable_ids` to make the objective clear.

other changes
--------------
- Create `Instance::validate` for checking all
- Add `Instance::validate_constraint_ids` to check constraint ID
duplication including removed constraints.
@termoshtt termoshtt changed the title QUBO and PUBO output in Python SDK ParametericInstance in Python SDK Dec 12, 2024
@termoshtt termoshtt changed the title ParametericInstance in Python SDK ommx.v1.ParametericInstance and Instance.penalty_method in Python SDK Dec 12, 2024
@termoshtt termoshtt marked this pull request as ready for review December 12, 2024 06:30
@termoshtt termoshtt merged commit 61723a7 into main Dec 12, 2024
29 checks passed
@termoshtt termoshtt deleted the qubo-pubo-py branch December 12, 2024 06:31
@termoshtt termoshtt added the python Changes in Python SDK label Dec 12, 2024
@termoshtt termoshtt mentioned this pull request Dec 17, 2024
termoshtt added a commit that referenced this pull request Dec 17, 2024
Roughly, the `Instance.penalty_method` introduced in #200 converts a
constrained problem

$$
\begin{align*}
  \min_x &f(x) & \\
  \text{s.t.} &g_i(x) = 0 & (\forall i)
\end{align*}
$$

into an unconstrained parametric problem with parameters $\lambda_i$

$$
\min_x f(x) + \sum_i \lambda_i g_i(x)^2
$$

On this PR, `Instance.uniform_penalty_method` is introduced. This
converts above into a single parameter unconstrained problem

$$
\min_x f(x) + \lambda \sum_i g_i(x)^2
$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Changes in Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant