[SCIP] PYSCIPOPT: Dual solutions in a NLP and constraint handler for SOC constraints.

Xu, Liding liding.xu at zib.de
Mon Dec 1 08:32:24 CET 2025


Hi Pedro,

    1, SCIP can use IPOPT as a solver for nonlinear and nonconvex problems. Thus, we cannot assume that dual exists generally. Even if your problem is convex, pyscipopt does not provide an interface to access the dual information, so it always returns zero. A better choice would be to call IPOPT yourself, rather than via SCIP.

   2. Since the SOC handler already exists, if your problem has a nonlinear constraint of  SOC type, then the handler will detect the constraint automatically and handle the other tasks (e.g., linearization) for you.


  Hope this helps you.


Best regards,

Liding Xu

________________________________
From: Scip <scip-bounces at zib.de> on behalf of PEDRO ENRIQUE MALDONADO <pedro.maldonado.c at ug.uchile.cl>
Sent: Monday, December 1, 2025 3:12:30 AM
To: scip at zib.de
Subject: [SCIP] PYSCIPOPT: Dual solutions in a NLP and constraint handler for SOC constraints.

Hi,

I hope you are doing well. I would like to ask you a few questions
regarding the implementation of the model in the Python wrapper:

1- I have downloaded IPOPT and configured the solver parameters
accordingly. In my research, and after reviewing the .pxd and .pxi
files, I noticed that using the NLRow class one should be able to
access the dual solution associated with these rows. However, in my
experience, this function always returns 0.

I know there are nonlinear rows, since the getConshdlrName() method of
the Constraint class returns "nonlinear" for some of them, and I also
know that the dual value should not be 0 for all of these constraints.
Moreover, as far as I understand, IPOPT should always return dual
solutions because it is a primal–dual interior-point solver. For that
reason, I do not understand why I am unable to retrieve them.

2- I am aware that the original SCIP code includes several constraint
handlers, such as the Quadratic and Second-Order Cone constraint
handlers. However, I have noticed that in the Python wrapper all
constraints are classified as either linear or nonlinear, and this
classification appears to be hard-coded in the Constraint class. I
would greatly appreciate any guidance on whether there is an
accessible way to add the SOC constraint handler using the existing C
implementation. I am not very experienced with the C language, and so
far creating the plugin directly in Python has not been successful.

Thank you very much for your help.

Best regards,
Pedro Maldonado

_______________________________________________
Scip mailing list
Scip at zib.de
https://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20251201/f8bc0d52/attachment.html>


More information about the Scip mailing list