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"
#include "scip/pub_misc.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   41
 

Functions

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

Macro Definition Documentation

◆ BRANCHRULE_NAME

#define BRANCHRULE_NAME   "random"

◆ BRANCHRULE_DESC

#define BRANCHRULE_DESC   "random variable branching"

Definition at line 33 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_PRIORITY

#define BRANCHRULE_PRIORITY   -100000

Definition at line 34 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_MAXDEPTH

#define BRANCHRULE_MAXDEPTH   -1

Definition at line 35 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_MAXBOUNDDIST

#define BRANCHRULE_MAXBOUNDDIST   1.0

Definition at line 36 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ DEFAULT_INITSEED

#define DEFAULT_INITSEED   41

initial random seed

Definition at line 38 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

Function Documentation

◆ getRandomVariable()

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

selects a random active variable from a given list of variables

Parameters
scipSCIP data structure
branchruledatabranchrule data
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

Definition at line 53 of file branch_random.c.

References SCIP_VARSTATUS_MULTAGGR, SCIPdebugMsg, SCIPisEQ(), SCIPrandomGetInt(), SCIPvarGetLbLocal(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrVars(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPvarGetUbLocal(), and SCIPvarIsActive().

Referenced by SCIP_DECL_BRANCHEXECEXT().

◆ SCIP_DECL_BRANCHCOPY()

static SCIP_DECL_BRANCHCOPY ( branchCopyRandom  )
static

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

Definition at line 122 of file branch_random.c.

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

◆ SCIP_DECL_BRANCHFREE()

static SCIP_DECL_BRANCHFREE ( branchFreeRandom  )
static

destructor of branching rule to free user data (called when SCIP is exiting) ! [SnippetBranchFreeRandom]

Definition at line 137 of file branch_random.c.

References SCIP_OKAY, SCIPbranchruleGetData(), SCIPbranchruleSetData(), and SCIPfreeBlockMemory.

◆ SCIP_DECL_BRANCHINIT()

static SCIP_DECL_BRANCHINIT ( branchInitRandom  )
static

! [SnippetBranchFreeRandom] initialization method of branching rule (called after problem was transformed)

Definition at line 156 of file branch_random.c.

References SCIP_CALL, SCIP_OKAY, SCIPbranchruleGetData(), and SCIPcreateRandom().

◆ SCIP_DECL_BRANCHEXIT()

static SCIP_DECL_BRANCHEXIT ( branchExitRandom  )
static

deinitialization method of branching rule

Definition at line 173 of file branch_random.c.

References SCIP_OKAY, SCIPbranchruleGetData(), and SCIPfreeRandom().

◆ SCIP_DECL_BRANCHEXECLP()

static SCIP_DECL_BRANCHEXECLP ( branchExeclpRandom  )
static

◆ SCIP_DECL_BRANCHEXECEXT()

◆ SCIP_DECL_BRANCHEXECPS()

static SCIP_DECL_BRANCHEXECPS ( branchExecpsRandom  )
static

branching execution method for not completely fixed pseudo solutions

Definition at line 294 of file branch_random.c.

References BRANCHRULE_NAME, SCIP_BRANCHED, SCIP_CALL, SCIP_OKAY, SCIPbranchruleGetData(), SCIPbranchruleGetName(), SCIPbranchVar(), SCIPdebugMsg, SCIPgetPseudoBranchCands(), SCIPrandomGetInt(), and SCIPvarGetName().