[SCIP] R: R: Access Dual Values with SCIP
Enrico Calandrini
e.calandrini at studenti.unipi.it
Mon Jan 27 22:25:59 CET 2025
Dear Marco,
Thank you for your quick reply.
To clarify, I am currently storing the constraints I initially created in a structure called cons, and I retrieve the dual values of the i-th constraint using the following approach:
SCIPgetDualSolVal(scip, cons[i], &pi[i], NULL);
So, I am not querying the transformed constraint for dual variables. Would it be more appropriate to first use the method SCIPgetTransformedCons to retrieve the transformed constraints and then query the dual values? This is why I am not getting any dual values?
Thank you for your help!
Best regards,
Enrico
________________________________
Da: Marco Lübbecke <marco.luebbecke at rwth-aachen.de>
Inviato: lunedì 27 gennaio 2025 22:12
A: Enrico Calandrini <e.calandrini at studenti.unipi.it>
Cc: Hoen, Alexander <hoen at zib.de>; scip at zib.de <scip at zib.de>
Oggetto: Re: [SCIP] R: Access Dual Values with SCIP
Hi Enrico,
do you query the *transformed* constraints for dual variables?
All the best, Marco
Am Mo., 27. Jan. 2025 um 21:26 Uhr schrieb Enrico Calandrini <e.calandrini at studenti.unipi.it<mailto:e.calandrini at studenti.unipi.it>>:
Dear Alexander,
First of all, thank you very much for your response.
To provide a bit more context, I’m working with the SCIP C-API and creating the LP model using the basic methods (e.g., SCIPcreateConsBasicLinear, SCIPaddCoefLinear, etc.). After constructing the model, I simply call SCIPSolve to solve it. As far as I understand, this should automatically use Soplex to solve the problem.
However, I’ve encountered an issue: when I run the model without disabling presolve, SCIP is unable to provide dual solutions. In contrast, when I disable presolving, the computation slows down, but I do receive the dual values. I’m curious to understand whether it is always necessary to disable presolve in order to retrieve the dual solutions, or if there is another way to obtain them.
Thank you again for your time and assistance!
Best regards,
Enrico
________________________________
Da: Hoen, Alexander <hoen at zib.de<mailto:hoen at zib.de>>
Inviato: lunedì 27 gennaio 2025 20:34
A: Enrico Calandrini <e.calandrini at studenti.unipi.it<mailto:e.calandrini at studenti.unipi.it>>; scip at zib.de<mailto:scip at zib.de> <scip at zib.de<mailto:scip at zib.de>>
Oggetto: Re: Access Dual Values with SCIP
Dear Enrico,
for pure LP dual values are well-defined. Dual values represent the change in the objective function per unit increase in the right-hand side of a constraint, assuming the constraint remains binding.
For MIP, the situation is more complex and the definition of the duality no longer holds due to the variables' integrality. Therefore, SCIP typically does not care about these dual values.
If you want to solve LPs directly you can use the underlying LP Solver Soplex to obtain the dual solution of the LP.
Best,
Alexander
________________________________
From: Scip <scip-bounces at zib.de<mailto:scip-bounces at zib.de>> on behalf of Enrico Calandrini <e.calandrini at studenti.unipi.it<mailto:e.calandrini at studenti.unipi.it>>
Sent: Monday, January 27, 2025 6:52:18 PM
To: scip at zib.de<mailto:scip at zib.de>
Subject: [SCIP] Access Dual Values with SCIP
Hi everyone,
I hope this message finds you well.
I am currently working with SCIP and have a question regarding the retrieval of dual values. Specifically, I would like to confirm whether it is necessary to disable presolve in order to access dual values reliably.
Could you kindly clarify how presolve interacts with dual value computation and if there are any recommended settings to ensure the dual values can be retrieved without issue?
Thank you very much for your time and assistance. I appreciate the incredible work you’ve done with SCIP!
Looking forward to your response.
Best regards,
Enrico Calandrini
University of Pisa, Department of Computer Science
_______________________________________________
Scip mailing list
Scip at zib.de<mailto:Scip at zib.de>
https://listserv.zib.de/mailman/listinfo/scip
--
Prof. Dr. Marco Lübbecke
RWTH Aachen University
Chair of Operations Research
Kackertstrasse 7
D-52072 Aachen
Germany
fon / fax: +49 241 80-93362 / 92369
marco.luebbecke at rwth-aachen.de<mailto:marco.luebbecke at rwth-aachen.de>
www.or.rwth-aachen.de/luebbecke<http://www.or.rwth-aachen.de/luebbecke>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20250127/0a81cbb8/attachment.html>
More information about the Scip
mailing list