Scippy

SCIP

Solving Constraint Integer Programs

branch_random.c File Reference

Detailed Description

random variable branching rule

Author
Tobias Achterberg
Stefan Vigerske

Definition in file branch_random.c.

#include <assert.h>
#include <string.h>
#include "scip/branch_random.h"

Go to the source code of this file.

Macros

#define BRANCHRULE_NAME   "random"
 
#define BRANCHRULE_DESC   "random variable branching"
 
#define BRANCHRULE_PRIORITY   -100000
 
#define BRANCHRULE_MAXDEPTH   -1
 
#define BRANCHRULE_MAXBOUNDDIST   1.0
 
#define DEFAULT_INITSEED   0
 

Functions

static void getRandomVariable (SCIP *scip, SCIP_VAR **cands, SCIP_Real *candssol, int ncands, SCIP_VAR **bestcand, SCIP_Real *bestcandsol, unsigned int *seed)
 
static SCIP_DECL_BRANCHCOPY (branchCopyRandom)
 
static SCIP_DECL_BRANCHFREE (branchFreeRandom)
 
static SCIP_DECL_BRANCHINIT (branchInitRandom)
 
static SCIP_DECL_BRANCHEXECLP (branchExeclpRandom)
 
static SCIP_DECL_BRANCHEXECEXT (branchExecextRandom)
 
static SCIP_DECL_BRANCHEXECPS (branchExecpsRandom)
 
SCIP_RETCODE SCIPincludeBranchruleRandom (SCIP *scip)
 

Macro Definition Documentation

#define BRANCHRULE_NAME   "random"
#define BRANCHRULE_DESC   "random variable branching"

Definition at line 31 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

#define BRANCHRULE_PRIORITY   -100000

Definition at line 32 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

#define BRANCHRULE_MAXDEPTH   -1

Definition at line 33 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

#define BRANCHRULE_MAXBOUNDDIST   1.0

Definition at line 34 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

#define DEFAULT_INITSEED   0

initial random seed

Definition at line 36 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

Function Documentation

static void getRandomVariable ( SCIP scip,
SCIP_VAR **  cands,
SCIP_Real candssol,
int  ncands,
SCIP_VAR **  bestcand,
SCIP_Real bestcandsol,
unsigned int *  seed 
)
static

selects a random active variable from a given list of variables

Parameters
scipSCIP data structure
candsarray of branching candidates
candssolrelaxation solution values of branching candidates, or NULL
ncandsnumber of branching candidates
bestcandbuffer to store pointer to best candidate
bestcandsolbuffer to store solution value of best candidate
seedseed for random number generator

Definition at line 51 of file branch_random.c.

References NULL, SCIP_VARSTATUS_MULTAGGR, SCIPdebugMessage, SCIPgetRandomInt(), SCIPisEQ(), SCIPvarGetLbLocal(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrVars(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPvarGetUbLocal(), and SCIPvarIsActive().

Referenced by SCIP_DECL_BRANCHEXECEXT().

static SCIP_DECL_BRANCHCOPY ( branchCopyRandom  )
static

copy method for branchrule plugins (called when SCIP copies plugins)

Definition at line 120 of file branch_random.c.

References BRANCHRULE_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPbranchruleGetName(), and SCIPincludeBranchruleRandom().

static SCIP_DECL_BRANCHFREE ( branchFreeRandom  )
static

destructor of branching rule to free user data (called when SCIP is exiting)

Definition at line 134 of file branch_random.c.

References NULL, SCIP_OKAY, SCIPbranchruleGetData(), SCIPbranchruleSetData(), and SCIPfreeMemory.

static SCIP_DECL_BRANCHINIT ( branchInitRandom  )
static

initialization method of branching rule (called after problem was transformed)

Definition at line 149 of file branch_random.c.

References NULL, SCIP_OKAY, and SCIPbranchruleGetData().

static SCIP_DECL_BRANCHEXECLP ( branchExeclpRandom  )
static
static SCIP_DECL_BRANCHEXECPS ( branchExecpsRandom  )
static

branching execution method for not completely fixed pseudo solutions

Definition at line 270 of file branch_random.c.

References BRANCHRULE_NAME, NULL, SCIP_BRANCHED, SCIP_CALL, SCIP_OKAY, SCIPbranchruleGetData(), SCIPbranchruleGetName(), SCIPbranchVar(), SCIPdebugMessage, SCIPgetPseudoBranchCands(), SCIPgetRandomInt(), and SCIPvarGetName().