81 #define BRANCHRULE_NAME "RyanFoster" 82 #define BRANCHRULE_DESC "Ryan/Foster branching rule" 83 #define BRANCHRULE_PRIORITY 50000 84 #define BRANCHRULE_MAXDEPTH -1 85 #define BRANCHRULE_MAXBOUNDDIST 1.0 123 assert(
scip != NULL);
124 assert(branchrule != NULL);
126 assert(result != NULL);
133 assert(probdata != NULL);
139 for( i = 0; i < nitems; ++i )
146 assert(nlpcands > 0);
149 for( v = 0; v < nlpcands; ++v )
153 assert(lpcands[v] != NULL);
155 solval = lpcandsfrac[v];
162 assert(nconsids > 0);
165 for( i = 0; i < nconsids; ++i )
170 pairweights[id1][id1] += solval;
173 for( j = i+1; j < nconsids; ++j )
178 pairweights[id2][id1] += solval;
190 for( i = 0; i < nitems; ++i )
192 for( j = 0; j < i; ++j )
194 value = MIN(pairweights[i][j], 1-pairweights[i][j]);
196 if( bestvalue < value )
199 if(
SCIPisEQ(
scip, pairweights[i][j], pairweights[i][i])
200 &&
SCIPisEQ(
scip, pairweights[i][j], pairweights[j][j]) )
210 assert( bestvalue > 0.0 );
211 assert( id1 >= 0 && id1 < nitems);
212 assert( id2 >= 0 && id2 < nitems);
215 for( i = 0; i < nitems; ++i )
261 branchruledata = NULL;
266 assert(branchrule != NULL);
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Ryan/Foster branching rule.
#define BRANCHRULE_MAXDEPTH
#define SCIPallocClearBufferArray(scip, ptr, num)
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Constraint handler stores the local branching decision data.
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_VarData SCIP_VARDATA
enum SCIP_Retcode SCIP_RETCODE
Variable data containing the ids of constraints in which the variable appears.
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
int * SCIPvardataGetConsids(SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
#define BRANCHRULE_PRIORITY
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
#define SCIPallocBufferArray(scip, ptr, num)
Problem data for binpacking problem.
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
int SCIPgetDepth(SCIP *scip)
SCIP_VARDATA * SCIPvarGetData(SCIP_VAR *var)
struct SCIP_ProbData SCIP_PROBDATA
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define BRANCHRULE_MAXBOUNDDIST
int SCIPvardataGetNConsids(SCIP_VARDATA *vardata)
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
static SCIP_DECL_BRANCHEXECLP(branchExeclpRyanFoster)
SCIP_Longint SCIPgetNNodes(SCIP *scip)