[SCIP] accessing reduced costs of variables of an LP in optimality
Gregor Hendel
hendel at zib.de
Sat Sep 9 12:52:06 CEST 2017
Dear Ahmad,
as you noticed yourself, you can only access the actual reduced costs
(corresponding to the solved LP at the current focus node) during the
solving stage. When creating a heuristic, you can set the right timing
mask such that it is only called when an LP was solved at a node, using
the timing SCIP_HEURTIMING_AFTERLPNODE.
<http://scip.zib.de/doc/html/type__timing_8h.php#ac4cb022a363958364724303ce7a76897>
In addition, you must ensure yourself that the LP was solved to
optimality for correct reduced costs by testing SCIPgetLPSolStat()
against SCIP_LPSOLSTAT_OPTIMAL.
FYI: You can also access information about the best reduced costs (for
root reduced cost propagation) that SCIP found during the root LP
processing using the methods SCIPvarGetBestRootRedcost,
SCIPvarGetBestRootSol, and SCIPvarGetBestRootLPObjval.
Let me know if this helps you continue, or if you need further advice on
this.
Have a nice weekend
Gregor
Am 06.09.2017 um 10:27 schrieb Ahmad Moradi:
> Dear SCIP community,
>
> I am implementing a heuristic algorithm who seeks to find a good
> (primal) solution of a given MILP. The algorithm actually starts by
> looking at reduced-cost value of variables after solving LP relaxation
> of the MILP.
>
> I simply coded the LP and solved it. Then I used the method
> SCIPgetVarRedcost() to see reduced-cost value of my original LP
> variables. However, I noticed that some of the values are negative,
> contradicting to optimality as the LP has minimization objective
> sense. Then I found that scip is not in the solving stage
> (SCIP_STAGE_SOLVING) as required by SCIPgetVarRedcost()... is that the
> why some reduced-costs get negative? if so, how can I access correct
> reduced cost values (according to optimal basis).
>
> Bests,
> Ahmad
>
>
> _______________________________________________
> 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/20170909/fed270f6/attachment.html>
More information about the Scip
mailing list