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

Logarithmic expression on a decision variable #30

Open
diegorossit opened this issue Feb 15, 2022 · 4 comments
Open

Logarithmic expression on a decision variable #30

diegorossit opened this issue Feb 15, 2022 · 4 comments

Comments

@diegorossit
Copy link

diegorossit commented Feb 15, 2022

Hi!

I would like to implement a constraint that has a logarithmic expression applied on a decision variable. I think we should be able to this follwoing instructions in https://github.com/scipopt/JSCIPOpt#readme but this is quite complex for beginners. Any suggestion? I see that in the Python PySCIPOpt is already implemented.

Thanks in advance for your time.

@ambros-gleixner
Copy link
Member

Agreed, but this would be the only way to do so via JSCIPOpt. If you are motivated to build this extension, it is a good idea to look at the PySCIPOpt implementation.

@diegorossit
Copy link
Author

Hi!

Considering I implement the logarithmic expression, do you know if I would be able to optimize a mixed-integer problem with an objective function of the form x1 * log(1 + x2)? in which x1 and x2 are two continuous positive variables. This would imply building the logarithmic expression "log(1 + x2)" and then adding it in the "createConsQuadratic" function as an element to multiply the term "x1".

Thanks in advance for your kind time.

@ambros-gleixner
Copy link
Member

Yes, that is possible, but you would not add the log to a quadratic constraint, but formulate the entire expression in one nonlinear constraint.

@diegorossit
Copy link
Author

Thanks for your help. I looked at the files and PySCIPOpt has a type SCIP_EXPR which is not implemented in JSCIPOpt. This type is used in both SCIPcreateExprLog and SCIPcreateConsNonlinear. So it's harder than I thought.
I think I'll wait that more skilled collaborators can extend it.

Anyway, thanks for your kind help and time. Regards!

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

No branches or pull requests

2 participants