Replies: 1 comment 6 replies
-
Hi @Aschwins , if you want to use IPOPT this could be problematic, because IPOPT only supports continuous variables. So I guess in the most general case any constraint relying on binary decision variables is not so easy to realize. I think there have been approaches to overcome this limitation (e.g. #243 ), but @dlinzner-bcs probably knows more about that. I think pyomo offers a solver for MINLP https://pyomo.readthedocs.io/en/stable/contributed_packages/mindtpy.html, so maybe this is an option for you if you want to realize the NChooseK constraint via binary variables. Cheers, |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Really glad I came across this repo, because I'm learning a lot of new things! I have a question and would like to discuss some ideas.
I have a product development problem which we solve using Bayesian Optimization, but we have a tricky constraint. We have a bunch of ingredients as explanatory variables which we can use to create products. These products have properties which we predict and want to optimize. The tricky constraint is that we can only use 5 ingredients of a set of around 30 total, this really sounds like the NChooseKConstraint which I found a discussion about here by @jduerholt , which led me to this repo.
Really interesting idea and I think exactly what I'm looking for. I was trying to solve this by introducing binary decision variables$b_0, b_i,...$ where $b_i$ is 1 if $x_i > 0$ and 0 otherwise. Then add a linear constraint $\sum(b_i) < 6$ . Have you thought about this as well? What would be the difference? Any problems I'm overlooking with ipopt maybe?
Would love to hear your thoughts!
Best,
Aschwin
Beta Was this translation helpful? Give feedback.
All reactions