Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

public solving methods

Author
Tobias Achterberg
Timo Berthold
Gerald Gamrath
Leona Gottwald
Stefan Heinz
Gregor Hendel
Thorsten Koch
Alexander Martin
Marc Pfetsch
Michael Winkler
Kati Wolter

Definition in file scip_solve.c.

#include "blockmemshell/memory.h"
#include "scip/branch.h"
#include "scip/clock.h"
#include "scip/compr.h"
#include "scip/concsolver.h"
#include "scip/concurrent.h"
#include "scip/conflict.h"
#include "scip/conflictstore.h"
#include "scip/cons.h"
#include "scip/cutpool.h"
#include "scip/dcmp.h"
#include "scip/debug.h"
#include "scip/event.h"
#include "scip/implics.h"
#include "scip/interrupt.h"
#include "scip/lp.h"
#include "scip/nlp.h"
#include "scip/presol.h"
#include "scip/pricestore.h"
#include "scip/primal.h"
#include "scip/prob.h"
#include "scip/prop.h"
#include "scip/pub_branch.h"
#include "scip/pub_compr.h"
#include "scip/pub_cons.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_misc_select.h"
#include "scip/pub_presol.h"
#include "scip/pub_prop.h"
#include "scip/pub_sol.h"
#include "scip/pub_var.h"
#include "scip/relax.h"
#include "scip/reopt.h"
#include "scip/scip_benders.h"
#include "scip/scip_branch.h"
#include "scip/scip_concurrent.h"
#include "scip/scip_cons.h"
#include "scip/scip_general.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_randnumgen.h"
#include "scip/scip_sol.h"
#include "scip/scip_solve.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_timing.h"
#include "scip/scip_tree.h"
#include "scip/scip_var.h"
#include "scip/sepastore.h"
#include "scip/set.h"
#include "scip/sol.h"
#include "scip/solve.h"
#include "scip/stat.h"
#include "scip/struct_event.h"
#include "scip/struct_mem.h"
#include "scip/struct_primal.h"
#include "scip/struct_prob.h"
#include "scip/struct_scip.h"
#include "scip/struct_set.h"
#include "scip/struct_stat.h"
#include "scip/struct_tree.h"
#include "scip/syncstore.h"
#include "scip/tree.h"
#include "scip/var.h"
#include "scip/visual.h"

Go to the source code of this file.

Functions

static SCIP_RETCODE calcNonZeros (SCIP *scip, SCIP_Longint *nchecknonzeros, SCIP_Longint *nactivenonzeros, SCIP_Bool *approxchecknonzeros, SCIP_Bool *approxactivenonzeros)
 
SCIP_RETCODE SCIPtransformProb (SCIP *scip)
 
static SCIP_RETCODE initPresolve (SCIP *scip)
 
static SCIP_RETCODE exitPresolve (SCIP *scip, SCIP_Bool solved, SCIP_Bool *infeasible)
 
static SCIP_RETCODE presolveRound (SCIP *scip, SCIP_PRESOLTIMING *timing, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool lastround, int *presolstart, int presolend, int *propstart, int propend, int *consstart, int consend)
 
static SCIP_RETCODE presolve (SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
 
static SCIP_RETCODE transformSols (SCIP *scip)
 
static SCIP_RETCODE initSolve (SCIP *scip, SCIP_Bool solved)
 
static SCIP_RETCODE freeSolve (SCIP *scip, SCIP_Bool restart)
 
static SCIP_RETCODE freeReoptSolve (SCIP *scip)
 
static SCIP_RETCODE freeTransform (SCIP *scip)
 
static SCIP_RETCODE freeTransforming (SCIP *scip)
 
static SCIP_RETCODE displayRelevantStats (SCIP *scip)
 
static SCIP_RETCODE compressReoptTree (SCIP *scip)
 
static SCIP_RETCODE prepareReoptimization (SCIP *scip)
 
SCIP_RETCODE SCIPpresolve (SCIP *scip)
 
SCIP_RETCODE SCIPsolve (SCIP *scip)
 
SCIP_RETCODE SCIPsolveParallel (SCIP *scip)
 
SCIP_RETCODE SCIPsolveConcurrent (SCIP *scip)
 
SCIP_RETCODE SCIPenableReoptimization (SCIP *scip, SCIP_Bool enable)
 
SCIP_RETCODE SCIPaddReoptDualBndchg (SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
 
SCIP_SOLSCIPgetReoptLastOptSol (SCIP *scip)
 
SCIP_RETCODE SCIPgetReoptOldObjCoef (SCIP *scip, SCIP_VAR *var, int run, SCIP_Real *objcoef)
 
SCIP_RETCODE SCIPfreeSolve (SCIP *scip, SCIP_Bool restart)
 
SCIP_RETCODE SCIPfreeReoptSolve (SCIP *scip)
 
SCIP_RETCODE SCIPfreeTransform (SCIP *scip)
 
SCIP_RETCODE SCIPinterruptSolve (SCIP *scip)
 
SCIP_Bool SCIPisSolveInterrupted (SCIP *scip)
 
SCIP_RETCODE SCIPrestartSolve (SCIP *scip)
 
SCIP_Bool SCIPisReoptEnabled (SCIP *scip)
 
SCIP_RETCODE SCIPgetReoptSolsRun (SCIP *scip, int run, SCIP_SOL **sols, int solssize, int *nsols)
 
void SCIPresetReoptSolMarks (SCIP *scip)
 
SCIP_RETCODE SCIPcheckReoptRestart (SCIP *scip, SCIP_NODE *node, SCIP_Bool *restart)
 
SCIP_Bool SCIPisInRestart (SCIP *scip)
 

Function Documentation

◆ calcNonZeros()

static SCIP_RETCODE calcNonZeros ( SCIP scip,
SCIP_Longint nchecknonzeros,
SCIP_Longint nactivenonzeros,
SCIP_Bool approxchecknonzeros,
SCIP_Bool approxactivenonzeros 
)
static

calculates number of nonzeros in problem

Parameters
scipSCIP data structure
nchecknonzerospointer to store number of non-zeros in all check constraints
nactivenonzerospointer to store number of non-zeros in all active constraints
approxchecknonzerospointer to store if the number of non-zeros in all check constraints is only a lowerbound
approxactivenonzerospointer to store if the number of non-zeros in all active constraints is only a lowerbound

Definition at line 118 of file scip_solve.c.

References SCIP_Set::conshdlrs, FALSE, h, SCIP_Set::nconshdlrs, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetNVars(), SCIPconshdlrGetCheckConss(), SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPconshdlrGetNCheckConss(), SCIPconsIsActive(), SCIPconsIsChecked(), Scip::set, and TRUE.

Referenced by presolve(), and SCIPtransformProb().

◆ initPresolve()

◆ exitPresolve()

static SCIP_RETCODE exitPresolve ( SCIP scip,
SCIP_Bool  solved,
SCIP_Bool infeasible 
)
static

◆ presolveRound()

static SCIP_RETCODE presolveRound ( SCIP scip,
SCIP_PRESOLTIMING timing,
SCIP_Bool unbounded,
SCIP_Bool infeasible,
SCIP_Bool  lastround,
int *  presolstart,
int  presolend,
int *  propstart,
int  propend,
int *  consstart,
int  consend 
)
static

applies one round of presolving with the given presolving timing

This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it returns and the next presolving round will be started (again with timing fast). If the fast presolving does not find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing fast.

Parameters
scipSCIP data structure
timingpointer to current presolving timing
unboundedpointer to store whether presolving detected unboundedness
infeasiblepointer to store whether presolving detected infeasibility
lastroundis this the last presolving round due to a presolving round limit?
presolstartpointer to get the presolver to start exhaustive presolving with in the current round and store the one to start with in the next round
presolendlast presolver to treat in exhaustive presolving
propstartpointer to get the propagator to start exhaustive presolving with in the current round and store the one to start with in the next round
propendlast propagator to treat in exhaustive presolving
consstartpointer to get the constraint handler to start exhaustive presolving with in the current round and store the one to start with in the next round
consendlast constraint handler to treat in exhaustive presolving

Definition at line 652 of file scip_solve.c.

References BMSgetNUsedBufferMemory(), Scip::branchcand, Scip::cliquetable, SCIP_Set::conshdlrs, SCIP_Set::disp_verblevel, Scip::eventfilter, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::messagehdlr, SCIP_Set::nactivebenders, SCIP_Set::nconshdlrs, SCIP_Set::nheurs, SCIP_Stat::npresoladdconss, SCIP_Stat::npresoladdholes, SCIP_Stat::npresolaggrvars, SCIP_Stat::npresolchgbds, SCIP_Stat::npresolchgcoefs, SCIP_Stat::npresolchgsides, SCIP_Stat::npresolchgvartypes, SCIP_Stat::npresoldelconss, SCIP_Stat::npresolfixedvars, SCIP_Stat::npresolrounds, SCIP_Stat::npresolroundsext, SCIP_Stat::npresolroundsfast, SCIP_Stat::npresolroundsmed, SCIP_Set::npresols, SCIP_Stat::npresolupgdconss, SCIP_Set::nprops, NULL, Scip::origprob, SCIP_Set::presols, Scip::primal, SCIP_Mem::probmem, SCIP_Set::props_presol, SCIP_Set::propspresolsorted, Scip::reopt, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_EVENTTYPE_PRESOLVEROUND, SCIP_HEURTIMING_DURINGPRESOLLOOP, SCIP_INVALID, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_PRESOLTIMING_FAST, SCIP_PRESOLTIMING_FINAL, SCIP_PRESOLTIMING_MEDIUM, SCIP_UNBOUNDED, SCIP_VERBLEVEL_FULL, SCIP_VERBLEVEL_HIGH, SCIPbuffer(), SCIPcleanbuffer(), SCIPcliquetableCleanup(), SCIPconshdlrGetName(), SCIPconshdlrPresolve(), SCIPdebugMsg, SCIPeventChgType(), SCIPeventProcess(), SCIPgetBestSol(), SCIPgetNSols(), SCIPgetSolOrigObj(), SCIPgetSolvingTime(), SCIPheurGetName(), SCIPisPresolveFinished(), SCIPmessagePrintVerbInfo(), SCIPpresolExec(), SCIPpresolGetName(), SCIPpresolGetPriority(), SCIPprimalHeuristics(), SCIPprobPerformVarDeletions(), SCIPpropGetName(), SCIPpropGetPresolPriority(), SCIPpropPresol(), SCIPsolGetHeur(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by presolve().

◆ presolve()

static SCIP_RETCODE presolve ( SCIP scip,
SCIP_Bool unbounded,
SCIP_Bool infeasible,
SCIP_Bool vanished 
)
static

loops through the included presolvers and constraint's presolve methods, until changes are too few

Parameters
scipSCIP data structure
unboundedpointer to store whether presolving detected unboundedness
infeasiblepointer to store whether presolving detected infeasibility
vanishedpointer to store whether the problem vanished in presolving

Definition at line 1110 of file scip_solve.c.

References BMSgetNUsedBufferMemory(), calcNonZeros(), Scip::cliquetable, SCIP_Set::disp_verblevel, Scip::eventfilter, Scip::eventqueue, exitPresolve(), FALSE, initPresolve(), SCIP_Stat::lastnpresoladdconss, SCIP_Stat::lastnpresoladdholes, SCIP_Stat::lastnpresolaggrvars, SCIP_Stat::lastnpresolchgbds, SCIP_Stat::lastnpresolchgcoefs, SCIP_Stat::lastnpresolchgsides, SCIP_Stat::lastnpresolchgvartypes, SCIP_Stat::lastnpresoldelconss, SCIP_Stat::lastnpresolfixedvars, SCIP_Stat::lastnpresolupgdconss, Scip::lp, MAX, Scip::mem, Scip::messagehdlr, SCIP_Set::nactivebenders, SCIP_Set::nactivepricers, SCIP_Set::nconshdlrs, SCIP_Prob::nconss, SCIP_Set::nheurs, SCIP_Stat::nimplications, SCIP_Primal::nlimsolsfound, SCIP_Stat::nnz, SCIP_Stat::npresoladdconss, SCIP_Stat::npresoladdholes, SCIP_Stat::npresolaggrvars, SCIP_Stat::npresolchgbds, SCIP_Stat::npresolchgcoefs, SCIP_Stat::npresolchgsides, SCIP_Stat::npresolchgvartypes, SCIP_Stat::npresoldelconss, SCIP_Stat::npresolfixedvars, SCIP_Stat::npresolrounds, SCIP_Stat::npresolroundsext, SCIP_Stat::npresolroundsfast, SCIP_Stat::npresolroundsmed, SCIP_Set::npresols, SCIP_Stat::npresolupgdconss, SCIP_Set::nprops, SCIP_Stat::nreoptruns, SCIP_Primal::nsols, NULL, SCIP_Prob::nvars, Scip::origprob, SCIP_Stat::performpresol, SCIP_Set::presol_maxrounds, presolveRound(), SCIP_Stat::presolvingtime, SCIP_Stat::presolvingtimeoverall, Scip::primal, SCIP_Mem::probmem, SCIP_Set::random_permutevars, Scip::reopt, SCIP_Set::reopt_enable, SCIP_Bool, SCIP_CALL, SCIP_HEURTIMING_BEFOREPRESOL, SCIP_INVALID, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_PRESOLTIMING_FAST, SCIP_PRESOLTIMING_FINAL, SCIP_PRESOLTIMING_MEDIUM, SCIP_Real, SCIP_STAGE_PRESOLVED, SCIP_STAGE_PRESOLVING, SCIP_STAGE_TRANSFORMED, SCIP_STATUS_INFEASIBLE, SCIP_STATUS_INFORUNBD, SCIP_STATUS_OPTIMAL, SCIP_STATUS_UNBOUNDED, SCIP_STATUS_UNKNOWN, SCIP_VERBLEVEL_FULL, SCIP_VERBLEVEL_HIGH, SCIP_VERBLEVEL_NORMAL, SCIPbuffer(), SCIPcleanbuffer(), SCIPcliquetableGetNCliques(), SCIPclockStart(), SCIPclockStop(), SCIPcreateSol(), SCIPdebugMsg, SCIPgetBestSol(), SCIPgetNConss(), SCIPgetNSols(), SCIPgetNVars(), SCIPgetSolOrigObj(), SCIPgetSolvingTime(), SCIPheurGetName(), SCIPisInfinity(), SCIPisPresolveFinished(), SCIPmessagePrintVerbInfo(), SCIPprimalHeuristics(), SCIPprimalUpdateObjlimit(), SCIPprobMarkNConss(), SCIPprobResortVars(), SCIPsetSortPresols(), SCIPsetSortPropsPresol(), SCIPsolGetHeur(), SCIPsolveIsStopped(), SCIPtrySolFree(), Scip::set, SCIP_Set::stage, Scip::stat, SCIP_Stat::status, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIPincludePresolMILP(), SCIPlpiGetIntpar(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPpresolve(), and SolveWSimplex().

◆ transformSols()

◆ initSolve()

static SCIP_RETCODE initSolve ( SCIP scip,
SCIP_Bool  solved 
)
static

initializes solution process data structures

Parameters
scipSCIP data structure
solvedis problem already solved?

Definition at line 1462 of file scip_solve.c.

References SCIP_Primal::cutoffbound, Scip::cutpool, Scip::delayedcutpool, SCIP_Prob::dualbound, Scip::eventfilter, Scip::eventqueue, SCIP_Stat::externmemestim, FALSE, SCIP_Stat::lastlowerbound, Scip::lp, Scip::mem, Scip::messagehdlr, SCIP_Set::misc_estimexternmem, SCIP_Set::misc_transorigsols, SCIP_Set::nactivepricers, Scip::nlp, SCIP_Set::nlp_disable, SCIP_Prob::nlpenabled, SCIP_Stat::nruns, NULL, SCIP_Prob::nvars, Scip::origprob, Scip::pricestore, Scip::primal, SCIP_Mem::probmem, REALABS, Scip::reopt, SCIP_CALL, SCIP_INVALID, SCIP_LONGINT_FORMAT, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIP_STAGE_INITSOLVE, SCIP_STAGE_PRESOLVED, SCIP_STAGE_SOLVING, SCIPcutpoolCreate(), SCIPdebugMsg, SCIPlpReset(), SCIPnextafter(), SCIPnlpAddVars(), SCIPnlpCreate(), SCIPnodeUpdateLowerbound(), SCIPpricestoreCreate(), SCIPprimalSetCutoffbound(), SCIPprimalUpdateObjlimit(), SCIPprobGetName(), SCIPprobInitSolve(), SCIPprobInternObjval(), SCIPprobMarkNConss(), SCIPsepastoreCreate(), SCIPsetCutoffbounddelta(), SCIPsetInfinity(), SCIPsetInitsolPlugins(), SCIPsetIsInfinity(), SCIPsetIsLT(), SCIPsetIsZero(), SCIPstatEnforceLPUpdates(), SCIPstatResetCurrentRun(), SCIPtransformDecompstore(), SCIPtreeCreateRoot(), SCIPtreeGetRootNode(), SCIPvarGetObj(), SCIPvarGetWorstBoundGlobal(), SCIPvisualInit(), SCIP_Set::sepa_cutagelimit, Scip::sepastore, Scip::sepastoreprobing, Scip::set, SCIP_Set::stage, Scip::stat, transformSols(), Scip::transprob, Scip::tree, TRUE, SCIP_Prob::vars, and SCIP_Stat::visual.

Referenced by SCIPpresolve(), SCIPsolve(), and SCIPsolveConcurrent().

◆ freeSolve()

◆ freeReoptSolve()

static SCIP_RETCODE freeReoptSolve ( SCIP scip)
static

frees solution process data structures when reoptimization is used

in contrast to a freeSolve() this method will preserve the transformed problem such that another presolving round after changing the problem (modifying the objective function) is not necessary.

Parameters
scipSCIP data structure

Definition at line 1706 of file scip_solve.c.

References Scip::branchcand, Scip::cliquetable, Scip::conflict, Scip::conflictstore, Scip::cutpool, Scip::delayedcutpool, Scip::eventfilter, Scip::eventqueue, FALSE, SCIP_Stat::inrestart, Scip::lp, Scip::mem, Scip::messagehdlr, SCIP_Set::misc_resetstat, Scip::nlp, SCIP_Prob::nlpenabled, NULL, Scip::origprob, Scip::pricestore, Scip::primal, SCIP_Mem::probmem, Scip::relaxation, Scip::reopt, SCIP_Set::reopt_enable, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_STAGE_EXITSOLVE, SCIP_STAGE_PRESOLVED, SCIP_STAGE_SOLVED, SCIP_STAGE_SOLVING, SCIPconflictstoreClear(), SCIPcutpoolClear(), SCIPcutpoolFree(), SCIPdebugReset, SCIPlpInvalidateRootObjval(), SCIPlpReset(), SCIPnlpFree(), SCIPnodeFocus(), SCIPpricestoreFree(), SCIPprimalClear(), SCIPprobExitSolve(), SCIPprobInvalidateDualbound(), SCIPrelaxationFree(), SCIPreoptReset(), SCIPsepastoreFree(), SCIPsetExitPlugins(), SCIPsetExitsolPlugins(), SCIPsetObjlimit(), SCIPstatMark(), SCIPstatReset(), SCIPstatResetCurrentRun(), SCIPstatResetPrimalDualIntegrals(), SCIPtreeClear(), SCIPtreeGetFocusNode(), SCIPvisualExit(), Scip::sepastore, Scip::sepastoreprobing, Scip::set, SCIP_Set::stage, Scip::stat, Scip::transprob, Scip::tree, TRUE, and SCIP_Stat::visual.

Referenced by SCIPfreeReoptSolve().

◆ freeTransform()

◆ freeTransforming()

◆ displayRelevantStats()

◆ compressReoptTree()

◆ prepareReoptimization()