Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods to initiate and conduct LP diving

Functions

SCIP_EXPORT SCIP_RETCODE SCIPstartDive (SCIP *scip)
 
SCIP_EXPORT SCIP_RETCODE SCIPendDive (SCIP *scip)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgCutoffboundDive (SCIP *scip, SCIP_Real newcutoffbound)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgVarObjDive (SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgVarLbDive (SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgVarUbDive (SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
 
SCIP_EXPORT SCIP_RETCODE SCIPaddRowDive (SCIP *scip, SCIP_ROW *row)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgRowLhsDive (SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
 
SCIP_EXPORT SCIP_RETCODE SCIPchgRowRhsDive (SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
 
SCIP_EXPORT SCIP_Real SCIPgetVarObjDive (SCIP *scip, SCIP_VAR *var)
 
SCIP_EXPORT SCIP_Real SCIPgetVarLbDive (SCIP *scip, SCIP_VAR *var)
 
SCIP_EXPORT SCIP_Real SCIPgetVarUbDive (SCIP *scip, SCIP_VAR *var)
 
SCIP_EXPORT SCIP_RETCODE SCIPsolveDiveLP (SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
 
SCIP_EXPORT SCIP_Longint SCIPgetLastDivenode (SCIP *scip)
 
SCIP_EXPORT SCIP_Bool SCIPinDive (SCIP *scip)
 
SCIP_EXPORT SCIP_RETCODE SCIPgetLPDegeneracy (SCIP *scip, SCIP_Real *degeneracy, SCIP_Real *varconsratio)
 

Function Documentation

◆ SCIPstartDive()

SCIP_EXPORT SCIP_RETCODE SCIPstartDive ( SCIP scip)

initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Note
diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from numerical troubles during the last LP solve; because of this, most users will want to call this method only if SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
Parameters
scipSCIP data structure

Definition at line 2182 of file scip_lp.c.

References FALSE, Scip::lp, Scip::mem, NULL, SCIP_Mem::probmem, Scip::relaxation, SCIP_CALL, SCIP_INVALIDCALL, SCIP_NODETYPE_FOCUSNODE, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPgetCurrentNode(), SCIPisRelaxSolValid(), SCIPlpDiving(), SCIPlpStartDive(), SCIPnodeGetType(), SCIPtreeHasCurrentNodeLP(), SCIPtreeIsFocusNodeLPConstructed(), SCIPtreeProbing(), SCIPtreeStoreRelaxSol(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and solveLp().

◆ SCIPendDive()

SCIP_EXPORT SCIP_RETCODE SCIPendDive ( SCIP scip)

quits LP diving and resets bounds and objective values of columns to the current node's values

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 2231 of file scip_lp.c.

References SCIP_Primal::cutoffbound, SCIP_Lp::cutoffbound, SCIP_Tree::cutoffdelayed, Scip::eventfilter, Scip::eventqueue, FALSE, SCIP_Tree::focusnode, Scip::lp, Scip::mem, Scip::messagehdlr, NULL, SCIP_Prob::nvars, Scip::origprob, Scip::primal, SCIP_Tree::probdiverelaxstored, SCIP_Mem::probmem, Scip::relaxation, Scip::reopt, SCIP_Lp::resolvelperror, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPlpEndDive(), SCIPlpIsRelax(), SCIPlpIsSolved(), SCIPlpSetCutoffbound(), SCIPnodeUpdateLowerboundLP(), SCIPtreeCutoff(), SCIPtreeIsFocusNodeLPConstructed(), SCIPtreeRestoreRelaxSol(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, TRUE, and SCIP_Prob::vars.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and solveLp().

◆ SCIPchgCutoffboundDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgCutoffboundDive ( SCIP scip,
SCIP_Real  newcutoffbound 
)

changes cutoffbound in current dive

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
newcutoffboundnew cutoffbound

Definition at line 2288 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPlpSetCutoffbound(), Scip::set, Scip::transprob, and TRUE.

◆ SCIPchgVarObjDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgVarObjDive ( SCIP scip,
SCIP_VAR var,
SCIP_Real  newobj 
)

changes variable's objective value in current dive

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to change the objective value for
newobjnew objective value

Definition at line 2318 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPlpMarkDivingObjChanged(), SCIPlpSetCutoffbound(), SCIPsetInfinity(), SCIPvarChgObjDive(), Scip::set, Scip::transprob, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and updateVariableRounding().

◆ SCIPchgVarLbDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgVarLbDive ( SCIP scip,
SCIP_VAR var,
SCIP_Real  newbound 
)

changes variable's lower bound in current dive

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to change the bound for
newboundnew value for bound

Definition at line 2359 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPvarChgLbDive(), Scip::set, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and solveLp().

◆ SCIPchgVarUbDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgVarUbDive ( SCIP scip,
SCIP_VAR var,
SCIP_Real  newbound 
)

changes variable's upper bound in current dive

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to change the bound for
newboundnew value for bound

Definition at line 2391 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPvarChgUbDive(), Scip::set, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and solveLp().

◆ SCIPaddRowDive()

SCIP_EXPORT SCIP_RETCODE SCIPaddRowDive ( SCIP scip,
SCIP_ROW row 
)

adds a row to the LP in current dive

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
rowrow to be added

Definition at line 2423 of file scip_lp.c.

References Scip::eventfilter, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPcheckStage(), SCIPerrorMessage, SCIPlpAddRow(), SCIPlpDiving(), SCIPnodeGetDepth(), SCIPtreeGetCurrentNode(), Scip::set, Scip::tree, and TRUE.

◆ SCIPchgRowLhsDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgRowLhsDive ( SCIP scip,
SCIP_ROW row,
SCIP_Real  newlhs 
)

changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
rowrow to change the lhs for
newlhsnew value for lhs

Definition at line 2462 of file scip_lp.c.

References Scip::eventqueue, FALSE, Scip::lp, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_SIDETYPE_LEFT, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPlpRecordOldRowSideDive(), SCIProwChgLhs(), Scip::set, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP().

◆ SCIPchgRowRhsDive()

SCIP_EXPORT SCIP_RETCODE SCIPchgRowRhsDive ( SCIP scip,
SCIP_ROW row,
SCIP_Real  newrhs 
)

changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
rowrow to change the lhs for
newrhsnew value for rhs

Definition at line 2495 of file scip_lp.c.

References Scip::eventqueue, FALSE, Scip::lp, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_SIDETYPE_RIGHT, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPlpRecordOldRowSideDive(), SCIProwChgRhs(), Scip::set, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP().

◆ SCIPgetVarObjDive()

SCIP_EXPORT SCIP_Real SCIPgetVarObjDive ( SCIP scip,
SCIP_VAR var 
)

gets variable's objective value in current dive

Returns
the variable's objective value in current dive.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to get the bound for

Definition at line 2527 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIP_INVALID, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPvarGetObjLP(), and TRUE.

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIPgetVarLbDive()

SCIP_EXPORT SCIP_Real SCIPgetVarLbDive ( SCIP scip,
SCIP_VAR var 
)

gets variable's lower bound in current dive

Returns
the variable's lower bound in current dive.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to get the bound for

Definition at line 2556 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIP_INVALID, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPvarGetLbLP(), Scip::set, and TRUE.

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIPgetVarUbDive()

SCIP_EXPORT SCIP_Real SCIPgetVarUbDive ( SCIP scip,
SCIP_VAR var 
)

gets variable's upper bound in current dive

Returns
the variable's upper bound in current dive.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to get the bound for

Definition at line 2585 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIP_INVALID, SCIPABORT, SCIPcheckStage(), SCIPerrorMessage, SCIPlpDiving(), SCIPvarGetUbLP(), Scip::set, and TRUE.

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIPsolveDiveLP()

SCIP_EXPORT SCIP_RETCODE SCIPsolveDiveLP ( SCIP scip,
int  itlim,
SCIP_Bool lperror,
SCIP_Bool cutoff 
)

solves the LP of the current dive; no separation or pricing is applied

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Note
be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL, compare the explanation of SCIPstartDive()
Parameters
scipSCIP data structure
itlimmaximal number of LP iterations to perform, or -1 for no limit
lperrorpointer to store whether an unresolved LP error occurred
cutoffpointer to store whether the diving LP was infeasible or the objective limit was reached (or NULL, if not needed)

Definition at line 2618 of file scip_lp.c.

References Scip::branchcand, Scip::cliquetable, Scip::conflict, Scip::conflictstore, Scip::eventfilter, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::messagehdlr, SCIP_Set::misc_exactsolve, NULL, Scip::origprob, SCIP_Mem::probmem, Scip::reopt, SCIP_CALL, SCIP_INVALIDCALL, SCIP_Longint, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_LPSOLSTAT_OBJLIMIT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIPcheckStage(), SCIPconflictAnalyzeLP(), SCIPerrorMessage, SCIPgetCutoffbound(), SCIPgetLPObjval(), SCIPisGE(), SCIPlpDiving(), SCIPlpDivingObjChanged(), SCIPlpDivingRowsChanged(), SCIPlpGetSolstat(), SCIPlpSolveAndEval(), SCIPprobAllColsInLP(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), and solveLp().

◆ SCIPgetLastDivenode()

SCIP_EXPORT SCIP_Longint SCIPgetLastDivenode ( SCIP scip)

returns the number of the node in the current branch and bound run, where the last LP was solved in diving or probing mode

Returns
the number of the node in the current branch and bound run, where the last LP was solved in diving or probing mode.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 2685 of file scip_lp.c.

References FALSE, SCIP_Stat::lastdivenode, NULL, SCIP_CALL_ABORT, SCIPcheckStage(), Scip::stat, and TRUE.

Referenced by SCIP_DECL_HEUREXEC(), and SCIPperformGenericDivingAlgorithm().

◆ SCIPinDive()

SCIP_EXPORT SCIP_Bool SCIPinDive ( SCIP scip)

returns whether we are in diving mode

Returns
whether we are in diving mode.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 2715 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIPcheckStage(), SCIPlpDiving(), and TRUE.

Referenced by SCIP_DECL_PROPEXEC(), SCIP_DECL_RELAXEXEC(), SCIPtightenVarLb(), SCIPtightenVarUb(), storeAllBilinearTerms(), and updateSubproblemLowerbound().

◆ SCIPgetLPDegeneracy()

SCIP_EXPORT SCIP_RETCODE SCIPgetLPDegeneracy ( SCIP scip,
SCIP_Real degeneracy,
SCIP_Real varconsratio 
)

computes the changes to the problem when fixing to the optimal face

returns the degeneracy rate, i.e., the number of nonbasic variables with reduced cost 0 and the variable constraint ratio, i.e., the number of unfixed variables in relation to the basis size

Parameters
scipSCIP data structure
degeneracypointer to store degeneracy share
varconsratiopointer to store variable constraint ratio

Definition at line 2731 of file scip_lp.c.

References FALSE, Scip::lp, NULL, SCIP_CALL, SCIP_OKAY, SCIPcheckStage(), SCIPlpGetDegeneracy(), Scip::set, Scip::stat, and TRUE.

Referenced by execRelpscost().