Skip to content

Support for new NLP in COPT 7.2.5 #39

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

Open
Salancelot opened this issue Mar 24, 2025 · 7 comments
Open

Support for new NLP in COPT 7.2.5 #39

Salancelot opened this issue Mar 24, 2025 · 7 comments

Comments

@Salancelot
Copy link

In COPT 7.2.5, NLP is supported, but now only in C API, see General Nonlinear Programming (NLP). Is there any plan to support it in pyoptinterface?

@metab0t
Copy link
Owner

metab0t commented Mar 24, 2025

Definitely yes!

The NLP API of COPT and Gurobi are all based on expression tree and will be supported in PyOptInterface after careful investigation.

@Salancelot
Copy link
Author

@metab0t by the way, is it possible to formulate an NLP problem using POI.ipopt and then write it to a .nl file? I didn't fild a API related to "write".

@metab0t
Copy link
Owner

metab0t commented Apr 3, 2025

Writing NL file is not supported now.

I am currently working on a unified (and more intuitive) NLP functionality to support NLP with COPT, Gurobi and Ipopt in PyOptInterface. Keep tuned!

The new NLP interface can capture the expression graph of each constraint and objective that makes writing NL file possible.

However, supporting NL file is not a easy task and should belong to a more ambitious project to achieve seamless interoperation between POI and the AMPL ecosystem, and I have no plans to start it now.

@Salancelot
Copy link
Author

Writing NL file is not supported now.

I am currently working on a unified (and more intuitive) NLP functionality to support NLP with COPT, Gurobi and Ipopt in PyOptInterface. Keep tuned!

The new NLP interface can capture the expression graph of each constraint and objective that makes writing NL file possible.

However, supporting NL file is not a easy task and should belong to a more ambitious project to achieve seamless interoperation between POI and the AMPL ecosystem, and I have no plans to start it now.

Thanks for the detailed explanation! Fully understand the complexity of NL file support, and I'm excited about PyOptInterface's future NLP capabilities. The current functionality already meets my needs, and your roadmap prioritization makes perfect sense. Looking forward to the updates!

@rschwarz
Copy link

rschwarz commented Apr 3, 2025

This may be off-topic here, but Pyomo does support exporting models to NL format, all by itself (without using a solver).

@metab0t
Copy link
Owner

metab0t commented Apr 3, 2025

This may be off-topic here, but Pyomo does support exporting models to NL format, all by itself (without using a solver).

@rschwarz Yes. The NL file writer and solution reader are the primary method to communicate with solvers in Pyomo (as an open source alternative of AMPL), so it has a powerful expression system and NL export functionality from the very beginning. The direct and appsi-persistent interfaces are added later to overcome the drawbacks of file-based IO. (My knowledge of Pyomo might be inaccurate)

@rschwarz
Copy link

rschwarz commented Apr 3, 2025

I just wanted to point it out to users who might need NL export today, not as a suggestion for POI to follow 😃

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

3 participants