[Scip] How to find out which constraints were active during the solving process

Rostislav Stanek rostislav.stanek at uni-graz.at
Mon Apr 29 11:57:23 MEST 2013


Dear SCIP community,
it is not possible to get such a statistic form SCIP. The only one 
possibility is to check out which constraints are satisfied with 
equality in an event handler after solving every LP.
I would like to thank especially Gerald Gamrath form the ZIB who helped 
via more private e-mails.
Best regards.
Rostislav Stanek


Dne 18.4.2013 18:01, Rostislav Stanek napsal(a):
> Dear Gerald,
> thank you for your response. Yes I add them via SCIPaddCons(). The idea
> was following: In my model I do not need all constraint which define the
> polytope (it depends on the direction given by the objective function)
> but I do not know which. In my research I would like to minimize the
> number of added constraints without changing the objective value of the
> optimal solution. To do it I would like to generate a statistics showing
> me which constraints were really used and which not (for concrete
> instances). So I mean “active” in the sense “fulfilled with equality” in
> the concrete node in the concrete solved LP. This information I would
> collect during the whole process.
> Is it possible to get such a information?
> Thanks again.
> Best regards
> Rostislav
>
> P.S.: Excuse me if I am asking something which should be me clear but I
> was not able to find the answer on the Internet.
>
>
>
> Dne 18.4.2013 17:47, Gerald Gamrath napsal(a):
>> On 18.04.2013 17:32, Rostislav Stanek wrote:
>>> Dear Stefan,
>>> thank you very much for your quick response. I tried this solution now
>>> but I still get false for all constraints. Is it correct that the
>>> function does not ask the SCIP-solver as parameter?
>> http://scip.zib.de/doc/html/pub__cons_8h.shtml#a8d003272514fb88ff433a01f0ef9729a
>>
>> Concerning your other question: What constraints are those which you
>> check? How did you create them? Did you add them via SCIPaddCons()?
>>
>> I'm also not sure whether we mean the same thing with active:
>> SCIPconsIsActive() means essentially that the constraint is valid at the
>> current node, if you do not add local constraints, that it is a model
>> constraint. It has nothing to do with whether the current (LP) solution
>> fulfills an inequality as an equality.
>>
>> What do you want to check and why? Perhaps also the statistics might
>> give you some (more general) info?
>>
>> Best,
>> Gerald
>>
>>
>>> Best regards
>>> Rostislav
>>>
>>>
>>> Dne 18.4.2013 14:03, Stefan Vigerske napsal(a):
>>>> Hi,
>>>>
>>>> probably you look at the constraints in the original problem, but you
>>>> want the one from the transformed problem.
>>>>
>>>> Try getting the transformed cons first:
>>>>       SCIP_CONS* tconstraint;
>>>>       SCIP_CALL( SCIPgetTransformedCons(scip, constraint, &tconstraint) );
>>>>       if( tconstraint && SCIPconsIsActive(tconstraint) )
>>>>       {
>>>>         /* found one */
>>>>       }
>>>>
>>>> See also
>>>> http://scip.zib.de/doc/html/scip_8h.shtml#ac783997fa88d9b38b4bb7cfc0c101e95
>>>>
>>>> Best,
>>>> Stefan
>>>>
>>>> On 04/18/2013 01:50 PM, Rostislav Stanek wrote:
>>>>> Dear SCIP community,
>>>>>
>>>>> I have the following problem: I would like to find out which constraints
>>>>> were active during the solving process and which did not at all.
>>>>>
>>>>> Thus I defined an event handler and set the events
>>>>> SCIP_EVENTTYPE_FIRSTLPSOLVED and SCIP_EVENTTYPE_LPSOLVED and
>>>>> SCIP_EVENTTYPE_NODESOLVED.
>>>>>
>>>>> Then I call SCIPconsIsActive(constraint) in the method
>>>>> SCIP_DECL_EVENTEXEC(EventHandlerLPSolved::scip_exec) and always obtain
>>>>> false. (I have references to all constraints (std::vector<SCIP_CONS *>
>>>>> &constraints;) in the class).
>>>>>
>>>>> Am I doing something wrong? Is it possible to get out all constraints
>>>>> used during the solving process?
>>>>>
>>>>> Thank you very much for all hints and tips.
>>>>>
>>>>> Yours faithfully
>>>>> Rostislav Stanek
>>>>> _______________________________________________
>>>>> Scip mailing list
>>>>> Scip at zib.de
>>>>> http://listserv.zib.de/mailman/listinfo/scip
>>>>>
>>> _______________________________________________
>>> Scip mailing list
>>> Scip at zib.de
>>> http://listserv.zib.de/mailman/listinfo/scip
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list