Scippy

SCIP

Solving Constraint Integer Programs

heur_trysol.c File Reference

Detailed Description

primal heuristic that tries a given solution

Author
Marc Pfetsch

This heuristic takes a solution from somewhere else via the function SCIPheurPassSolTrySol(). It then tries to commit this solution. It is mainly used by cons_indicator, which tries to correct a given solution, but cannot directly submit this solution, because it is a constraint handler and not a heuristic.

Definition in file heur_trysol.c.

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

Go to the source code of this file.

Macros

#define HEUR_NAME   "trysol"
 
#define HEUR_DESC   "try solution heuristic"
 
#define HEUR_DISPCHAR   'y'
 
#define HEUR_PRIORITY   -3000000 /* should process after all other heuristics */
 
#define HEUR_FREQ   1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_BEFOREPRESOL | SCIP_HEURTIMING_BEFORENODE
 
#define HEUR_USESSUBSCIP   FALSE
 

Functions

static SCIP_DECL_HEURCOPY (heurCopyTrySol)
 
static SCIP_DECL_HEURFREE (heurFreeTrySol)
 
static SCIP_DECL_HEUREXITSOL (heurExitTrySol)
 
static SCIP_DECL_HEUREXEC (heurExecTrySol)
 
SCIP_RETCODE SCIPincludeHeurTrySol (SCIP *scip)
 
SCIP_RETCODE SCIPheurPassSolTrySol (SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
 
SCIP_RETCODE SCIPheurPassSolAddSol (SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
 

Macro Definition Documentation

#define HEUR_DESC   "try solution heuristic"

Definition at line 35 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_DISPCHAR   'y'

Definition at line 36 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_PRIORITY   -3000000 /* should process after all other heuristics */

Definition at line 37 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_FREQ   1

Definition at line 38 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_FREQOFS   0

Definition at line 39 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_MAXDEPTH   -1

Definition at line 40 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

#define HEUR_USESSUBSCIP   FALSE

does the heuristic use a secondary SCIP instance?

Definition at line 42 of file heur_trysol.c.

Referenced by SCIPincludeHeurTrySol().

Function Documentation

static SCIP_DECL_HEURCOPY ( heurCopyTrySol  )
static

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

Definition at line 65 of file heur_trysol.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurTrySol().

static SCIP_DECL_HEURFREE ( heurFreeTrySol  )
static

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

Definition at line 79 of file heur_trysol.c.

References HEUR_NAME, NULL, SCIP_OKAY, SCIPdebugMessage, SCIPfreeMemory, SCIPheurGetData(), and SCIPheurGetName().

static SCIP_DECL_HEUREXITSOL ( heurExitTrySol  )
static

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

Definition at line 101 of file heur_trysol.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPfreeSol(), SCIPheurGetData(), and SCIPheurGetName().

static SCIP_DECL_HEUREXEC ( heurExecTrySol  )
static
SCIP_RETCODE SCIPincludeHeurTrySol ( SCIP scip)

creates the trysol primal heuristic and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 206 of file heur_trysol.c.

References FALSE, HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocMemory, SCIPincludeHeurBasic(), SCIPsetHeurCopy(), SCIPsetHeurExit(), and SCIPsetHeurFree().

Referenced by SCIP_DECL_HEURCOPY(), and SCIPincludeDefaultPlugins().

SCIP_RETCODE SCIPheurPassSolTrySol ( SCIP scip,
SCIP_HEUR heur,
SCIP_SOL sol 
)

pass solution to trysol heuristic

Parameters
scipSCIP data structure
heurtrysol heuristic
solsolution to be passed

Definition at line 236 of file heur_trysol.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateSolCopy(), SCIPdebugMessage, SCIPfreeSol(), SCIPgetSolOrigObj(), SCIPheurGetData(), SCIPheurGetName(), SCIPisLT(), SCIPsolSetHeur(), and SCIPunlinkSol().

Referenced by proposeFeasibleSolution(), SCIP_DECL_CONSCHECK(), and SCIP_DECL_CONSSEPALP().

SCIP_RETCODE SCIPheurPassSolAddSol ( SCIP scip,
SCIP_HEUR heur,
SCIP_SOL sol 
)

pass solution to trysol heuristic which just gets added (without checking feasibility

Parameters
scipSCIP data structure
heurtrysol heuristic
solsolution to be passed

Definition at line 275 of file heur_trysol.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateSolCopy(), SCIPdebugMessage, SCIPfreeSol(), SCIPgetSolOrigObj(), SCIPheurGetData(), SCIPheurGetName(), SCIPisLT(), SCIPsolSetHeur(), and SCIPunlinkSol().

Referenced by checkSystemGF2().