heur_octane.c
Go to the documentation of this file.
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 40 #define DEFAULT_USEFRACSPACE TRUE /**< use heuristic for the space of fractional variables or for whole space? */ 47 int f_first; /**< {0,1}-points to be generated at first in order to check whether restart is necessary */ 49 SCIP_Bool usefracspace; /**< use heuristic for the space of fractional variables or for the whole space? */ 50 SCIP_Bool useobjray; /**< should the inner normal of the objective be used as one ray direction? */ 51 SCIP_Bool useavgray; /**< should the average ray of the basic cone be used as one ray direction? */ 52 SCIP_Bool usediffray; /**< should difference between root sol and current LP sol be used as one ray direction? */ 53 SCIP_Bool useavgwgtray; /**< should the weighted average ray of the basic cone be used as one ray direction? */ 54 SCIP_Bool useavgnbray; /**< should the average ray of the nonbasic cone be used as one ray direction? */ 63 /** tries to insert the facet obtained from facet i flipped in component j into the list of the fmax nearest facets */ 98 /* inserting new facet into list, new facet is facet at position i flipped in coordinate j, new distance lam */ 108 /** constructs a solution from a given facet paying attention to the transformations made at the beginning of OCTANE */ 130 /* after permutation, a variable should be set to 1, iff there was no reflection in this coordinate and the hit 145 /** generates the direction of the shooting ray as the inner normal of the objective function */ 165 /** generates the direction of the shooting ray as the difference between the root and the current LP solution */ 187 /** generates the direction of the shooting ray as the average of the extreme rays of the basic cone */ 240 SCIP_CALL( SCIPgetLPBInvACol(scip, SCIPcolGetLPPos(SCIPvarGetCol(subspacevars[j])), tableaurows[j], tableaurowinds[j], &ntableaurowinds[j]) ); 361 raydirection[j] += tableaurows[j][tableaurowind] / (rownorm[tableaurowind] * rowweights[tableaurowind]); 389 /** generates the direction of the shooting ray as the average of the normalized non-basic vars and rows */ 508 /** translates the inner point of the LP to an inner point rayorigin of the unit hyper octahedron and 606 /* reverse search for facets from which the actual facet can be got by a single, decreasing + to - flip */ 607 /* a facet will be inserted into the queue, iff it is one of the fmax closest ones already found */ 608 for( j = 0; j < nsubspacevars && !facets[i][j] && SCIPisFeasGT(scip, negquotient[j], lambda[i]); ++j ) 617 /* reverse search for facets from which the actual facet can be got by a single, nonincreasing - to + flip */ 618 /* a facet will be inserted into the queue, iff it is one of the fmax closest ones already found */ 619 for( j = nsubspacevars - 1; j >= 0 && facets[i][j] && SCIPisFeasLE(scip, negquotient[j], lambda[i]); --j ) 748 SCIP_SOL** first_sols; /* stores the first ffirst sols in order to check for common violation of a row */ 752 SCIP_VAR** subspacevars; /* the variables on which the search is performed. Either coinciding with vars or with the 763 SCIP_Bool usefracspace; /* determines whether the search concentrates on fractional variables and fixes integer ones */ 764 SCIP_Bool cons_viol; /* used for checking whether a linear constraint is violated by one of the possible solutions */ 777 int f_first; /* {0,1}-points to be generated at first in order to check whether a restart is necessary */ 818 if( SCIPgetNNodes(scip) % (SCIPheurGetNCalls(heur) / (100 * SCIPheurGetNBestSolsFound(heur) + 10*heurdata->nsuccess + 1) + 1) != 0 ) 836 /* determine the space one which OCTANE should work either as the whole space or as the space of fractional variables */ 914 SCIPdebugMessage("run Octane heuristic on %s variables, which are %d vars, generate at most %d facets, using rule number %d\n", 982 /* calculate negquotient, the ratio of rayorigin and raydirection, paying special attention to the case raydirection[i] == 0 */ 1004 SCIPsortDownRealRealRealBoolPtr( negquotient, raydirection, rayorigin, sign, (void**) subspacevars, nsubspacevars); 1014 /* find the first facet of the octahedron hit by a ray shot from rayorigin into direction raydirection */ 1036 generateNeighborFacets(scip, facets, lambda, rayorigin, raydirection, negquotient, nsubspacevars, f_max, i, &nfacets); 1042 SCIP_CALL( getSolFromFacet(scip, facets[i], first_sols[i], sign, subspacevars, nsubspacevars) ); 1074 /* if the row's lhs is violated by the first sol, test, whether it is violated by the next ones, too */ 1115 /* if there was no row violated by all solutions, try whether one or more of them are feasible */ 1123 /* search for further facets and construct and try solutions out of facets fixed as closest ones */ 1128 generateNeighborFacets(scip, facets, lambda, rayorigin, raydirection, negquotient, nsubspacevars, f_max, i, &nfacets); 1221 "should the difference between the root solution and the current LP solution be used as one ray direction?", SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars) Definition: scip.c:33125 Definition: type_result.h:33 Definition: type_result.h:47 Definition: type_result.h:34 void SCIPsortDownRealRealRealBoolPtr(SCIP_Real *realarray1, SCIP_Real *realarray2, SCIP_Real *realarray3, SCIP_Bool *boolarray, void **ptrarray, int len) Definition: struct_scip.h:53 SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy))) Definition: scip.c:7297 static SCIP_RETCODE generateStartingPoint(SCIP *scip, SCIP_Real *rayorigin, SCIP_VAR **subspacevars, int nsubspacevars) Definition: heur_octane.c:489 static SCIP_RETCODE generateDifferenceRay(SCIP *scip, SCIP_Real *raydirection, SCIP_VAR **subspacevars, int nsubspacevars) Definition: heur_octane.c:167 static SCIP_Bool isZero(SCIP *scip, SCIP_Real *raydirection, int nsubspacevars) Definition: heur_octane.c:636 Definition: struct_var.h:196 SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val) Definition: scip.c:34843 SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata) Definition: scip.c:7252 SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var) Definition: scip.c:34983 static void flipCoords(SCIP_Real *rayorigin, SCIP_Real *raydirection, SCIP_Bool *sign, int nsubspacevars) Definition: heur_octane.c:512 SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols) Definition: scip.c:26672 Definition: struct_lp.h:123 Definition: struct_sol.h:50 SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: scip.c:3547 SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: scip.c:3573 Definition: type_result.h:35 static SCIP_RETCODE generateAverageRay(SCIP *scip, SCIP_Real *raydirection, SCIP_VAR **subspacevars, int nsubspacevars, SCIP_Bool weighted) Definition: heur_octane.c:189 SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur) Definition: scip.c:34002 SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41907 Definition: type_retcode.h:33 SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows) Definition: scip.c:26750 SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41946 static SCIP_RETCODE generateObjectiveRay(SCIP *scip, SCIP_Real *raydirection, SCIP_VAR **subspacevars, int nsubspacevars) Definition: heur_octane.c:147 Definition: struct_heur.h:75 void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata) Definition: heur.c:1068 Definition: type_lp.h:34 static void generateNeighborFacets(SCIP *scip, SCIP_Bool **facets, SCIP_Real *lambda, SCIP_Real *rayorigin, SCIP_Real *raydirection, SCIP_Real *negquotient, int nsubspacevars, int f_max, int i, int *nfacets) Definition: heur_octane.c:543 static SCIP_RETCODE getSolFromFacet(SCIP *scip, SCIP_Bool *facet, SCIP_SOL *sol, SCIP_Bool *sign, SCIP_VAR **subspacevars, int nsubspacevars) Definition: heur_octane.c:110 Definition: struct_lp.h:189 SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit))) Definition: scip.c:7345 SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit))) Definition: scip.c:7329 SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur) Definition: heur.c:1293 SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds) Definition: scip.c:26999 SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41933 SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree))) Definition: scip.c:7313 SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41959 static SCIP_RETCODE generateAverageNBRay(SCIP *scip, SCIP_Real *raydirection, int *fracspace, SCIP_VAR **subspacevars, int nsubspacevars) Definition: heur_octane.c:391 octane primal heuristic based on Balas, Ceria, Dawande, Margot, and Pataki SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars) Definition: scip.c:10572 Definition: objbranchrule.h:33 static void tryToInsert(SCIP *scip, SCIP_Bool **facets, SCIP_Real *lambda, int i, int j, int f_max, int nsubspacevars, SCIP_Real lam, int *nfacets) Definition: heur_octane.c:65 SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored) Definition: scip.c:36217 |