GOBNILP  f164d83
Data Structures | Macros | Functions
matroid_cuts.c File Reference

Functions for finding matroid cuts. More...

#include "matroid_cuts.h"
#include "scip/scipdefplugins.h"
#include <string.h>
Include dependency graph for matroid_cuts.c:

Data Structures

struct  MATROID_AUXIPDATA
 Data for subIP for searching for matroid cuts. More...
 

Macros

#define min(A, B)   ((A) > (B) ? (B) : (A))
 

Functions

static SCIP_RETCODE AuxIPDataFree (SCIP *scip, MATROID_AUXIPDATA *auxipdata, int n, int circuit_size_lim)
 Frees sub-IP data. More...
 
static int choose (int n, int k)
 Computes n-choose-k. More...
 
static SCIP_Bool element_of (int n_a, int *a, int elt)
 is 'elt' a member of set 'a'? More...
 
SCIP_RETCODE Matroid_findCuts (SCIP *scip, ParentSetData *psd, SolutionInfo *solinfo, SCIP_SOL *sol, int *nGen, SCIP_CONSHDLR *conshdlr, SCIP_Bool addtopool, SCIP_Bool forcecuts, SCIP_Bool *found_efficacious_ptr, SCIP_Real limits_time, SCIP_Real limits_gap, SCIP_Real limits_absgap, int circuit_size_lim, int ground_set_size_lim, int *must_be_included, int n_must_be_included, int *must_be_excluded, int n_must_be_excluded, SCIP_Bool *cutoff)
 Main function for finding matroid cuts. More...
 
static int mypow2 (int i)
 computes 2^i More...
 
static int myunioni (int i, int n_a, int *a, int n_b, int *b, int *both)
 both = $a \cup b \setminus \{i\}$. More...
 
static SCIP_Bool subset_of (int n_a, int *a, int n_b, int *b)
 is 'a' a subset_of of 'b' ? More...
 
static SCIP_Bool subseti (int i, int n_a, int *a, int n_b, int *b)
 is $a$ a subset of $b \cup \{i\}$ ? More...
 

Detailed Description

Functions for finding matroid cuts.

Function Documentation

◆ AuxIPDataFree()

static SCIP_RETCODE AuxIPDataFree ( SCIP *  scip,
MATROID_AUXIPDATA auxipdata,
int  n,
int  circuit_size_lim 
)
static

Frees sub-IP data.

Parameters
scip(Main) SCIP instance
auxipdataData for the sub-IP (to be freed)
nNumber of BN variables in the acyclicity (dagcluster) constraint
circuit_size_limThe limit on the size of circuits

References MATROID_AUXIPDATA::circuit_vars, MATROID_AUXIPDATA::circuits_i, MATROID_AUXIPDATA::full_graph, MATROID_AUXIPDATA::in_ground_set, MATROID_AUXIPDATA::n_circuits_i, and MATROID_AUXIPDATA::subscip.

◆ choose()

static int choose ( int  n,
int  k 
)
static

Computes n-choose-k.

Parameters
nnumber of elements to choose from
ksize of chosen sets

Referenced by Matroid_findCuts().

◆ element_of()

static SCIP_Bool element_of ( int  n_a,
int *  a,
int  elt 
)
static

is 'elt' a member of set 'a'?

Parameters
n_asize of set a
aset a
eltan element

Referenced by Matroid_findCuts().

◆ Matroid_findCuts()

SCIP_RETCODE Matroid_findCuts ( SCIP *  scip,
ParentSetData psd,
SolutionInfo solinfo,
SCIP_SOL *  sol,
int *  nGen,
SCIP_CONSHDLR *  conshdlr,
SCIP_Bool  addtopool,
SCIP_Bool  forcecuts,
SCIP_Bool *  found_efficacious_ptr,
SCIP_Real  limits_time,
SCIP_Real  limits_gap,
SCIP_Real  limits_absgap,
int  circuit_size_lim,
int  ground_set_size_lim,
int *  must_be_included,
int  n_must_be_included,
int *  must_be_excluded,
int  n_must_be_excluded,
SCIP_Bool *  cutoff 
)

Main function for finding matroid cuts.

Parameters
scipSCIP data structure
psdfamily variable information
solinfoinformation about the solution to be separated
solsolution to be separated
nGen*nGen is number of cutting planes added ( even non-efficacious ones are added )
conshdlrconstraint handler
addtopoolwhether to add any found cut to the global cut pool
forcecutswhether to force cuts to be added
found_efficacious_ptrto return whether an efficacious cutting plane was found
limits_timelimit on how long to spend sub-IP solving
limits_gaplimit on size of gap in sub-IP
limits_absgaplimit on size of the absolute gap in sub-IP
circuit_size_limupper bound on size of circuits
ground_set_size_limupper bound on size of ground set
must_be_includedset of nodes which must be included in any found matroid
n_must_be_includedsize of the set of nodes which must be included in any matroid
must_be_excludedset of nodes which must be excluded from any matroid
n_must_be_excludedsize of the set of nodes which must be excluded from any found matroid
cutoffcutoff = TRUE if a cut is added which leads to a cutoff ( set by SCIPaddRow )

References choose(), MATROID_AUXIPDATA::circuit_vars, MATROID_AUXIPDATA::circuits_i, element_of(), MATROID_AUXIPDATA::full_graph, MATROID_AUXIPDATA::in_ground_set, mypow2(), myunioni(), ParentSetData::n, MATROID_AUXIPDATA::n_circuits_i, ParentSetData::nodeNames, MATROID_AUXIPDATA::subscip, and subset_of().

Here is the call graph for this function:

◆ mypow2()

static int mypow2 ( int  i)
static

computes 2^i

Parameters
iFunction returns 2^i

Referenced by Matroid_findCuts().

◆ myunioni()

static int myunioni ( int  i,
int  n_a,
int *  a,
int  n_b,
int *  b,
int *  both 
)
static

both = $a \cup b \setminus \{i\}$.

Both a and b are assumed to contain i. Sufficient space must have already been allocated for 'both' before calling this function

Parameters
n_aan element (of both a and b)
asize of set a
n_bset a
bsize of set b
bothset b set both (output)

Referenced by Matroid_findCuts().

◆ subset_of()

static SCIP_Bool subset_of ( int  n_a,
int *  a,
int  n_b,
int *  b 
)
static

is 'a' a subset_of of 'b' ?

Parameters
n_asize of set a
aset a
n_bsize of set b
bset b

Referenced by Matroid_findCuts().

◆ subseti()

static SCIP_Bool subseti ( int  i,
int  n_a,
int *  a,
int  n_b,
int *  b 
)
static

is $a$ a subset of $b \cup \{i\}$ ?

Parameters
ian element
n_asize of set a
aset a
n_bsize of set b
bset b