[SCIP] Exposing Cutting Plane Management

Marc Pfetsch pfetsch at mathematik.tu-darmstadt.de
Sat Jun 12 18:56:18 CEST 2021



Dear Max,

it sounds like you really want control over the cutting plane selection
process. In this case, the best - and possibly only - way is to modify
the original C code. Then you also do not need to worry about
public/private functions. I am adding more comments below ...

> I would like to gain more control over the cutting plane loop and mock
> up Python functions that can, e.g. 
> 
>  1. Call SCIP to compute cuts and add to separation storage
>  2. Pass cut to SCIP to add to the current LP (or only at root node)

This can already be done now and is the default behavior. However, from
what you wrote before, I suppose that you actually want to change the
way in which the cuts are selected from the separation storage.

Or do you want to use the SCIP code independently of a SCIP run?

> Unfortunately, most functions related to cut management appear to be
> part only of the internal API. 
> As a running example, take the function sepastoreApplyCut. 

Yes, indeed. I don't think it make sense to make this public, e.g. in
python.

> My question is what is the best way to go about what I want to achieve. 
> I have built both SCIP and PySCIPOpt from source.
> 
> I can think of several approaches and need help with prioritizing:
> 
>  1. Is it possible to change compilation settings to something like
>     “developer mode” to make everything public? 

No, not in python. In C you can fake this, but this should only be done
if you know what you are doing.

>  2. What files would I need to change to turn a function
>     like sepastoreApplyCut from internal to public?

For C, you need to use the export in sepastore.h. In python, you would
need to extend PySCIPOpt.

>  3. Alternatively, can I just declare and define a new separation
>     storage class or sepastoreApplyCut function, copy the definitions
>     but have this be public? 

The easiest way to achieve is is to change or copy the original C code.

> Alternatively, if turning private functions into public ones fails, are
> there recommended public functions I could use instead to mirror the
> functionality I desire?
> For example, there is addCons, which I believe is public.
> But I am hesitant of transforming a SCIP_CUT to a SCIP_CONS and I also
> think it is improper to add a cut as a constraint. 

Adding cuts is done via SCIPaddRow() (in your case SCIP_CONS is only
needed if you want to implement a constraint handler.)

I hope this helps.

Best

Marc


More information about the Scip mailing list