Solving Constraint Integer Programs

Detailed Description

LP diving heuristic that tries to construct a Farkas-proof.

Jakob Witzig

The heuristic dives into the direction of the pseudosolution, i.e., variables get rounded towards their best bound w.r.t there objective coefficient. This strategy is twofold, if a feasible solution is found the solution has potentially a very good objective value; on the other hand, the left-hand side of a potential Farkas-proof \(y^Tb - y^TA{l',u'} > 0\) (i.e., infeasibility proof) gets increased, where \(l',u'\) are the local bounds. The contribution of each variable \(x_i\) to the Farkas-proof can be approximated by \(c_i = y^TA_i\) because we only dive on basic variables with reduced costs \(c_i - y^TA_i = 0\).

Definition in file heur_farkasdiving.c.

#include "blockmemshell/memory.h"
#include "scip/heur_farkasdiving.h"
#include "scip/heuristics.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_tree.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_tree.h"
#include <string.h>

Go to the source code of this file.


#define HEUR_NAME   "farkasdiving"
#define HEUR_DESC   "LP diving heuristic that tries to construct a Farkas-proof"
#define HEUR_PRIORITY   -900000
#define HEUR_FREQ   10
#define HEUR_FREQOFS   0
#define HEUR_MAXDEPTH   -1
#define DEFAULT_RANDSEED   151
#define DEFAULT_OBJDYN   0.0001
#define MIN_RAND   1e-06
#define MAX_RAND   1e-05
#define divesetAvailableFarkasdiving   NULL


static SCIP_RETCODE checkDivingCandidates (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **divecandvars, int ndivecands, SCIP_Bool *success)
static SCIP_RETCODE checkGlobalProperties (SCIP *scip, SCIP_HEURDATA *heurdata)
static SCIP_DECL_HEURCOPY (heurCopyFarkasdiving)
static SCIP_DECL_HEURFREE (heurFreeFarkasdiving)
static SCIP_DECL_HEURINIT (heurInitFarkasdiving)
static SCIP_DECL_HEUREXIT (heurExitFarkasdiving)
static SCIP_DECL_HEURINITSOL (heurInitsolFarkasdiving)
static SCIP_DECL_HEUREXEC (heurExecFarkasdiving)
static SCIP_DECL_DIVESETGETSCORE (divesetGetScoreFarkasdiving)
SCIP_RETCODE SCIPincludeHeurFarkasdiving (SCIP *scip)

Macro Definition Documentation


#define HEUR_NAME   "farkasdiving"

Definition at line 62 of file heur_farkasdiving.c.


#define HEUR_DESC   "LP diving heuristic that tries to construct a Farkas-proof"

Definition at line 63 of file heur_farkasdiving.c.



Definition at line 64 of file heur_farkasdiving.c.


#define HEUR_PRIORITY   -900000

Definition at line 65 of file heur_farkasdiving.c.


#define HEUR_FREQ   10

Definition at line 66 of file heur_farkasdiving.c.


#define HEUR_FREQOFS   0

Definition at line 67 of file heur_farkasdiving.c.


#define HEUR_MAXDEPTH   -1

Definition at line 68 of file heur_farkasdiving.c.



Definition at line 69 of file heur_farkasdiving.c.



does the heuristic use a secondary SCIP instance?

Definition at line 70 of file heur_farkasdiving.c.



bit mask that represents all supported dive types

Definition at line 71 of file heur_farkasdiving.c.



is this dive set publicly available (ie., can be used by other primal heuristics?)

Definition at line 72 of file heur_farkasdiving.c.



minimal relative depth to start diving

Definition at line 79 of file heur_farkasdiving.c.



maximal relative depth to start diving

Definition at line 80 of file heur_farkasdiving.c.



maximal fraction of diving LP iterations compared to node LP iterations

Definition at line 81 of file heur_farkasdiving.c.



additional number of allowed LP iterations

Definition at line 82 of file heur_farkasdiving.c.



maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)

Definition at line 83 of file heur_farkasdiving.c.



maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)

Definition at line 86 of file heur_farkasdiving.c.



maximal UBQUOT when no solution was found yet (0.0: no limit)

Definition at line 89 of file heur_farkasdiving.c.



maximal AVGQUOT when no solution was found yet (0.0: no limit)

Definition at line 90 of file heur_farkasdiving.c.



use one level of backtracking if infeasibility is encountered?

Definition at line 91 of file heur_farkasdiving.c.



percentage of immediate domain changes during probing to trigger LP resolve

Definition at line 92 of file heur_farkasdiving.c.



LP solve frequency for diving heuristics

Definition at line 93 of file heur_farkasdiving.c.



should only LP branching candidates be considered instead of the slower but more general constraint handler diving variable selection?

Definition at line 94 of file heur_farkasdiving.c.


#define DEFAULT_RANDSEED   151

initial seed for random number generation

Definition at line 97 of file heur_farkasdiving.c.



maximal occurance factor of an objective coefficient

Definition at line 99 of file heur_farkasdiving.c.


#define DEFAULT_OBJDYN   0.0001

minimal objective dynamism (log)

Definition at line 100 of file heur_farkasdiving.c.



should diving candidates be checked before running?

Definition at line 101 of file heur_farkasdiving.c.



should the score be scaled?

Definition at line 102 of file heur_farkasdiving.c.



should the heuristic only run within the tree if at least one solution was found at the root node?

Definition at line 103 of file heur_farkasdiving.c.



scale score by [f]ractionality or [i]mpact on farkasproof

Definition at line 106 of file heur_farkasdiving.c.


#define MIN_RAND   1e-06

Definition at line 450 of file heur_farkasdiving.c.


#define MAX_RAND   1e-05

Definition at line 451 of file heur_farkasdiving.c.

◆ divesetAvailableFarkasdiving

#define divesetAvailableFarkasdiving   NULL

Definition at line 525 of file heur_farkasdiving.c.

Function Documentation

◆ checkDivingCandidates()

static SCIP_RETCODE checkDivingCandidates ( SCIP scip,
SCIP_VAR **  divecandvars,
int  ndivecands,
SCIP_Bool success 

check whether the diving candidates fulfill requirements

scipSCIP data structure
heurdataheuristic data
divecandvarsdiving candidates to check
ndivecandsnumber of diving candidates
successpointer to store whether the check was successfull

Definition at line 126 of file heur_farkasdiving.c.

References checkGlobalProperties(), FALSE, NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetCurrentNode(), SCIPgetNObjVars(), SCIPisGT(), SCIPisZero(), SCIPnodeGetNumber(), SCIPsortReal(), SCIPvarGetObj(), and TRUE.

Referenced by checkGlobalProperties().

◆ checkGlobalProperties()

static SCIP_RETCODE checkGlobalProperties ( SCIP scip,

check whether the objective functions has nonzero coefficients corresponding to binary and integer variables

scipSCIP data structure
heurdataheuristic data

Definition at line 254 of file heur_farkasdiving.c.

References checkDivingCandidates(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_HEURCOPY(), SCIP_OKAY, SCIPdebugMsg, SCIPgetNBinVars(), SCIPgetNIntVars(), SCIPgetVars(), and TRUE.

Referenced by checkDivingCandidates().


static SCIP_DECL_HEURCOPY ( heurCopyFarkasdiving  )

copy method for primal heuristic plugins (called when SCIP copies plugins)

Definition at line 290 of file heur_farkasdiving.c.

Referenced by checkGlobalProperties().


static SCIP_DECL_HEURFREE ( heurFreeFarkasdiving  )

destructor of primal heuristic to free user data (called when SCIP is exiting)

Definition at line 304 of file heur_farkasdiving.c.


static SCIP_DECL_HEURINIT ( heurInitFarkasdiving  )

initialization method of primal heuristic (called after problem was transformed)

Definition at line 325 of file heur_farkasdiving.c.


static SCIP_DECL_HEUREXIT ( heurExitFarkasdiving  )

deinitialization method of primal heuristic (called before transformed problem is freed)

Definition at line 348 of file heur_farkasdiving.c.


static SCIP_DECL_HEURINITSOL ( heurInitsolFarkasdiving  )

solving process initialization method of primal heuristic (called when branch and bound process is about to begin)

Definition at line 367 of file heur_farkasdiving.c.


static SCIP_DECL_HEUREXEC ( heurExecFarkasdiving  )

execution method of primal heuristic

Definition at line 387 of file heur_farkasdiving.c.


static SCIP_DECL_DIVESETGETSCORE ( divesetGetScoreFarkasdiving  )

calculate score and preferred rounding direction for the candidate variable

Definition at line 455 of file heur_farkasdiving.c.