[Scip] Getting duals solution in MIP solving
Gerald Gamrath
gamrath at zib.de
Sun Mar 10 11:17:48 MET 2013
Hi Vivek,
normally, when you do pricing, you don't read in a standard .lp file,
but you write your own reader which reads in some problem data, creates
the model constraints and initializes some pricer data structure. How do
you do it? Your lp-file contains just the starting restricted problem
and your pricer gets its information somehow, too?
What somehow does not fit in your reports is that on the one hand, cited
the presolving output with all the different kinds of constraints, but
on the other hand, you transformed problem which you write does not
contain any constraints? Is this really the same run? How do you write
your problem?
In any case, there is a flag for the constraints which specifies whether
priced-in variables will be added to a constraint during solving. This
means that no or only a limited amount of presolving can be performed
(you don't know which variables will be added with which constraints),
and also no constraint upgrades will be done. If you read in an lp-file,
this flag (called "modifiable") will be set to FALSE. Thus, you need to
set this flag to TRUE for all constraints to which priced variables can
be added by using SCIPsetConsModifiable(), see:
http://scip.zib.de/doc/html/scip_8h.shtml#ab2b88302a2ccd6e18ec932fcc15ad3db
When creating the constraints by hand, you need to set the modifiable
flag in the SCIPcreateConsLinear() method to TRUE.
If you do this, all constraints should stay linear constraints. Of
course, if you create the constraints yourself, you could also create
constraints of other types, in this case, you would need to use the
corresponding SCIPgetDualsolXYZ() method.
Best,
Gerald
Am 10.03.2013 07:57, schrieb Vivek Periaraj:
> Hi Gerald,
>
> At a given node, when PRICERREDCOST is being called, I tried to write the problem object. But it contains nothing.
>
> At the node SCIPisTransformed(scip) returns true.
>
> Following is the output of the LP file.
>
> \ SCIP STATISTICS
> \ Problem name : t_orgmodel.lp
> \ Variables : 0 (0 binary, 0 integer, 0 implicit integer, 0 continuous)
> \ Constraints : 0
> \ Obj. scale : 1
> \ Obj. offset : -7860.74136294638
> Minimize
> Obj:
> Subject to
> Bounds
> End
>
> I think this is why I am not getting any duals.
>
> Thanks,
> Vivek.
>
> ----- Original Message -----
>
> From: "Gerald Gamrath" <gamrath at zib.de>
> To: "Vivek Periaraj" <vivek.periaraj at gmail.com>
> Cc: scip at zib.de
> Sent: Sunday, March 10, 2013 3:57:46 AM
> Subject: Re: [Scip] Getting duals solution in MIP solving
>
> Dear Vivek,
>
> you do not need to call SCIPtransformProb() yourself, that is done
> automatically when you start the solving process by calling SCIPsolve().
> The transformation results in a copy of the original problem, which is
> used during the (pre)solving process, for example when constraints are
> removed, bounds are changed, etc.
>
> Therefore, you need to work with the transformed constraints in the
> PRICERREDCOST callback. I guess, you still work with the original
> constraints, you can check that by calling SCIPconsIsTransformed() on
> the constraints. If they are not transformed yet, you can get the
> corresponding transformed one by calling SCIPgetTransformedCons() or
> SCIPgetTransformedConss() for getting the transformed constraints for an
> array of constraints. See
> http://scip.zib.de/doc/html/scip_8h.shtml#ac783997fa88d9b38b4bb7cfc0c101e95
> http://scip.zib.de/doc/html/scip_8h.shtml#a11bfa7463e407dab949f3ac77e2e051b
>
> Best,
> Gerald
>
> Am 09.03.2013 18:30, schrieb Vivek Periaraj:
>> Hi List,
>>
>> I am trying to implement a pricer but I am unable to get any dual solutions from the problem object. The following are the steps I did:
>>
>> 1) I loaded default plugins
>> 2) I loaded a lp file into SCIP problem object using SCIPreadProb()
>> 3) I initialize and activate the pricer.
>> 4) I invoke SCIPsolve()
>>
>> In the PRICERREDCOST callback, I call SCIPgetDualsolLinear() and all the duals turn out to be zeros. I tried several problems and same is the case.
>>
>> I tried SCIPtransformProb() but still duals were zeros.
>>
>> Am I missing any step? Do I have to enable/disable any other plugins? Using soplex and cpx as the LP solver exhibit the same problem.
>>
>> Regards,
>> Vivek.
>>
>>
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
More information about the Scip
mailing list