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 "scip/branch_random.h"
#include "scip/pub_branch.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_message.h"
#include "scip/scip_mem.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_randnumgen.h"
#include "scip/scip_tree.h"
#include <string.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 41 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_PRIORITY

#define BRANCHRULE_PRIORITY   -100000

Definition at line 42 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_MAXDEPTH

#define BRANCHRULE_MAXDEPTH   -1

Definition at line 43 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ BRANCHRULE_MAXBOUNDDIST

#define BRANCHRULE_MAXBOUNDDIST   1.0

Definition at line 44 of file branch_random.c.

Referenced by SCIPincludeBranchruleRandom().

◆ DEFAULT_INITSEED

#define DEFAULT_INITSEED   41

initial random seed

Definition at line 46 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 61 of file branch_random.c.

References NULL, 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 130 of file branch_random.c.

References BRANCHRULE_NAME, NULL, 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 145 of file branch_random.c.

References NULL, 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 164 of file branch_random.c.

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

◆ SCIP_DECL_BRANCHEXIT()

static SCIP_DECL_BRANCHEXIT ( branchExitRandom  )
static

deinitialization method of branching rule

Definition at line 181 of file branch_random.c.

References NULL, 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 302 of file branch_random.c.

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