[Scip] getting LP dual solutions

Alberto Ceselli ceselli at dti.unimi.it
Thu Jan 22 18:31:54 MET 2009


I see ... so your suggestion is to work with rows and cols instead of
constraints and variables whenever possible, and to check the name given
by the constraint handler just as a last resort (e.g. you have to check
some property of a linear constraint which depends on the dual value,
and you really know that the constraint is in the LP), right?

Ok, many thanks!

Alberto

On Thu, 2009-01-22 at 17:13 +0100, Timo Berthold wrote: 
> Hi Alberto.
> 
> > Is there a method for getting the dual solution for generic constraints,
> There is no such method, since there is no matching constraints <=> dual 
> variable.
> SCIP is able to handle more general constraints then just linearizable ones, 
> therefore it may happen that a constraint is not represented in the LP (e.g. 
> bounddisjunction) or even that there are several rows in the LP for a single 
> constraint (e.g. AND).
> 
> > or to get the type of a constraint given its pointer?
> What you may do to determine the type of a constraint is to ask for the name 
> of its corresponding cons handler:
> strcmp(SCIPconshdlrGetName(SCIPconsGetHdlr(cons)), "linear" )) == 0
> 
> >. Is there a way of getting the value of the dual variable of each constraint 
> in the last LP solution?
> However, the method described above is a bit ugly.
> If you are just interested in the duals of the LP rows, you may better use
> SCIP_Real SCIProwGetDualsol( ) 
> The LP rows can be obtained by
> SCIPgetLPRowsData()
> 
> Best regards,
> Kati and Timo
> 
> 
> Am Donnerstag 22 Januar 2009 12:18:47 schrieb Alberto Ceselli:
> > Hi all!
> >
> > I'm using SCIP as a general purpose solver, that is I read a problem
> > in .mps format and try to optimize it. Let's say I set a nodes limit and
> > stop optimization at the root node. Is there a way of getting the value
> > of the dual variable of each constraint in the last LP solution?
> >
> > I've tried to get the vector of problem constraints with
> >
> > SCIP_CONS ** conss = SCIPgetConss(scip);
> >
> > guessing there's a method like
> >
> > SCIPgetDualsol(scip, conss[i])
> >
> > but all I've been able to find are methods like
> >
> > SCIPgetDualsolLinear(scip, conss[i]) or
> > SCIPgetDualsolSetppc(scip, conss[i])
> >
> > However, I don't know in advance which type the constraint would be.
> >
> > Is there a method for getting the dual solution for generic constraints,
> > or to get the type of a constraint given its pointer?
> >
> > Many thanks,
> >
> > Alberto
> >
> > _______________________________________________
> > Scip mailing list
> > Scip at zib.de
> > http://listserv.zib.de/mailman/listinfo/scip
> 
> 



More information about the Scip mailing list