PySCIPOpt  4.3.0
Python Interface for the SCIP Optimization Suite
Model Class Reference

Public Member Functions

def __dealloc__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def __init__ (self, problemName='model', defaultPlugins=True, Model, sourceModel=None, origcopy=False, globalcopy=True, enablepricing=False, createscip=True, threadsafe=False)
 
def activateBenders (self, Benders, benders, int, nsubproblems)
 
def addBendersSubproblem (self, Benders, benders, subproblem)
 
def addCons (self, cons, name='', initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsAnd (self, vars, resvar, name="ANDcons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsCardinality (self, consvars, cardval, indvars=None, weights=None, name="CardinalityCons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsCoeff (self, Constraint, cons, Variable, var, coeff)
 
def addConsIndicator (self, cons, binvar=None, activeone=True, name="IndicatorCons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsLocal (self, Constraint, cons, Node, validnode=None)
 
def addConsNode (self, Node, node, Constraint, cons, Node, validnode=None)
 
def addConsOr (self, vars, resvar, name="ORcons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConss (self, conss, name='', initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsSOS1 (self, vars, weights=None, name="SOS1cons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsSOS2 (self, vars, weights=None, name="SOS2cons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, dynamic=False, removable=False, stickingatnode=False)
 
def addConsXor (self, vars, rhsvar, name="XORcons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def addCut (self, Row, cut, not, None, forcecut=False)
 
def addObjoffset (self, offset, solutions=False)
 
def addPoolCut (self, Row, row, not, None)
 
def addPyCons (self, Constraint, cons)
 
def addRowDive (self, Row, row)
 
def addSol (self, Solution, solution, free=True)
 
def addVar (self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar=False, pricedVarScore=1.0)
 
def addVarLocks (self, Variable, var, nlocksdown, nlocksup)
 
def addVarSOS1 (self, Constraint, cons, Variable, var, weight)
 
def addVarSOS2 (self, Constraint, cons, Variable, var, weight)
 
def addVarToRow (self, Row, row, not, None, Variable, var, not, None, value)
 
def appendVarSOS1 (self, Constraint, cons, Variable, var)
 
def appendVarSOS2 (self, Constraint, cons, Variable, var)
 
def applyCutsProbing (self)
 
def backtrackProbing (self, probingdepth)
 
def branchVar (self, variable)
 
def branchVarVal (self, variable, value)
 
def cacheRowExtensions (self, Row, row, not, None)
 
def calcChildEstimate (self, Variable, variable, targetvalue)
 
def calcNodeselPriority (self, Variable, variable, branchdir, targetvalue)
 
def catchEvent (self, eventtype, Eventhdlr, eventhdlr)
 
def catchRowEvent (self, Row, row, eventtype, Eventhdlr, eventhdlr)
 
def catchVarEvent (self, Variable, var, eventtype, Eventhdlr, eventhdlr)
 
def checkBendersSubproblemOptimality (self, Solution, solution, probnumber, Benders, benders=None)
 
def checkQuadraticNonlinear (self, Constraint, cons)
 
def checkSol (self, Solution, solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, original=False)
 
def chgLhs (self, Constraint, cons, lhs)
 
def chgReoptObjective (self, coeffs, sense='minimize')
 
def chgRhs (self, Constraint, cons, rhs)
 
def chgRowLhsDive (self, Row, row, newlhs)
 
def chgRowRhsDive (self, Row, row, newrhs)
 
def chgVarBranchPriority (self, Variable, var, priority)
 
def chgVarLb (self, Variable, var, lb)
 
def chgVarLbDive (self, Variable, var, newbound)
 
def chgVarLbGlobal (self, Variable, var, lb)
 
def chgVarLbNode (self, Node, node, Variable, var, lb)
 
def chgVarLbProbing (self, Variable, var, lb)
 
def chgVarObjDive (self, Variable, var, newobj)
 
def chgVarObjProbing (self, Variable, var, newobj)
 
def chgVarType (self, Variable, var, vtype)
 
def chgVarUb (self, Variable, var, ub)
 
def chgVarUbDive (self, Variable, var, newbound)
 
def chgVarUbGlobal (self, Variable, var, ub)
 
def chgVarUbNode (self, Node, node, Variable, var, ub)
 
def chgVarUbProbing (self, Variable, var, ub)
 
def computeBestSolSubproblems (self)
 
def constructLP (self)
 
def count (self)
 
def createChild (self, nodeselprio, estimate)
 
def createCons (self, Conshdlr, conshdlr, name, initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, modifiable=False, dynamic=False, removable=False, stickingatnode=False)
 
def createEmptyRowSepa (self, Sepa, sepa, name="row", lhs=0.0, rhs=None, local=True, modifiable=False, removable=True)
 
def createEmptyRowUnspec (self, name="row", lhs=0.0, rhs=None, local=True, modifiable=False, removable=True)
 
def createPartialSol (self, Heur, heur=None)
 
def createProbBasic (self, problemName='model')
 
def createSol (self, Heur, heur=None)
 
def delCons (self, Constraint, cons)
 
def delConsLocal (self, Constraint, cons)
 
def delVar (self, Variable, var)
 
def disablePropagation (self, onlyroot=False)
 
def dropEvent (self, eventtype, Eventhdlr, eventhdlr)
 
def dropRowEvent (self, Row, row, eventtype, Eventhdlr, eventhdlr)
 
def dropVarEvent (self, Variable, var, eventtype, Eventhdlr, eventhdlr)
 
def enableReoptimization (self, enable=True)
 
def endDive (self)
 
def endProbing (self)
 
def epsilon (self)
 
def feasFrac (self, value)
 
def feastol (self)
 
def fixVar (self, Variable, var, val)
 
def fixVarProbing (self, Variable, var, fixedval)
 
def flushRowExtensions (self, Row, row, not, None)
 
def frac (self, value)
 
def freeBendersSubproblems (self)
 
def freeProb (self)
 
def freeReoptSolve (self)
 
def freeSol (self, Solution, solution)
 
def freeTransform (self)
 
def getActivity (self, Constraint, cons, Solution, sol=None)
 
def getBendersAuxiliaryVar (self, probnumber, Benders, benders=None)
 
def getBendersSubproblem (self, probnumber, Benders, benders=None)
 
def getBendersVar (self, Variable, var, Benders, benders=None, probnumber=-1)
 
def getBestboundNode (self)
 
def getBestChild (self)
 
def getBestLeaf (self)
 
def getBestNode (self)
 
def getBestSibling (self)
 
def getBestSol (self)
 
def getCondition (self, exact=False)
 
def getConss (self)
 
def getCurrentNode (self)
 
def getCutEfficacy (self, Row, cut, not, None, Solution, sol=None)
 
def getCutLPSolCutoffDistance (self, Row, cut, not, None, Solution, sol, not, None)
 
def getDepth (self)
 
def getDualbound (self)
 
def getDualboundRoot (self)
 
def getDualfarkasLinear (self, Constraint, cons)
 
def getDualMultiplier (self, Constraint, cons)
 
def getDualsolLinear (self, Constraint, cons)
 
def getDualSolVal (self, Constraint, cons, boundconstraint=False)
 
def getGap (self)
 
def getLhs (self, Constraint, cons)
 
def getLocalEstimate (self, original=False)
 
def getLPBasisInd (self)
 
def getLPBInvARow (self, row)
 
def getLPBInvRow (self, row)
 
def getLPBranchCands (self)
 
def getLPColsData (self)
 
def getLPObjVal (self)
 
def getLPRowsData (self)
 
def getLPSolstat (self)
 
def getNBestSolsFound (self)
 
def getNBinVars (self)
 
def getNChildren (self)
 
def getNConss (self)
 
def getNConss (self)
 
def getNCountedSols (self)
 
def getNCuts (self)
 
def getNCutsApplied (self)
 
def getNFeasibleLeaves (self)
 
def getNInfeasibleLeaves (self)
 
def getNIntVars (self)
 
def getNLeaves (self)
 
def getNLimSolsFound (self)
 
def getNLPCols (self)
 
def getNLPIterations (self)
 
def getNLPRows (self)
 
def getNLPs (self)
 
def getNlRowActivityBounds (self, NLRow, nlrow)
 
def getNlRows (self)
 
def getNlRowSolActivity (self, NLRow, nlrow, Solution, sol=None)
 
def getNlRowSolFeasibility (self, NLRow, nlrow, Solution, sol=None)
 
def getNNlRows (self)
 
def getNNodes (self)
 
def getNReaders (self)
 
def getNSepaRounds (self)
 
def getNSiblings (self)
 
def getNSols (self)
 
def getNSolsFound (self)
 
def getNTotalNodes (self)
 
def getNVars (self)
 
def getObjective (self)
 
def getObjectiveSense (self)
 
def getObjlimit (self)
 
def getObjoffset (self, original=True)
 
def getObjVal (self, original=True)
 
def getOpenNodes (self)
 
def getParam (self, name)
 
def getParams (self)
 
def getPresolvingTime (self)
 
def getPrimalbound (self)
 
def getProbingDepth (self)
 
def getProbName (self)
 
def getPseudoBranchCands (self)
 
def getReadingTime (self)
 
def getRhs (self, Constraint, cons)
 
def getRowActivity (self, Row, row)
 
def getRowDualSol (self, Row, row)
 
def getRowLinear (self, Constraint, cons)
 
def getRowLPActivity (self, Row, row)
 
def getRowNumIntCols (self, Row, row)
 
def getRowObjParallelism (self, Row, row)
 
def getRowParallelism (self, Row, row1, Row, row2, orthofunc=101)
 
def getSlack (self, Constraint, cons, Solution, sol=None, side=None)
 
def getSlackVarIndicator (self, Constraint, cons)
 
def getSolObjVal (self, Solution, sol, original=True)
 
def getSols (self)
 
def getSolVal (self, Solution, sol, Expr, expr)
 
def getSolvingTime (self)
 
def getStage (self)
 
def getStatus (self)
 
def getTermsQuadratic (self, Constraint, cons)
 
def getTotalTime (self)
 
def getTransformedCons (self, Constraint, cons)
 
def getTransformedVar (self, Variable, var)
 
def getVal (self, Expr, expr)
 
def getValsLinear (self, Constraint, cons)
 
def getVarLbDive (self, Variable, var)
 
def getVarRedcost (self, Variable, var)
 
def getVars (self, transformed=False)
 
def getVarUbDive (self, Variable, var)
 
def hideOutput (self, quiet=True)
 
def includeBenders (self, Benders, benders, name, desc, priority=1, cutlp=True, cutpseudo=True, cutrelax=True, shareaux=False)
 
def includeBenderscut (self, Benders, benders, Benderscut, benderscut, name, desc, priority=1, islpcut=True)
 
def includeBendersDefaultCuts (self, Benders, benders)
 
def includeBranchrule (self, Branchrule, branchrule, name, desc, priority, maxdepth, maxbounddist)
 
def includeConshdlr (self, Conshdlr, conshdlr, name, desc, sepapriority=0, enfopriority=0, chckpriority=0, sepafreq=-1, propfreq=-1, eagerfreq=100, maxprerounds=-1, delaysepa=False, delayprop=False, needscons=True, proptiming=PY_SCIP_PROPTIMING.BEFORELP, presoltiming=PY_SCIP_PRESOLTIMING.MEDIUM)
 
def includeCutsel (self, Cutsel, cutsel, name, desc, priority)
 
def includeDefaultPlugins (self)
 
def includeEventhdlr (self, Eventhdlr, eventhdlr, name, desc)
 
def includeHeur (self, Heur, heur, name, desc, dispchar, priority=10000, freq=1, freqofs=0, maxdepth=-1, timingmask=SCIP_HEURTIMING_BEFORENODE, usessubscip=False)
 
def includeNodesel (self, Nodesel, nodesel, name, desc, stdpriority, memsavepriority)
 
def includePresol (self, Presol, presol, name, desc, priority, maxrounds, timing=SCIP_PRESOLTIMING_FAST)
 
def includePricer (self, Pricer, pricer, name, desc, priority=1, delay=True)
 
def includeProp (self, Prop, prop, name, desc, presolpriority, presolmaxrounds, proptiming, presoltiming=SCIP_PRESOLTIMING_FAST, priority=1, freq=1, delay=True)
 
def includeReader (self, Reader, reader, name, desc, ext)
 
def includeRelax (self, Relax, relax, name, desc, priority=10000, freq=1)
 
def includeSepa (self, Sepa, sepa, name, desc, priority=0, freq=10, maxbounddist=1.0, usessubscip=False, delay=False)
 
def infinity (self)
 
def initBendersDefault (self, subproblems)
 
def inProbing (self)
 
def inRepropagation (self)
 
def interruptSolve (self)
 
def isCutEfficacious (self, Row, cut, not, None, Solution, sol=None)
 
def isEQ (self, val1, val2)
 
def isFeasEQ (self, val1, val2)
 
def isFeasIntegral (self, value)
 
def isFeasNegative (self, value)
 
def isFeasZero (self, value)
 
def isGE (self, val1, val2)
 
def isGT (self, val1, val2)
 
def isInfinity (self, value)
 
def isLE (self, val1, val2)
 
def isLPSolBasic (self)
 
def isLT (self, val1, val2)
 
def isNLPConstructed (self)
 
def isObjChangedProbing (self)
 
def isZero (self, value)
 
def lpiGetIterations (self)
 
def newProbingNode (self)
 
def optimize (self)
 
def presolve (self)
 
def printBestSol (self, write_zeros=False)
 
def printCons (self, Constraint, constraint)
 
def printNlRow (self, NLRow, nlrow)
 
def printRow (self, Row, row, not, None)
 
def printSol (self, Solution, solution=None, write_zeros=False)
 
def printStatistics (self)
 
def printVersion (self)
 
def propagateProbing (self, maxproprounds)
 
def readParams (self, file)
 
def readProblem (self, filename, extension=None)
 
def readSol (self, filename)
 
def readSolFile (self, filename)
 
def redirectOutput (self)
 
def releaseRow (self, Row, row, not, None)
 
def repropagateNode (self, Node, node)
 
def resetParam (self, name)
 
def resetParams (self)
 
def restartSolve (self)
 
def separateSol (self, Solution, sol=None, pretendroot=False, allowlocal=True, onlydelayed=False)
 
def setBendersSubproblemIsConvex (self, Benders, benders, probnumber, isconvex=True)
 
def setBoolParam (self, name, value)
 
def setCharParam (self, name, value)
 
def setCheck (self, Constraint, cons, newCheck)
 
def setEmphasis (self, paraemphasis, quiet=True)
 
def setEnforced (self, Constraint, cons, newEnf)
 
def setHeuristics (self, setting)
 
def setInitial (self, Constraint, cons, newInit)
 
def setIntParam (self, name, value)
 
def setLogfile (self, path)
 
def setLongintParam (self, name, value)
 
def setMaximize (self)
 
def setMinimize (self)
 
def setObjective (self, coeffs, sense='minimize', clear='true')
 
def setObjIntegral (self)
 
def setObjlimit (self, objlimit)
 
def setParam (self, name, value)
 
def setParams (self, params)
 
def setParamsCountsols (self)
 
def setPresolve (self, setting)
 
def setProbName (self, name)
 
def setRealParam (self, name, value)
 
def setRelaxSolVal (self, Variable, var, val)
 
def setRemovable (self, Constraint, cons, newRem)
 
def setSeparating (self, setting)
 
def setSolVal (self, Solution, solution, Variable, var, val)
 
def setStringParam (self, name, value)
 
def setupBendersSubproblem (self, probnumber, Benders, benders=None, Solution, solution=None, checktype=PY_SCIP_BENDERSENFOTYPE.LP)
 
def solveBendersSubproblem (self, probnumber, solvecip, Benders, benders=None, Solution, solution=None)
 
def solveConcurrent (self)
 
def solveDiveLP (self, itlim=-1)
 
def solveProbingLP (self, itlim=-1)
 
def startDive (self)
 
def startProbing (self)
 
def tightenVarLb (self, Variable, var, lb, force=False)
 
def tightenVarLbGlobal (self, Variable, var, lb, force=False)
 
def tightenVarUb (self, Variable, var, ub, force=False)
 
def tightenVarUbGlobal (self, Variable, var, ub, force=False)
 
def to_ptr (self, give_ownership)
 
def trySol (self, Solution, solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, free=True)
 
def updateBendersLowerbounds (self, lowerbounds, Benders, benders=None)
 
def updateNodeLowerbound (self, Node, node, lb)
 
def version (self)
 
def writeBestSol (self, filename="origprob.sol", write_zeros=False)
 
def writeBestTransSol (self, filename="transprob.sol", write_zeros=False)
 
def writeLP (self, filename="LP.lp")
 
def writeName (self, Variable, var)
 
def writeParams (self, filename='param.set', comments=True, onlychanged=True)
 
def writeProblem (self, filename='model.cip', trans=False, genericnames=False)
 
def writeSol (self, Solution, solution, filename="origprob.sol", write_zeros=False)
 
def writeStatistics (self, filename="origprob.stats")
 
def writeTransSol (self, Solution, solution, filename="transprob.sol", write_zeros=False)
 

Static Public Member Functions

def from_ptr (capsule, take_ownership)
 

Static Public Attributes

 model = Model(createscip=False)
 

Detailed Description

Main class holding a pointer to SCIP for managing most interactions

Definition at line 939 of file scip.pyx.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  problemName = 'model',
  defaultPlugins = True,
  Model,
  sourceModel = None,
  origcopy = False,
  globalcopy = True,
  enablepricing = False,
  createscip = True,
  threadsafe = False 
)
:param problemName: name of the problem (default 'model')
:param defaultPlugins: use default plugins? (default True)
:param sourceModel: create a copy of the given Model instance (default None)
:param origcopy: whether to call copy or copyOrig (default False)
:param globalcopy: whether to create a global or a local copy (default True)
:param enablepricing: whether to enable pricing in copy (default False)
:param createscip: initialize the Model object and creates a SCIP instance
:param threadsafe: False if data can be safely shared between the source and target problem

Definition at line 942 of file scip.pyx.

References Model._bestSol, Model._freescip, Model._modelvars, Model._scip, Model.createProbBasic(), Model.includeDefaultPlugins(), SCIPcopy(), SCIPcopyOrig(), SCIPcreate(), pyscipopt.scip.str_conversion, and Model.version().

Member Function Documentation

◆ __dealloc__()

def __dealloc__ (   self)

Definition at line 981 of file scip.pyx.

References Model._freescip, Model._scip, and SCIPfree().

◆ __eq__()

def __eq__ (   self,
  other 
)

◆ __hash__()

def __hash__ (   self)

Definition at line 987 of file scip.pyx.

References Model._scip.

◆ activateBenders()

def activateBenders (   self,
  Benders,
  benders,
  int,
  nsubproblems 
)
Activates the Benders' decomposition plugin with the input name

Keyword arguments:
benders -- the Benders' decomposition to which the subproblem belongs to
nsubproblems -- the number of subproblems in the Benders' decomposition

Definition at line 3343 of file scip.pyx.

References Model._scip, and SCIPactivateBenders().

◆ addBendersSubproblem()

def addBendersSubproblem (   self,
  Benders,
  benders,
  subproblem 
)
adds a subproblem to the Benders' decomposition given by the input
name.

Keyword arguments:
benders -- the Benders' decomposition to which the subproblem belongs to
subproblem --  the subproblem to add to the decomposition
isconvex -- can be used to specify whether the subproblem is convex

Definition at line 3352 of file scip.pyx.

References Model._scip, and SCIPaddBendersSubproblem().

◆ addCons()

def addCons (   self,
  cons,
  name = '',
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add a linear or nonlinear constraint.

:param cons: constraint object
:param name: the name of the constraint, generic name if empty (Default value = '')
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be  moved to a more global node? (Default value = False)
:return The added @ref scip#Constraint "Constraint" object.

Definition at line 2011 of file scip.pyx.

References Model._addGenNonlinearCons(), Model._addLinCons(), Model._addNonlinearCons(), Model._addQuadCons(), Model._scip, SCIPgetNConss(), and SCIPinfinity().

◆ addConsAnd()

def addConsAnd (   self,
  vars,
  resvar,
  name = "ANDcons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add an AND-constraint.
:param vars: list of BINARY variables to be included (operators)
:param resvar: BINARY variable (resultant)
:param name: name of the constraint (Default value = "ANDcons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2492 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPcreateConsAnd(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.

◆ addConsCardinality()

def addConsCardinality (   self,
  consvars,
  cardval,
  indvars = None,
  weights = None,
  name = "CardinalityCons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add a cardinality constraint that allows at most 'cardval' many nonzero variables.

:param consvars: list of variables to be included
:param cardval: nonnegative integer
:param indvars: indicator variables indicating which variables may be treated as nonzero in cardinality constraint, or None if new indicator variables should be introduced automatically (Default value = None)
:param weights: weights determining the variable order, or None if variables should be ordered in the same way they were added to the constraint (Default value = None)
:param name: name of the constraint (Default value = "CardinalityCons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2609 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPaddVarCardinality(), SCIPappendVarCardinality(), SCIPcreateConsCardinality(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.

◆ addConsCoeff()

def addConsCoeff (   self,
  Constraint,
  cons,
  Variable,
  var,
  coeff 
)
Add coefficient to the linear constraint (if non-zero).

:param Constraint cons: constraint to be changed
:param Variable var: variable to be added
:param coeff: coefficient of new variable

Definition at line 2377 of file scip.pyx.

References Model._scip, and SCIPaddCoefLinear().

◆ addConsIndicator()

def addConsIndicator (   self,
  cons,
  binvar = None,
  activeone = True,
  name = "IndicatorCons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add an indicator constraint for the linear inequality 'cons'.

The 'binvar' argument models the redundancy of the linear constraint. A solution for which
'binvar' is 1 must satisfy the constraint.

:param cons: a linear inequality of the form "<="
:param binvar: binary indicator variable, or None if it should be created (Default value = None)
:param activeone: constraint should active if binvar is 1 (0 if activeone = False)
:param name: name of the constraint (Default value = "IndicatorCons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2660 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPaddVarIndicator(), SCIPcreateConsIndicator(), SCIPgetNegatedVar(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.

◆ addConsLocal()

def addConsLocal (   self,
  Constraint,
  cons,
  Node,
  validnode = None 
)
Add a constraint to the current node

:param Constraint cons: constraint to add
:param Node validnode: more global node where cons is also valid

Definition at line 2401 of file scip.pyx.

References Model._scip, and SCIPaddConsLocal().

◆ addConsNode()

def addConsNode (   self,
  Node,
  node,
  Constraint,
  cons,
  Node,
  validnode = None 
)
Add a constraint to the given node

:param Node node: node to add the constraint to
:param Constraint cons: constraint to add
:param Node validnode: more global node where cons is also valid

Definition at line 2387 of file scip.pyx.

References Model._scip, and SCIPaddConsNode().

◆ addConsOr()

def addConsOr (   self,
  vars,
  resvar,
  name = "ORcons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add an OR-constraint.
:param vars: list of BINARY variables to be included (operators)
:param resvar: BINARY variable (resultant)
:param name: name of the constraint (Default value = "ORcons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2531 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPcreateConsOr(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.

◆ addConss()

def addConss (   self,
  conss,
  name = '',
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Adds multiple linear or quadratic constraints.

Each of the constraints is added to the model using Model.addCons().

For all parameters, except @p conss, this method behaves differently depending on the type of the passed argument:
  1. If the value is iterable, it must be of the same length as @p conss. For each constraint, Model.addCons() will be called with the value at the corresponding index.
  2. Else, the (default) value will be applied to all of the constraints.

:param conss An iterable of constraint objects. Any iterable will be converted into a list before further processing.
:param name: the names of the constraints, generic name if empty (Default value = ''). If a single string is passed, it will be suffixed by an underscore and the enumerated index of the constraint (starting with 0).
:param initial: should the LP relaxation of constraints be in the initial LP? (Default value = True)
:param separate: should the constraints be separated during LP processing? (Default value = True)
:param enforce: should the constraints be enforced during node processing? (Default value = True)
:param check: should the constraints be checked for feasibility? (Default value = True)
:param propagate: should the constraints be propagated during node processing? (Default value = True)
:param local: are the constraints only valid locally? (Default value = False)
:param modifiable: are the constraints modifiable (subject to column generation)? (Default value = False)
:param dynamic: are the constraints subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraints always be kept at the node where it was added, even if it may be  @oved to a more global node? (Default value = False)
:return A list of added @ref scip#Constraint "Constraint" objects.

:see addCons()

Definition at line 2057 of file scip.pyx.

References Model.addCons().

◆ addConsSOS1()

def addConsSOS1 (   self,
  vars,
  weights = None,
  name = "SOS1cons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add an SOS1 constraint.

:param vars: list of variables to be included
:param weights: list of weights (Default value = None)
:param name: name of the constraint (Default value = "SOS1cons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2414 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPaddVarSOS1(), SCIPappendVarSOS1(), SCIPcreateConsSOS1(), and pyscipopt.scip.str_conversion.

◆ addConsSOS2()

def addConsSOS2 (   self,
  vars,
  weights = None,
  name = "SOS2cons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add an SOS2 constraint.

:param vars: list of variables to be included
:param weights: list of weights (Default value = None)
:param name: name of the constraint (Default value = "SOS2cons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: is the constraint only valid locally? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2453 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPaddVarSOS2(), SCIPappendVarSOS2(), SCIPcreateConsSOS2(), and pyscipopt.scip.str_conversion.

◆ addConsXor()

def addConsXor (   self,
  vars,
  rhsvar,
  name = "XORcons",
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Add a XOR-constraint.
:param vars: list of BINARY variables to be included (operators)
:param rhsvar: BOOLEAN value, explicit True, False or bool(obj) is needed (right-hand side)
:param name: name of the constraint (Default value = "XORcons")
:param initial: should the LP relaxation of constraint be in the initial LP? (Default value = True)
:param separate: should the constraint be separated during LP processing? (Default value = True)
:param enforce: should the constraint be enforced during node processing? (Default value = True)
:param check: should the constraint be checked for feasibility? (Default value = True)
:param propagate: should the constraint be propagated during node processing? (Default value = True)
:param local: is the constraint only valid locally? (Default value = False)
:param modifiable: is the constraint modifiable (subject to column generation)? (Default value = False)
:param dynamic: is the constraint subject to aging? (Default value = False)
:param removable: should the relaxation be removed from the LP due to aging or cleanup? (Default value = False)
:param stickingatnode: should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? (Default value = False)

Definition at line 2570 of file scip.pyx.

References Model._scip, SCIPaddCons(), SCIPcreateConsXor(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.

◆ addCut()

def addCut (   self,
  Row,
  cut,
  not,
  None,
  forcecut = False 
)
adds cut to separation storage and returns whether cut has been detected to be infeasible for local bounds

Definition at line 1968 of file scip.pyx.

References Model._scip, and SCIPaddRow().

◆ addObjoffset()

def addObjoffset (   self,
  offset,
  solutions = False 
)
Add constant offset to objective

:param offset: offset to add
:param solutions: add offset also to existing solutions (Default value = False)

Definition at line 1311 of file scip.pyx.

References Model._scip, SCIPaddObjoffset(), and SCIPaddOrigObjoffset().

◆ addPoolCut()

def addPoolCut (   self,
  Row,
  row,
  not,
  None 
)
if not already existing, adds row to global cut pool

Definition at line 1952 of file scip.pyx.

References Model._scip, and SCIPaddPoolCut().

◆ addPyCons()

def addPyCons (   self,
  Constraint,
  cons 
)
Adds a customly created cons.

:param Constraint cons: constraint to add

Definition at line 2733 of file scip.pyx.

References Model._scip, and SCIPaddCons().

◆ addRowDive()

def addRowDive (   self,
  Row,
  row 
)
adds a row to the LP in current dive

Definition at line 4067 of file scip.pyx.

References Model._scip, and SCIPaddRowDive().

◆ addSol()

def addSol (   self,
  Solution,
  solution,
  free = True 
)
Try to add a solution to the storage.

:param Solution solution: solution to store
:param free: should solution be freed afterwards? (Default value = True)

Definition at line 4400 of file scip.pyx.

References Model._scip, SCIPaddSol(), and SCIPaddSolFree().

◆ addVar()

def addVar (   self,
  name = '',
  vtype = 'C',
  lb = 0.0,
  ub = None,
  obj = 0.0,
  pricedVar = False,
  pricedVarScore = 1.0 
)
Create a new variable. Default variable is non-negative and continuous.

:param name: name of the variable, generic if empty (Default value = '')
:param vtype: type of the variable: 'C' continuous, 'I' integer, 'B' binary, and 'M' implicit integer
(see https://www.scipopt.org/doc/html/FAQ.php#implicitinteger) (Default value = 'C')
:param lb: lower bound of the variable, use None for -infinity (Default value = 0.0)
:param ub: upper bound of the variable, use None for +infinity (Default value = None)
:param obj: objective value of variable (Default value = 0.0)
:param pricedVar: is the variable a pricing candidate? (Default value = False)
:param pricedVarScore: score of variable in case it is priced, the higher the better (Default value = 1.0)

Definition at line 1418 of file scip.pyx.

References Model._modelvars, Model._scip, SCIPaddPricedVar(), SCIPaddVar(), SCIPcreateVarBasic(), SCIPgetNVars(), SCIPinfinity(), SCIPreleaseVar(), SCIPvarSetData(), and pyscipopt.scip.str_conversion.

◆ addVarLocks()

def addVarLocks (   self,
  Variable,
  var,
  nlocksdown,
  nlocksup 
)
adds given values to lock numbers of variable for rounding

:param Variable var: variable to adjust the locks for
:param nlocksdown: new number of down locks
:param nlocksup: new number of up locks

Definition at line 1487 of file scip.pyx.

References Model._scip, and SCIPaddVarLocks().

◆ addVarSOS1()

def addVarSOS1 (   self,
  Constraint,
  cons,
  Variable,
  var,
  weight 
)
Add variable to SOS1 constraint.

:param Constraint cons: SOS1 constraint
:param Variable var: new variable
:param weight: weight of new variable

Definition at line 2742 of file scip.pyx.

References Model._scip, and SCIPaddVarSOS1().

◆ addVarSOS2()

def addVarSOS2 (   self,
  Constraint,
  cons,
  Variable,
  var,
  weight 
)
Add variable to SOS2 constraint.

:param Constraint cons: SOS2 constraint
:param Variable var: new variable
:param weight: weight of new variable

Definition at line 2761 of file scip.pyx.

References Model._scip, and SCIPaddVarSOS2().

◆ addVarToRow()

def addVarToRow (   self,
  Row,
  row,
  not,
  None,
  Variable,
  var,
  not,
  None,
  value 
)
resolves variable to columns and adds them with the coefficient to the row

Definition at line 1926 of file scip.pyx.

References Model._scip, and SCIPaddVarToRow().

◆ appendVarSOS1()

def appendVarSOS1 (   self,
  Constraint,
  cons,
  Variable,
  var 
)
Append variable to SOS1 constraint.

:param Constraint cons: SOS1 constraint
:param Variable var: variable to append

Definition at line 2752 of file scip.pyx.

References Model._scip, and SCIPappendVarSOS1().

◆ appendVarSOS2()

def appendVarSOS2 (   self,
  Constraint,
  cons,
  Variable,
  var 
)
Append variable to SOS2 constraint.

:param Constraint cons: SOS2 constraint
:param Variable var: variable to append

Definition at line 2771 of file scip.pyx.

References Model._scip, and SCIPappendVarSOS2().

◆ applyCutsProbing()

def applyCutsProbing (   self)
applies the cuts in the separation storage to the LP and clears the storage afterwards;
this method can only be applied during probing; the user should resolve the probing LP afterwards
in order to get a new solution
returns:
cutoff -- whether an empty domain was created

Definition at line 4166 of file scip.pyx.

References Model._scip, and SCIPapplyCutsProbing().

◆ backtrackProbing()

def backtrackProbing (   self,
  probingdepth 
)
undoes all changes to the problem applied in probing up to the given probing depth
:param probingdepth: probing depth of the node in the probing path that should be reactivated

Definition at line 4106 of file scip.pyx.

References Model._scip, and SCIPbacktrackProbing().

◆ branchVar()

def branchVar (   self,
  variable 
)
Branch on a non-continuous variable.

:param variable: Variable to branch on
:return: tuple(downchild, eqchild, upchild) of Nodes of the left, middle and right child. Middle child only exists
    if branch variable is integer (it is None otherwise)

Definition at line 3953 of file scip.pyx.

References Model._scip, and SCIPbranchVar().

◆ branchVarVal()

def branchVarVal (   self,
  variable,
  value 
)
Branches on variable using a value which separates the domain of the variable.

:param variable: Variable to branch on
:param value: float, value to branch on
:return: tuple(downchild, eqchild, upchild) of Nodes of the left, middle and right child. Middle child only exists
    if branch variable is integer (it is None otherwise)

Definition at line 3969 of file scip.pyx.

References Model._scip, and SCIPbranchVarVal().

◆ cacheRowExtensions()

def cacheRowExtensions (   self,
  Row,
  row,
  not,
  None 
)
informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
after all additions were applied, flushRowExtensions() must be called;
while the caching of row extensions is activated, information methods of the row give invalid results;
caching should be used, if a row is build with addVarToRow() calls variable by variable to increase the performance

Definition at line 1915 of file scip.pyx.

References Model._scip, and SCIPcacheRowExtensions().

◆ calcChildEstimate()

def calcChildEstimate (   self,
  Variable,
  variable,
  targetvalue 
)
Calculates an estimate for the objective of the best feasible solution
contained in the subtree after applying the given branching;
this estimate can be given to the SCIPcreateChild() call

:param variable: Variable to compute the estimate for
:param targetvalue: new value of the variable in the child node
:return: objective estimate of the best solution in the subtree after applying the given branching

Definition at line 3999 of file scip.pyx.

References Model._scip, and SCIPcalcChildEstimate().

◆ calcNodeselPriority()

def calcNodeselPriority (   self,
  Variable,
  variable,
  branchdir,
  targetvalue 
)
calculates the node selection priority for moving the given variable's LP value
to the given target value;
this node selection priority can be given to the SCIPcreateChild() call

:param variable: variable on which the branching is applied
:param branchdir: type of branching that was performed
:param targetvalue: new value of the variable in the child node
:return: node selection priority for moving the given variable's LP value to the given target value

Definition at line 3986 of file scip.pyx.

References Model._scip, and SCIPcalcNodeselPriority().

◆ catchEvent()

def catchEvent (   self,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
catches a global (not variable or row dependent) event

Definition at line 4583 of file scip.pyx.

References Model._scip, SCIPcatchEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ catchRowEvent()

def catchRowEvent (   self,
  Row,
  row,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
catches a row coefficient, constant, or side change event on the given row

Definition at line 4623 of file scip.pyx.

References Model._scip, SCIPcatchRowEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ catchVarEvent()

def catchVarEvent (   self,
  Variable,
  var,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
catches an objective value or domain change event on the given transformed variable

Definition at line 4603 of file scip.pyx.

References Model._scip, SCIPcatchVarEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ checkBendersSubproblemOptimality()

def checkBendersSubproblemOptimality (   self,
  Solution,
  solution,
  probnumber,
  Benders,
  benders = None 
)
Returns whether the subproblem is optimal w.r.t the master problem auxiliary variables.

Keyword arguments:
solution -- the master problem solution that is being checked for optimamlity
probnumber -- the problem number for which optimality is being checked
benders -- the Benders' decomposition to which the subproblem belongs to

Definition at line 3500 of file scip.pyx.

References Model._scip, SCIPcheckBendersSubproblemOptimality(), and SCIPfindBenders().

◆ checkQuadraticNonlinear()

def checkQuadraticNonlinear (   self,
  Constraint,
  cons 
)
returns if the given constraint is quadratic

:param Constraint cons: constraint

Definition at line 3013 of file scip.pyx.

References Model._scip, and SCIPcheckQuadraticNonlinear().

◆ checkSol()

def checkSol (   self,
  Solution,
  solution,
  printreason = True,
  completely = False,
  checkbounds = True,
  checkintegrality = True,
  checklprows = True,
  original = False 
)
Check given primal solution for feasibility without adding it to the storage.

:param Solution solution: solution to store
:param printreason: should all reasons of violations be printed? (Default value = True)
:param completely: should all violation be checked? (Default value = False)
:param checkbounds: should the bounds of the variables be checked? (Default value = True)
:param checkintegrality: has integrality to be checked? (Default value = True)
:param checklprows: have current LP rows (both local and global) to be checked? (Default value = True)
:param original: must the solution be checked against the original problem (Default value = False)

Definition at line 4381 of file scip.pyx.

References Model._scip, SCIPcheckSol(), and SCIPcheckSolOrig().

◆ chgLhs()

def chgLhs (   self,
  Constraint,
  cons,
  lhs 
)
Change left hand side value of a constraint.

:param Constraint cons: linear or quadratic constraint
:param lhs: new left hand side (set to None for -infinity)

Definition at line 2835 of file scip.pyx.

References Model._scip, SCIPchgLhsLinear(), SCIPchgLhsNonlinear(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPinfinity().

◆ chgReoptObjective()

def chgReoptObjective (   self,
  coeffs,
  sense = 'minimize' 
)
Establish the objective function as a linear expression.

:param coeffs: the coefficients
:param sense: the objective sense (Default value = 'minimize')

Definition at line 4922 of file scip.pyx.

References Model._scip, SCIPchgReoptObjective(), SCIPgetNOrigVars(), and SCIPgetOrigVars().

◆ chgRhs()

def chgRhs (   self,
  Constraint,
  cons,
  rhs 
)
Change right hand side value of a constraint.

:param Constraint cons: linear or quadratic constraint
:param rhs: new ride hand side (set to None for +infinity)

Definition at line 2816 of file scip.pyx.

References Model._scip, SCIPchgRhsLinear(), SCIPchgRhsNonlinear(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPinfinity().

◆ chgRowLhsDive()

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

Definition at line 4055 of file scip.pyx.

References Model._scip, and SCIPchgRowLhsDive().

◆ chgRowRhsDive()

def chgRowRhsDive (   self,
  Row,
  row,
  newrhs 
)
changes row rhs in current dive, change will be undone after diving
ends, for permanent changes use SCIPchgRowLhs()

Definition at line 4061 of file scip.pyx.

References Model._scip, and SCIPchgRowRhsDive().

◆ chgVarBranchPriority()

def chgVarBranchPriority (   self,
  Variable,
  var,
  priority 
)
Sets the branch priority of the variable.
Variables with higher branch priority are always preferred to variables with lower priority in selection of branching variable.

:param Variable var: variable to change priority of
:param priority: the new priority of the variable (the default branching priority is 0)

Definition at line 4968 of file scip.pyx.

References Model._scip, and SCIPchgVarBranchPriority().

◆ chgVarLb()

def chgVarLb (   self,
  Variable,
  var,
  lb 
)
Changes the lower bound of the specified variable.

:param Variable var: variable to change bound of
:param lb: new lower bound (set to None for -infinity)

Definition at line 1589 of file scip.pyx.

References Model._scip, SCIPchgVarLb(), and SCIPinfinity().

◆ chgVarLbDive()

def chgVarLbDive (   self,
  Variable,
  var,
  newbound 
)
changes variable's current lb in current dive

Definition at line 4039 of file scip.pyx.

References Model._scip, and SCIPchgVarLbDive().

◆ chgVarLbGlobal()

def chgVarLbGlobal (   self,
  Variable,
  var,
  lb 
)
Changes the global lower bound of the specified variable.

:param Variable var: variable to change bound of
:param lb: new lower bound (set to None for -infinity)

Definition at line 1612 of file scip.pyx.

References Model._scip, SCIPchgVarLbGlobal(), and SCIPinfinity().

◆ chgVarLbNode()

def chgVarLbNode (   self,
  Node,
  node,
  Variable,
  var,
  lb 
)
Changes the lower bound of the specified variable at the given node.

:param Variable var: variable to change bound of
:param lb: new lower bound (set to None for -infinity)

Definition at line 1634 of file scip.pyx.

References Model._scip, SCIPchgVarLbNode(), and SCIPinfinity().

◆ chgVarLbProbing()

def chgVarLbProbing (   self,
  Variable,
  var,
  lb 
)
changes the variable lower bound during probing mode

:param Variable var: variable to change bound of
:param lb: new lower bound (set to None for -infinity)

Definition at line 4120 of file scip.pyx.

References Model._scip, SCIPchgVarLbProbing(), and SCIPinfinity().

◆ chgVarObjDive()

def chgVarObjDive (   self,
  Variable,
  var,
  newobj 
)
changes (column) variable's objective value in current dive

Definition at line 4035 of file scip.pyx.

References Model._scip, and SCIPchgVarObjDive().

◆ chgVarObjProbing()

def chgVarObjProbing (   self,
  Variable,
  var,
  newobj 
)
changes (column) variable's objective value during probing mode

Definition at line 4116 of file scip.pyx.

References Model._scip, and SCIPchgVarObjProbing().

◆ chgVarType()

def chgVarType (   self,
  Variable,
  var,
  vtype 
)
Changes the type of a variable

:param Variable var: variable to change type of
:param vtype: new variable type

Definition at line 1656 of file scip.pyx.

References Model._scip, and SCIPchgVarType().

◆ chgVarUb()

def chgVarUb (   self,
  Variable,
  var,
  ub 
)
Changes the upper bound of the specified variable.

:param Variable var: variable to change bound of
:param ub: new upper bound (set to None for +infinity)

Definition at line 1600 of file scip.pyx.

References Model._scip, SCIPchgVarUb(), and SCIPinfinity().

◆ chgVarUbDive()

def chgVarUbDive (   self,
  Variable,
  var,
  newbound 
)
changes variable's current ub in current dive

Definition at line 4043 of file scip.pyx.

References Model._scip, and SCIPchgVarUbDive().

◆ chgVarUbGlobal()

def chgVarUbGlobal (   self,
  Variable,
  var,
  ub 
)
Changes the global upper bound of the specified variable.

:param Variable var: variable to change bound of
:param ub: new upper bound (set to None for +infinity)

Definition at line 1623 of file scip.pyx.

References Model._scip, SCIPchgVarUbGlobal(), and SCIPinfinity().

◆ chgVarUbNode()

def chgVarUbNode (   self,
  Node,
  node,
  Variable,
  var,
  ub 
)
Changes the upper bound of the specified variable at the given node.

:param Variable var: variable to change bound of
:param ub: new upper bound (set to None for +infinity)

Definition at line 1645 of file scip.pyx.

References Model._scip, SCIPchgVarUbNode(), and SCIPinfinity().

◆ chgVarUbProbing()

def chgVarUbProbing (   self,
  Variable,
  var,
  ub 
)
changes the variable upper bound during probing mode

:param Variable var: variable to change bound of
:param ub: new upper bound (set to None for +infinity)

Definition at line 4130 of file scip.pyx.

References Model._scip, SCIPchgVarUbProbing(), and SCIPinfinity().

◆ computeBestSolSubproblems()

def computeBestSolSubproblems (   self)
Solves the subproblems with the best solution to the master problem.
Afterwards, the best solution from each subproblem can be queried to get
the solution to the original problem.

If the user wants to resolve the subproblems, they must free them by
calling freeBendersSubproblems()

Definition at line 3281 of file scip.pyx.

References Model._bestSol, Model._scip, SCIPbendersGetNSubproblems(), SCIPgetBenders(), SCIPgetNActiveBenders(), SCIPsetupBendersSubproblem(), and SCIPsolveBendersSubproblem().

◆ constructLP()

def constructLP (   self)
makes sure that the LP of the current node is loaded and
 may be accessed through the LP information methods

:return:  bool cutoff, i.e. can the node be cut off?

Definition at line 1788 of file scip.pyx.

References Model._scip, and SCIPconstructLP().

◆ count()

def count (   self)
Counts the number of feasible points of problem.

Definition at line 4896 of file scip.pyx.

References Model._scip, and SCIPcount().

◆ createChild()

def createChild (   self,
  nodeselprio,
  estimate 
)
Create a child node of the focus node.

:param nodeselprio: float, node selection priority of new node
:param estimate: float, estimate for(transformed) objective value of best feasible solution in subtree
:return: Node, the child which was created

Definition at line 4011 of file scip.pyx.

References Model._scip, and SCIPcreateChild().

◆ createCons()

def createCons (   self,
  Conshdlr,
  conshdlr,
  name,
  initial = True,
  separate = True,
  enforce = True,
  check = True,
  propagate = True,
  local = False,
  modifiable = False,
  dynamic = False,
  removable = False,
  stickingatnode = False 
)
Create a constraint of a custom constraint handler

:param Conshdlr conshdlr: constraint handler
:param name: name of constraint
:param initial:  (Default value = True)
:param separate:  (Default value = True)
:param enforce:  (Default value = True)
:param check:  (Default value = True)
:param propagate:  (Default value = True)
:param local:  (Default value = False)
:param modifiable:  (Default value = False)
:param dynamic:  (Default value = False)
:param removable:  (Default value = False)
:param stickingatnode:  (Default value = False)

Definition at line 3621 of file scip.pyx.

References Model._scip, SCIPcreateCons(), SCIPfindConshdlr(), and pyscipopt.scip.str_conversion.

◆ createEmptyRowSepa()

def createEmptyRowSepa (   self,
  Sepa,
  sepa,
  name = "row",
  lhs = 0.0,
  rhs = None,
  local = True,
  modifiable = False,
  removable = True 
)
creates and captures an LP row without any coefficients from a separator

:param sepa: separator that creates the row
:param name: name of row (Default value = "row")
:param lhs: left hand side of row (Default value = 0)
:param rhs: right hand side of row (Default value = None)
:param local: is row only valid locally? (Default value = True)
:param modifiable: is row modifiable during node processing (subject to column generation)? (Default value = False)
:param removable: should the row be removed from the LP due to aging or cleanup? (Default value = True)

Definition at line 1866 of file scip.pyx.

References Model._scip, SCIPcreateEmptyRowSepa(), SCIPfindSepa(), SCIPinfinity(), and pyscipopt.scip.str_conversion.

◆ createEmptyRowUnspec()

def createEmptyRowUnspec (   self,
  name = "row",
  lhs = 0.0,
  rhs = None,
  local = True,
  modifiable = False,
  removable = True 
)
creates and captures an LP row without any coefficients from an unspecified source

:param name: name of row (Default value = "row")
:param lhs: left hand side of row (Default value = 0)
:param rhs: right hand side of row (Default value = None)
:param local: is row only valid locally? (Default value = True)
:param modifiable: is row modifiable during node processing (subject to column generation)? (Default value = False)
:param removable: should the row be removed from the LP due to aging or cleanup? (Default value = True)

Definition at line 1885 of file scip.pyx.

References Model._scip, SCIPcreateEmptyRowUnspec(), SCIPinfinity(), and pyscipopt.scip.str_conversion.

◆ createPartialSol()

def createPartialSol (   self,
  Heur,
  heur = None 
)
Create a partial primal solution, initialized to unknown values.
:param Heur heur: heuristic that found the solution (Default value = None)

Definition at line 4229 of file scip.pyx.

References Model._scip, SCIPcreatePartialSol(), SCIPfindHeur(), and pyscipopt.scip.str_conversion.

◆ createProbBasic()

def createProbBasic (   self,
  problemName = 'model' 
)
Create new problem instance with given name

:param problemName: name of model or problem (Default value = 'model')

Definition at line 1052 of file scip.pyx.

References Model._scip, SCIPcreateProbBasic(), and pyscipopt.scip.str_conversion.

◆ createSol()

def createSol (   self,
  Heur,
  heur = None 
)
Create a new primal solution.

:param Heur heur: heuristic that found the solution (Default value = None)

Definition at line 4211 of file scip.pyx.

References Model._scip, SCIPcreateSol(), SCIPfindHeur(), and pyscipopt.scip.str_conversion.

◆ delCons()

def delCons (   self,
  Constraint,
  cons 
)
Delete constraint from the model

:param Constraint cons: constraint to be deleted

Definition at line 3104 of file scip.pyx.

References Model._scip, and SCIPdelCons().

◆ delConsLocal()

def delConsLocal (   self,
  Constraint,
  cons 
)
Delete constraint from the current node and it's children

:param Constraint cons: constraint to be deleted

Definition at line 3112 of file scip.pyx.

References Model._scip, and SCIPdelConsLocal().

◆ delVar()

def delVar (   self,
  Variable,
  var 
)
Delete a variable.

:param var: the variable which shall be deleted
:return: bool, was deleting succesful

Definition at line 1510 of file scip.pyx.

References Model._modelvars, Model._scip, and SCIPdelVar().

◆ disablePropagation()

def disablePropagation (   self,
  onlyroot = False 
)
Disables propagation in SCIP to avoid modifying the original problem during transformation.

:param onlyroot: use propagation when root processing is finished (Default value = False)

Definition at line 1385 of file scip.pyx.

References Model.setIntParam().

◆ dropEvent()

def dropEvent (   self,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
drops a global event (stops to track event)

Definition at line 4593 of file scip.pyx.

References Model._scip, SCIPdropEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ dropRowEvent()

def dropRowEvent (   self,
  Row,
  row,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
drops a row coefficient, constant, or side change event (stops to track event) on the given row

Definition at line 4633 of file scip.pyx.

References Model._scip, SCIPdropRowEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ dropVarEvent()

def dropVarEvent (   self,
  Variable,
  var,
  eventtype,
  Eventhdlr,
  eventhdlr 
)
drops an objective value or domain change event (stops to track event) on the given transformed variable

Definition at line 4613 of file scip.pyx.

References Model._scip, SCIPdropVarEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.

◆ enableReoptimization()

def enableReoptimization (   self,
  enable = True 
)
include specific heuristics and branching rules for reoptimization

Definition at line 1221 of file scip.pyx.

References Model._scip, and SCIPenableReoptimization().

◆ endDive()

def endDive (   self)
Quits probing and resets bounds and constraints to the focus node's environment

Definition at line 4031 of file scip.pyx.

References Model._scip, and SCIPendDive().

◆ endProbing()

def endProbing (   self)
Quits probing and resets bounds and constraints to the focus node's environment

Definition at line 4096 of file scip.pyx.

References Model._scip, and SCIPendProbing().

◆ epsilon()

def epsilon (   self)
Retrieve epsilon for e.g. equality checks

Definition at line 1145 of file scip.pyx.

References Model._scip, and SCIPepsilon().

◆ feasFrac()

def feasFrac (   self,
  value 
)
returns fractional part of value, i.e. x - floor(x) in feasible tolerance: x - floor(x+feastol)

Definition at line 1153 of file scip.pyx.

References Model._scip, and SCIPfeasFrac().

◆ feastol()

def feastol (   self)
Retrieve feasibility tolerance

Definition at line 1149 of file scip.pyx.

References Model._scip, and SCIPfeastol().

◆ fixVar()

def fixVar (   self,
  Variable,
  var,
  val 
)
Fixes the variable var to the value val if possible.

:param Variable var: variable to fix
:param val: float, the fix value
:return: tuple (infeasible, fixed) of booleans

Definition at line 1497 of file scip.pyx.

References Model._scip, and SCIPfixVar().

◆ fixVarProbing()

def fixVarProbing (   self,
  Variable,
  var,
  fixedval 
)
Fixes a variable at the current probing node.

Definition at line 4140 of file scip.pyx.

References Model._scip, and SCIPfixVarProbing().

◆ flushRowExtensions()

def flushRowExtensions (   self,
  Row,
  row,
  not,
  None 
)
flushes all cached row extensions after a call of cacheRowExtensions() and merges coefficients with equal columns into a single coefficient

Definition at line 1922 of file scip.pyx.

References Model._scip, and SCIPflushRowExtensions().

◆ frac()

def frac (   self,
  value 
)
returns fractional part of value, i.e. x - floor(x) in epsilon tolerance: x - floor(x+eps)

Definition at line 1157 of file scip.pyx.

References Model._scip, and SCIPfrac().

◆ freeBendersSubproblems()

def freeBendersSubproblems (   self)
Calls the free subproblem function for the Benders' decomposition.
This will free all subproblems for all decompositions.

Definition at line 3308 of file scip.pyx.

References Model._scip, SCIPbendersGetNSubproblems(), SCIPfreeBendersSubproblem(), SCIPgetBenders(), and SCIPgetNActiveBenders().

◆ freeProb()

def freeProb (   self)
Frees problem and solution process data

Definition at line 1061 of file scip.pyx.

References Model._scip, and SCIPfreeProb().

◆ freeReoptSolve()

def freeReoptSolve (   self)
Frees all solution process data and prepares for reoptimization

Definition at line 4918 of file scip.pyx.

References Model._scip, and SCIPfreeReoptSolve().

◆ freeSol()

def freeSol (   self,
  Solution,
  solution 
)
Free given solution

:param Solution solution: solution to be freed

Definition at line 4414 of file scip.pyx.

References Model._scip, and SCIPfreeSol().

◆ freeTransform()

def freeTransform (   self)
Frees all solution process data including presolving and transformed problem, only original problem is kept

Definition at line 1065 of file scip.pyx.

References Model._scip, and SCIPfreeTransform().

◆ from_ptr()

def from_ptr (   capsule,
  take_ownership 
)
static
Create a Model from a given pointer.

:param cpasule: The PyCapsule containing the SCIP pointer under the name "scip".
:param take_ownership: Whether the newly created Model assumes ownership of the
underlying Scip pointer (see `_freescip`).

Definition at line 1021 of file scip.pyx.

◆ getActivity()

def getActivity (   self,
  Constraint,
  cons,
  Solution,
  sol = None 
)
Retrieve activity of given constraint.
Can only be called after solving is completed.

:param Constraint cons: linear or quadratic constraint
:param Solution sol: solution to compute activity of, None to use current node's solution (Default value = None)

Definition at line 2882 of file scip.pyx.

References Model._scip, Model.getStage(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetActivityLinear().

◆ getBendersAuxiliaryVar()

def getBendersAuxiliaryVar (   self,
  probnumber,
  Benders,
  benders = None 
)
Returns the auxiliary variable that is associated with the input problem number

Keyword arguments:
probnumber -- the problem number for which the target variable belongs, -1 for master problem
benders -- the Benders' decomposition to which the subproblem variables belong to

Definition at line 3480 of file scip.pyx.

References Model._scip, SCIPbendersGetAuxiliaryVar(), and SCIPfindBenders().

◆ getBendersSubproblem()

def getBendersSubproblem (   self,
  probnumber,
  Benders,
  benders = None 
)
Returns a Model object that wraps around the SCIP instance of the subproblem.
NOTE: This Model object is just a place holder and SCIP instance will not be freed when the object is destroyed.

Keyword arguments:
probnumber -- the problem number for subproblem that is required
benders -- the Benders' decomposition object for the that the subproblem belongs to (Default = None)

Definition at line 3431 of file scip.pyx.

References Model._scip, SCIPbendersSubproblem(), and SCIPfindBenders().

◆ getBendersVar()

def getBendersVar (   self,
  Variable,
  var,
  Benders,
  benders = None,
  probnumber = -1 
)
Returns the variable for the subproblem or master problem
depending on the input probnumber

Keyword arguments:
var -- the source variable for which the target variable is requested
benders -- the Benders' decomposition to which the subproblem variables belong to
probnumber -- the problem number for which the target variable belongs, -1 for master problem

Definition at line 3451 of file scip.pyx.

References Model._scip, SCIPfindBenders(), SCIPgetBendersMasterVar(), and SCIPgetBendersSubproblemVar().

◆ getBestboundNode()

def getBestboundNode (   self)
gets the node with smallest lower bound from the tree (child, sibling, or leaf).

Definition at line 1753 of file scip.pyx.

References Model._scip, and SCIPgetBestboundNode().

◆ getBestChild()

def getBestChild (   self)
gets the best child of the focus node w.r.t. the node selection strategy.

Definition at line 1737 of file scip.pyx.

References Model._scip, and SCIPgetBestChild().

◆ getBestLeaf()

def getBestLeaf (   self)
gets the best leaf from the node queue w.r.t. the node selection strategy.

Definition at line 1745 of file scip.pyx.

References Model._scip, and SCIPgetBestLeaf().

◆ getBestNode()

def getBestNode (   self)
gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy.

Definition at line 1749 of file scip.pyx.

References Model._scip, and SCIPgetBestNode().

◆ getBestSibling()

def getBestSibling (   self)
gets the best sibling of the focus node w.r.t. the node selection strategy.

Definition at line 1741 of file scip.pyx.

References Model._scip, and SCIPgetBestSibling().

◆ getBestSol()

def getBestSol (   self)
Retrieve currently best known feasible primal solution.

Definition at line 4454 of file scip.pyx.

References Model._bestSol, Model._scip, and SCIPgetBestSol().

◆ getCondition()

def getCondition (   self,
  exact = False 
)
Get the current LP's condition number

:param exact: whether to get an estimate or the exact value (Default value = False)

Definition at line 1205 of file scip.pyx.

References Model._scip, SCIPgetLPI(), and SCIPlpiGetRealSolQuality().

◆ getConss()

def getConss (   self)
Retrieve all constraints.

Definition at line 3090 of file scip.pyx.

References Model._scip, SCIPgetConss(), and SCIPgetNConss().

◆ getCurrentNode()

def getCurrentNode (   self)
Retrieve current node.

Definition at line 1129 of file scip.pyx.

References Model._scip, and SCIPgetCurrentNode().

◆ getCutEfficacy()

def getCutEfficacy (   self,
  Row,
  cut,
  not,
  None,
  Solution,
  sol = None 
)
returns efficacy of the cut with respect to the given primal solution or the current LP solution: e = -feasibility/norm

Definition at line 1956 of file scip.pyx.

References Model._scip, and SCIPgetCutEfficacy().

◆ getCutLPSolCutoffDistance()

def getCutLPSolCutoffDistance (   self,
  Row,
  cut,
  not,
  None,
  Solution,
  sol,
  not,
  None 
)
returns row's cutoff distance in the direction of the given primal solution

Definition at line 1964 of file scip.pyx.

References Model._scip, and SCIPgetCutLPSolCutoffDistance().

◆ getDepth()

def getDepth (   self)
Retrieve the depth of the current node

Definition at line 1137 of file scip.pyx.

References Model._scip, and SCIPgetDepth().

◆ getDualbound()

def getDualbound (   self)
Retrieve the best dual bound.

Definition at line 4519 of file scip.pyx.

References Model._scip, and SCIPgetDualbound().

◆ getDualboundRoot()

def getDualboundRoot (   self)
Retrieve the best root dual bound.

Definition at line 4523 of file scip.pyx.

References Model._scip, and SCIPgetDualboundRoot().

◆ getDualfarkasLinear()

def getDualfarkasLinear (   self,
  Constraint,
  cons 
)
Retrieve the dual farkas value to a linear constraint.

:param Constraint cons: linear constraint

Definition at line 3179 of file scip.pyx.

References Model._scip, Model.getTransformedCons(), and SCIPgetDualfarkasLinear().

◆ getDualMultiplier()

def getDualMultiplier (   self,
  Constraint,
  cons 
)
DEPRECATED: Retrieve the dual solution to a linear constraint.

:param Constraint cons: linear constraint

Definition at line 3170 of file scip.pyx.

References Model.getDualsolLinear().

◆ getDualsolLinear()

def getDualsolLinear (   self,
  Constraint,
  cons 
)
Retrieve the dual solution to a linear constraint.

:param Constraint cons: linear constraint

Definition at line 3155 of file scip.pyx.

References Model._scip, Model.getTransformedCons(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetDualsolLinear().

◆ getDualSolVal()

def getDualSolVal (   self,
  Constraint,
  cons,
  boundconstraint = False 
)
Retrieve returns dual solution value of a constraint.

:param Constraint cons: constraint to get the dual solution value of
:param boundconstraint bool: Decides whether to store a bool if the constraint is a bound constraint

Definition at line 3207 of file scip.pyx.

References Model._scip, and SCIPgetDualSolVal().

◆ getGap()

def getGap (   self)
Retrieve the gap, i.e. |(primalbound - dualbound)/min(|primalbound|,|dualbound|)|.

Definition at line 1133 of file scip.pyx.

References Model._scip, and SCIPgetGap().

◆ getLhs()

def getLhs (   self,
  Constraint,
  cons 
)
Retrieve left hand side value of a constraint.

:param Constraint cons: linear or quadratic constraint

Definition at line 2868 of file scip.pyx.

References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLhsLinear(), and SCIPgetLhsNonlinear().

◆ getLocalEstimate()

def getLocalEstimate (   self,
  original = False 
)
gets estimate of best primal solution w.r.t. original or transformed problem contained in current subtree

:param original: estimate of original or transformed problem (Default value = False)

Definition at line 1345 of file scip.pyx.

References Model._scip, SCIPgetLocalOrigEstimate(), and SCIPgetLocalTransEstimate().

◆ getLPBasisInd()

def getLPBasisInd (   self)
Gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1

Definition at line 1828 of file scip.pyx.

References Model._scip, SCIPgetLPBasisInd(), and SCIPgetNLPRows().

◆ getLPBInvARow()

def getLPBInvARow (   self,
  row 
)
gets a row from B^-1 * A

Definition at line 1849 of file scip.pyx.

References Model._scip, SCIPgetLPBInvARow(), and SCIPgetNLPCols().

◆ getLPBInvRow()

def getLPBInvRow (   self,
  row 
)
gets a row from the inverse basis matrix B^-1

Definition at line 1838 of file scip.pyx.

References Model._scip, SCIPgetLPBInvRow(), and SCIPgetNLPRows().

◆ getLPBranchCands()

def getLPBranchCands (   self)
gets branching candidates for LP solution branching (fractional variables) along with solution values,
fractionalities, and number of branching candidates; The number of branching candidates does NOT account
for fractional implicit integer variables which should not be used for branching decisions. Fractional
implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1
branching rules should always select the branching candidate among the first npriolpcands of the candidate list

:return tuple (lpcands, lpcandssol, lpcadsfrac, nlpcands, npriolpcands, nfracimplvars) where

    lpcands: list of variables of LP branching candidates
    lpcandssol: list of LP candidate solution values
    lpcandsfrac list of LP candidate fractionalities
    nlpcands:    number of LP branching candidates
    npriolpcands: number of candidates with maximal priority
    nfracimplvars: number of fractional implicit integer variables

Definition at line 3901 of file scip.pyx.

References Model._scip, and SCIPgetLPBranchCands().

◆ getLPColsData()

def getLPColsData (   self)
Retrieve current LP columns

Definition at line 1804 of file scip.pyx.

References Model._scip, and SCIPgetLPColsData().

◆ getLPObjVal()

def getLPObjVal (   self)
gets objective value of current LP (which is the sum of column and loose objective value)

Definition at line 1799 of file scip.pyx.

References Model._scip, and SCIPgetLPObjval().

◆ getLPRowsData()

def getLPRowsData (   self)
Retrieve current LP rows

Definition at line 1812 of file scip.pyx.

References Model._scip, and SCIPgetLPRowsData().

◆ getLPSolstat()

def getLPSolstat (   self)
Gets solution status of current LP

Definition at line 1783 of file scip.pyx.

References Model._scip, and SCIPgetLPSolstat().

◆ getNBestSolsFound()

def getNBestSolsFound (   self)
gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found

Definition at line 4437 of file scip.pyx.

References Model._scip, and SCIPgetNBestSolsFound().

◆ getNBinVars()

def getNBinVars (   self)
gets number of binary active problem variables

Definition at line 1722 of file scip.pyx.

References Model._scip, and SCIPgetNBinVars().

◆ getNChildren()

def getNChildren (   self)
gets number of children of focus node.

Definition at line 1121 of file scip.pyx.

References Model._scip, and SCIPgetNChildren().

◆ getNConss() [1/2]

def getNConss (   self)
Retrieve the number of constraints.

Definition at line 1714 of file scip.pyx.

References Model._scip, and SCIPgetNConss().

◆ getNConss() [2/2]

def getNConss (   self)
Retrieve number of all constraints

Definition at line 3100 of file scip.pyx.

References Model._scip, Model.getNConss(), and SCIPgetNConss().

◆ getNCountedSols()

def getNCountedSols (   self)
Get number of feasible solution.

Definition at line 4904 of file scip.pyx.

References Model._scip, and SCIPgetNCountedSols().

◆ getNCuts()

def getNCuts (   self)
Retrieve total number of cuts in storage

Definition at line 1974 of file scip.pyx.

References Model._scip, and SCIPgetNCuts().

◆ getNCutsApplied()

def getNCutsApplied (   self)
Retrieve number of currently applied cuts

Definition at line 1978 of file scip.pyx.

References Model._scip, and SCIPgetNCutsApplied().

◆ getNFeasibleLeaves()

def getNFeasibleLeaves (   self)
Retrieve number of leaf nodes processed with feasible relaxation solution.

Definition at line 1109 of file scip.pyx.

References Model._scip, and SCIPgetNFeasibleLeaves().

◆ getNInfeasibleLeaves()

def getNInfeasibleLeaves (   self)
gets number of infeasible leaf nodes processed.

Definition at line 1113 of file scip.pyx.

References Model._scip, and SCIPgetNInfeasibleLeaves().

◆ getNIntVars()

def getNIntVars (   self)
gets number of integer active problem variables

Definition at line 1718 of file scip.pyx.

References Model._scip, and SCIPgetNIntVars().

◆ getNLeaves()

def getNLeaves (   self)
gets number of leaves in the tree.

Definition at line 1117 of file scip.pyx.

References Model._scip, and SCIPgetNLeaves().

◆ getNLimSolsFound()

def getNLimSolsFound (   self)
gets number of feasible primal solutions respecting the objective limit found so far

Definition at line 4433 of file scip.pyx.

References Model._scip, and SCIPgetNLimSolsFound().

◆ getNLPCols()

def getNLPCols (   self)
Retrieve the number of cols currently in the LP

Definition at line 1824 of file scip.pyx.

References Model._scip, and SCIPgetNLPCols().

◆ getNLPIterations()

def getNLPIterations (   self)
Retrieve the total number of LP iterations so far.

Definition at line 1097 of file scip.pyx.

References Model._scip, and SCIPgetNLPIterations().

◆ getNLPRows()

def getNLPRows (   self)
Retrieve the number of rows currently in the LP

Definition at line 1820 of file scip.pyx.

References Model._scip, and SCIPgetNLPRows().

◆ getNLPs()

def getNLPs (   self)
gets total number of LPs solved so far

Definition at line 4661 of file scip.pyx.

References Model._scip, and SCIPgetNLPs().

◆ getNlRowActivityBounds()

def getNlRowActivityBounds (   self,
  NLRow,
  nlrow 
)
gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds

Definition at line 3001 of file scip.pyx.

References Model._scip, and SCIPgetNlRowActivityBounds().

◆ getNlRows()

def getNlRows (   self)
returns a list with the nonlinear rows in SCIP's internal NLP

Definition at line 2968 of file scip.pyx.

References Model._scip, Model.getNNlRows(), and SCIPgetNLPNlRows().

◆ getNlRowSolActivity()

def getNlRowSolActivity (   self,
  NLRow,
  nlrow,
  Solution,
  sol = None 
)
gives the activity of a nonlinear row for a given primal solution
Keyword arguments:
nlrow -- nonlinear row
solution -- a primal solution, if None, then the current LP solution is used

Definition at line 2975 of file scip.pyx.

References Model._scip, and SCIPgetNlRowSolActivity().

◆ getNlRowSolFeasibility()

def getNlRowSolFeasibility (   self,
  NLRow,
  nlrow,
  Solution,
  sol = None 
)
gives the feasibility of a nonlinear row for a given primal solution
Keyword arguments:
nlrow -- nonlinear row
solution -- a primal solution, if None, then the current LP solution is used

Definition at line 2988 of file scip.pyx.

References Model._scip, and SCIPgetNlRowSolFeasibility().

◆ getNNlRows()

def getNNlRows (   self)
gets current number of nonlinear rows in SCIP's internal NLP

Definition at line 2964 of file scip.pyx.

References Model._scip, and SCIPgetNNLPNlRows().

◆ getNNodes()

def getNNodes (   self)
gets number of processed nodes in current run, including the focus node.

Definition at line 1101 of file scip.pyx.

References Model._scip, and SCIPgetNNodes().

◆ getNReaders()

def getNReaders (   self)
Get number of currently available readers.

Definition at line 4900 of file scip.pyx.

References Model._scip, and SCIPgetNReaders().

◆ getNSepaRounds()

def getNSepaRounds (   self)
Retrieve the number of separation rounds that have been performed
at the current node

Definition at line 1982 of file scip.pyx.

References Model._scip, and SCIPgetNSepaRounds().

◆ getNSiblings()

def getNSiblings (   self)
gets number of siblings of focus node.

Definition at line 1125 of file scip.pyx.

References Model._scip, and SCIPgetNSiblings().

◆ getNSols()

def getNSols (   self)
gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
   in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
   storage is returned

Definition at line 4422 of file scip.pyx.

References Model._scip, and SCIPgetNSols().

◆ getNSolsFound()

def getNSolsFound (   self)
gets number of feasible primal solutions found so far

Definition at line 4429 of file scip.pyx.

References Model._scip, and SCIPgetNSolsFound().

◆ getNTotalNodes()

def getNTotalNodes (   self)
gets number of processed nodes in all runs, including the focus node.

Definition at line 1105 of file scip.pyx.

References Model._scip, and SCIPgetNTotalNodes().

◆ getNVars()

def getNVars (   self)
Retrieve number of variables in the problems

Definition at line 1710 of file scip.pyx.

References Model._scip, and SCIPgetNVars().

◆ getObjective()

def getObjective (   self)
Retrieve objective function as Expr

Definition at line 1300 of file scip.pyx.

References Model.getVars().

◆ getObjectiveSense()

def getObjectiveSense (   self)
Retrieve objective sense.

Definition at line 4573 of file scip.pyx.

References Model._scip, and SCIPgetObjsense().

◆ getObjlimit()

def getObjlimit (   self)
returns current limit on objective function.

Definition at line 1252 of file scip.pyx.

References Model._scip, and SCIPgetObjlimit().

◆ getObjoffset()

def getObjoffset (   self,
  original = True 
)
Retrieve constant objective offset

:param original: offset of original or transformed problem (Default value = True)

Definition at line 1323 of file scip.pyx.

References Model._scip, SCIPgetOrigObjoffset(), and SCIPgetTransObjoffset().

◆ getObjVal()

def getObjVal (   self,
  original = True 
)
Retrieve the objective value of value of best solution.
Can only be called after solving is completed.

:param original: objective value in original space (Default value = True)

Definition at line 4475 of file scip.pyx.

References Model._bestSol, Model.getSolObjVal(), and Model.getStage().

◆ getOpenNodes()

def getOpenNodes (   self)
access to all data of open nodes (leaves, children, and siblings)

:return: three lists containing open leaves, children, siblings

Definition at line 1757 of file scip.pyx.

References Model._scip, and SCIPgetOpenNodesData().

◆ getParam()

def getParam (   self,
  name 
)
Get the value of a parameter of type
int, bool, real, long, char or str.

:param name: name of parameter

Definition at line 4787 of file scip.pyx.

References Model._scip, SCIPgetParam(), and pyscipopt.scip.str_conversion.

◆ getParams()

def getParams (   self)
Gets the values of all parameters as a dict mapping parameter names
to their values.

Definition at line 4816 of file scip.pyx.

References Model._scip, Model.getParam(), SCIPgetNParams(), and SCIPgetParams().

◆ getPresolvingTime()

def getPresolvingTime (   self)
Retrieve the curernt presolving time in seconds

Definition at line 1093 of file scip.pyx.

References Model._scip, and SCIPgetPresolvingTime().

◆ getPrimalbound()

def getPrimalbound (   self)
Retrieve the best primal bound.

Definition at line 4515 of file scip.pyx.

References Model._scip, and SCIPgetPrimalbound().

◆ getProbingDepth()

def getProbingDepth (   self)
returns the current probing depth

Definition at line 4112 of file scip.pyx.

References Model._scip, and SCIPgetProbingDepth().

◆ getProbName()

def getProbName (   self)
Retrieve problem name

Definition at line 1077 of file scip.pyx.

References Model._scip, and SCIPgetProbName().

◆ getPseudoBranchCands()

def getPseudoBranchCands (   self)
gets branching candidates for pseudo solution branching (non-fixed variables)
along with the number of candidates.

:return tuple (pseudocands, npseudocands, npriopseudocands) where

    pseudocands: list of variables of pseudo branching candidates
    npseudocands: number of pseudo branching candidates
    npriopseudocands: number of candidates with maximal priority

Definition at line 3933 of file scip.pyx.

References Model._scip, and SCIPgetPseudoBranchCands().

◆ getReadingTime()

def getReadingTime (   self)
Retrieve the current reading time in seconds

Definition at line 1089 of file scip.pyx.

References Model._scip, and SCIPgetReadingTime().

◆ getRhs()

def getRhs (   self,
  Constraint,
  cons 
)
Retrieve right hand side value of a constraint.

:param Constraint cons: linear or quadratic constraint

Definition at line 2854 of file scip.pyx.

References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetRhsLinear(), and SCIPgetRhsNonlinear().

◆ getRowActivity()

def getRowActivity (   self,
  Row,
  row 
)
returns the activity of a row in the last LP or pseudo solution

Definition at line 1902 of file scip.pyx.

References Model._scip, and SCIPgetRowActivity().

◆ getRowDualSol()

def getRowDualSol (   self,
  Row,
  row 
)
Gets the dual LP solution of a row

Definition at line 1947 of file scip.pyx.

References SCIProwGetDualsol().

◆ getRowLinear()

def getRowLinear (   self,
  Constraint,
  cons 
)
Retrieve the linear relaxation of the given linear constraint as a row.
   may return NULL if no LP row was yet created; the user must not modify the row!

:param Constraint cons: linear constraint to get the coefficients of

Definition at line 3141 of file scip.pyx.

References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetRowLinear().

◆ getRowLPActivity()

def getRowLPActivity (   self,
  Row,
  row 
)
returns the activity of a row in the last LP solution

Definition at line 1906 of file scip.pyx.

References Model._scip, and SCIPgetRowLPActivity().

◆ getRowNumIntCols()

def getRowNumIntCols (   self,
  Row,
  row 
)
Returns number of intergal columns in the row

Definition at line 1934 of file scip.pyx.

References Model._scip, and SCIPgetRowNumIntCols().

◆ getRowObjParallelism()

def getRowObjParallelism (   self,
  Row,
  row 
)
Returns 1 if the row is parallel, and 0 if orthogonal

Definition at line 1938 of file scip.pyx.

References Model._scip, and SCIPgetRowObjParallelism().

◆ getRowParallelism()

def getRowParallelism (   self,
  Row,
  row1,
  Row,
  row2,
  orthofunc = 101 
)
Returns the degree of parallelism between hyplerplanes. 1 if perfectly parallel, 0 if orthognal.
101 in this case is an 'e' (euclidean) in ASCII. The other accpetable input is 100 (d for discrete).

Definition at line 1942 of file scip.pyx.

References SCIProwGetParallelism().

◆ getSlack()

def getSlack (   self,
  Constraint,
  cons,
  Solution,
  sol = None,
  side = None 
)
Retrieve slack of given constraint.
Can only be called after solving is completed.


:param Constraint cons: linear or quadratic constraint
:param Solution sol: solution to compute slack of, None to use current node's solution (Default value = None)
:param side: whether to use 'lhs' or 'rhs' for ranged constraints, None to return minimum (Default value = None)

Definition at line 2910 of file scip.pyx.

References Model._scip, Model.getStage(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetActivityLinear(), SCIPgetLhsLinear(), and SCIPgetRhsLinear().

◆ getSlackVarIndicator()

def getSlackVarIndicator (   self,
  Constraint,
  cons 
)
Get slack variable of an indicator constraint.

:param Constraint cons: indicator constraint

Definition at line 2724 of file scip.pyx.

References SCIPgetSlackVarIndicator().

◆ getSolObjVal()

def getSolObjVal (   self,
  Solution,
  sol,
  original = True 
)
Retrieve the objective value of the solution.

:param Solution sol: solution
:param original: objective value in original space (Default value = True)

Definition at line 4459 of file scip.pyx.

References Model._scip, SCIPgetSolOrigObj(), and SCIPgetSolTransObj().

◆ getSols()

def getSols (   self)
Retrieve list of all feasible primal solutions stored in the solution storage.

Definition at line 4441 of file scip.pyx.

References Model._scip, SCIPgetNSols(), and SCIPgetSols().

◆ getSolVal()

def getSolVal (   self,
  Solution,
  sol,
  Expr,
  expr 
)
Retrieve value of given variable or expression in the given solution or in
the LP/pseudo solution if sol == None

:param Solution sol: solution
:param Expr expr: polynomial expression to query the value of

Note: a variable is also an expression

Definition at line 4486 of file scip.pyx.

References Model._scip, and SCIPgetSolVal().

◆ getSolvingTime()

def getSolvingTime (   self)
Retrieve the current solving time in seconds

Definition at line 1085 of file scip.pyx.

References Model._scip, and SCIPgetSolvingTime().

◆ getStage()

def getStage (   self)
Retrieve current SCIP stage

Definition at line 4535 of file scip.pyx.

References Model._scip, and SCIPgetStage().

◆ getStatus()

def getStatus (   self)
Retrieve solution status.

Definition at line 4539 of file scip.pyx.

References Model._scip, and SCIPgetStatus().

◆ getTermsQuadratic()

def getTermsQuadratic (   self,
  Constraint,
  cons 
)
Retrieve bilinear, quadratic, and linear terms of a quadratic constraint.

:param Constraint cons: constraint

Definition at line 3023 of file scip.pyx.

References Model.checkQuadraticNonlinear(), SCIPexprGetQuadraticBilinTerm(), SCIPexprGetQuadraticData(), SCIPexprGetQuadraticQuadTerm(), SCIPgetExprNonlinear(), and SCIPgetVarExprVar().

◆ getTotalTime()

def getTotalTime (   self)
Retrieve the current total SCIP time in seconds, i.e. the total time since the SCIP instance has been created

Definition at line 1081 of file scip.pyx.

References Model._scip, and SCIPgetTotalTime().

◆ getTransformedCons()

def getTransformedCons (   self,
  Constraint,
  cons 
)
Retrieve transformed constraint.

:param Constraint cons: constraint

Definition at line 2950 of file scip.pyx.

References Model._scip, and SCIPgetTransformedCons().

◆ getTransformedVar()

def getTransformedVar (   self,
  Variable,
  var 
)
Retrieve the transformed variable.

:param Variable var: original variable to get the transformed of

Definition at line 1476 of file scip.pyx.

References Model._scip, and SCIPgetTransformedVar().

◆ getVal()

def getVal (   self,
  Expr,
  expr 
)
Retrieve the value of the given variable or expression in the best known solution.
Can only be called after solving is completed.

:param Expr expr: polynomial expression to query the value of

Note: a variable is also an expression

Definition at line 4503 of file scip.pyx.

References Model._bestSol, Model.getSolVal(), and Model.getStage().

◆ getValsLinear()

def getValsLinear (   self,
  Constraint,
  cons 
)
Retrieve the coefficients of a linear constraint

:param Constraint cons: linear constraint to get the coefficients of

Definition at line 3120 of file scip.pyx.

References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetNVarsLinear(), SCIPgetValsLinear(), SCIPgetVarsLinear(), and SCIPvarGetName().

◆ getVarLbDive()

def getVarLbDive (   self,
  Variable,
  var 
)
returns variable's current lb in current dive

Definition at line 4047 of file scip.pyx.

References Model._scip, and SCIPgetVarLbDive().

◆ getVarRedcost()

def getVarRedcost (   self,
  Variable,
  var 
)
Retrieve the reduced cost of a variable.

:param Variable var: variable to get the reduced cost of

Definition at line 3192 of file scip.pyx.

References Model._scip, Model.getObjectiveSense(), and SCIPgetVarRedcost().

◆ getVars()

def getVars (   self,
  transformed = False 
)
Retrieve all variables.

:param transformed: get transformed variables instead of original (Default value = False)

Definition at line 1677 of file scip.pyx.

References Model._modelvars, Model._scip, SCIPgetNOrigVars(), SCIPgetNVars(), SCIPgetOrigVars(), and SCIPgetVars().

◆ getVarUbDive()

def getVarUbDive (   self,
  Variable,
  var 
)
returns variable's current ub in current dive

Definition at line 4051 of file scip.pyx.

References Model._scip, and SCIPgetVarUbDive().

◆ hideOutput()

def hideOutput (   self,
  quiet = True 
)
Hide the output.

:param quiet: hide output? (Default value = True)

Definition at line 4667 of file scip.pyx.

References Model._scip, and SCIPsetMessagehdlrQuiet().

◆ includeBenders()

def includeBenders (   self,
  Benders,
  benders,
  name,
  desc,
  priority = 1,
  cutlp = True,
  cutpseudo = True,
  cutrelax = True,
  shareaux = False 
)
Include a Benders' decomposition.

Keyword arguments:
benders -- the Benders decomposition
name -- the name
desc -- the description
priority -- priority of the Benders' decomposition
cutlp -- should Benders' cuts be generated from LP solutions
cutpseudo -- should Benders' cuts be generated from pseudo solutions
cutrelax -- should Benders' cuts be generated from relaxation solutions
shareaux -- should the Benders' decomposition share the auxiliary variables of the highest priority Benders' decomposition

Definition at line 3840 of file scip.pyx.

References Model._scip, SCIPfindBenders(), SCIPincludeBenders(), and pyscipopt.scip.str_conversion.

◆ includeBenderscut()

def includeBenderscut (   self,
  Benders,
  benders,
  Benderscut,
  benderscut,
  name,
  desc,
  priority = 1,
  islpcut = True 
)
Include a Benders' decomposition cutting method

Keyword arguments:
benders -- the Benders' decomposition that this cutting method is attached to
benderscut --- the Benders' decomposition cutting method
name -- the name
desc -- the description
priority -- priority of the Benders' decomposition
islpcut -- is this cutting method suitable for generating cuts for convex relaxations?

Definition at line 3870 of file scip.pyx.

References Model._scip, SCIPfindBenderscut(), SCIPincludeBenderscut(), and pyscipopt.scip.str_conversion.

◆ includeBendersDefaultCuts()

def includeBendersDefaultCuts (   self,
  Benders,
  benders 
)
includes the default Benders' decomposition cuts to the custom Benders' decomposition plugin

Keyword arguments:
benders -- the Benders' decomposition that the default cuts will be applied to

Definition at line 3527 of file scip.pyx.

References Model._scip.

◆ includeBranchrule()

def includeBranchrule (   self,
  Branchrule,
  branchrule,
  name,
  desc,
  priority,
  maxdepth,
  maxbounddist 
)
Include a branching rule.

:param Branchrule branchrule: branching rule
:param name: name of branching rule
:param desc: description of branching rule
:param priority: priority of branching rule
:param maxdepth: maximal depth level up to which this branching rule should be used (or -1)
:param maxbounddist: maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for applying branching rule (0.0: only on current best node, 1.0: on all nodes)

Definition at line 3799 of file scip.pyx.

References Model._scip, SCIPincludeBranchrule(), and pyscipopt.scip.str_conversion.

◆ includeConshdlr()

def includeConshdlr (   self,
  Conshdlr,
  conshdlr,
  name,
  desc,
  sepapriority = 0,
  enfopriority = 0,
  chckpriority = 0,
  sepafreq = -1,
  propfreq = -1,
  eagerfreq = 100,
  maxprerounds = -1,
  delaysepa = False,
  delayprop = False,
  needscons = True,
  proptiming = PY_SCIP_PROPTIMING.BEFORELP,
  presoltiming = PY_SCIP_PRESOLTIMING.MEDIUM 
)
Include a constraint handler

:param Conshdlr conshdlr: constraint handler
:param name: name of constraint handler
:param desc: description of constraint handler
:param sepapriority: priority for separation (Default value = 0)
:param enfopriority: priority for constraint enforcing (Default value = 0)
:param chckpriority: priority for checking feasibility (Default value = 0)
:param sepafreq: frequency for separating cuts; 0 = only at root node (Default value = -1)
:param propfreq: frequency for propagating domains; 0 = only preprocessing propagation (Default value = -1)
:param eagerfreq: frequency for using all instead of only the useful constraints in separation, propagation and enforcement; -1 = no eager evaluations, 0 = first only (Default value = 100)
:param maxprerounds: maximal number of presolving rounds the constraint handler participates in (Default value = -1)
:param delaysepa: should separation method be delayed, if other separators found cuts? (Default value = False)
:param delayprop: should propagation method be delayed, if other propagators found reductions? (Default value = False)
:param needscons: should the constraint handler be skipped, if no constraints are available? (Default value = True)
:param proptiming: positions in the node solving loop where propagation method of constraint handlers should be executed (Default value = SCIP_PROPTIMING.BEFORELP)
:param presoltiming: timing mask of the constraint handler's presolving method (Default value = SCIP_PRESOLTIMING.MEDIUM)

Definition at line 3582 of file scip.pyx.

References Model._scip, SCIPincludeConshdlr(), and pyscipopt.scip.str_conversion.

◆ includeCutsel()

def includeCutsel (   self,
  Cutsel,
  cutsel,
  name,
  desc,
  priority 
)
include a cut selector

:param Cutsel cutsel: cut selector
:param name: name of cut selector
:param desc: description of cut selector
:param priority: priority of the cut selector

Definition at line 3781 of file scip.pyx.

References Model._scip, SCIPincludeCutsel(), and pyscipopt.scip.str_conversion.

◆ includeDefaultPlugins()

def includeDefaultPlugins (   self)
Includes all default plug-ins into SCIP

Definition at line 1048 of file scip.pyx.

References Model._scip.

◆ includeEventhdlr()

def includeEventhdlr (   self,
  Eventhdlr,
  eventhdlr,
  name,
  desc 
)
Include an event handler.

Keyword arguments:
eventhdlr -- event handler
name -- name of event handler
desc -- description of event handler

Definition at line 3536 of file scip.pyx.

References Model._scip, SCIPincludeEventhdlr(), and pyscipopt.scip.str_conversion.

◆ includeHeur()

def includeHeur (   self,
  Heur,
  heur,
  name,
  desc,
  dispchar,
  priority = 10000,
  freq = 1,
  freqofs = 0,
  maxdepth = -1,
  timingmask = SCIP_HEURTIMING_BEFORENODE,
  usessubscip = False 
)
Include a primal heuristic.

:param Heur heur: heuristic
:param name: name of heuristic
:param desc: description of heuristic
:param dispchar: display character of heuristic
:param priority: priority of the heuristic (Default value = 10000)
:param freq: frequency for calling heuristic (Default value = 1)
:param freqofs: frequency offset for calling heuristic (Default value = 0)
:param maxdepth: maximal depth level to call heuristic at (Default value = -1)
:param timingmask: positions in the node solving loop where heuristic should be executed (Default value = SCIP_HEURTIMING_BEFORENODE)
:param usessubscip: does the heuristic use a secondary SCIP instance? (Default value = False)

Definition at line 3733 of file scip.pyx.

References Model._scip, SCIPincludeHeur(), and pyscipopt.scip.str_conversion.

◆ includeNodesel()

def includeNodesel (   self,
  Nodesel,
  nodesel,
  name,
  desc,
  stdpriority,
  memsavepriority 
)
Include a node selector.

:param Nodesel nodesel: node selector
:param name: name of node selector
:param desc: description of node selector
:param stdpriority: priority of the node selector in standard mode
:param memsavepriority: priority of the node selector in memory saving mode

Definition at line 3820 of file scip.pyx.

References Model._scip, SCIPincludeNodesel(), and pyscipopt.scip.str_conversion.

◆ includePresol()

def includePresol (   self,
  Presol,
  presol,
  name,
  desc,
  priority,
  maxrounds,
  timing = SCIP_PRESOLTIMING_FAST 
)
Include a presolver

:param Presol presol: presolver
:param name: name of presolver
:param desc: description of presolver
:param priority: priority of the presolver (>= 0: before, < 0: after constraint handlers)
:param maxrounds: maximal number of presolving rounds the presolver participates in (-1: no limit)
:param timing: timing mask of presolver (Default value = SCIP_PRESOLTIMING_FAST)

Definition at line 3648 of file scip.pyx.

References Model._scip, SCIPincludePresol(), and pyscipopt.scip.str_conversion.

◆ includePricer()

def includePricer (   self,
  Pricer,
  pricer,
  name,
  desc,
  priority = 1,
  delay = True 
)
Include a pricer.

:param Pricer pricer: pricer
:param name: name of pricer
:param desc: description of pricer
:param priority: priority of pricer (Default value = 1)
:param delay: should the pricer be delayed until no other pricers or already existing problem variables with negative reduced costs are found? (Default value = True)

Definition at line 3560 of file scip.pyx.

References Model._scip, SCIPactivatePricer(), SCIPfindPricer(), SCIPincludePricer(), and pyscipopt.scip.str_conversion.

◆ includeProp()

def includeProp (   self,
  Prop,
  prop,
  name,
  desc,
  presolpriority,
  presolmaxrounds,
  proptiming,
  presoltiming = SCIP_PRESOLTIMING_FAST,
  priority = 1,
  freq = 1,
  delay = True 
)
Include a propagator.

:param Prop prop: propagator
:param name: name of propagator
:param desc: description of propagator
:param presolpriority: presolving priority of the propgator (>= 0: before, < 0: after constraint handlers)
:param presolmaxrounds: maximal number of presolving rounds the propagator participates in (-1: no limit)
:param proptiming: positions in the node solving loop where propagation method of constraint handlers should be executed
:param presoltiming: timing mask of the constraint handler's presolving method (Default value = SCIP_PRESOLTIMING_FAST)
:param priority: priority of the propagator (Default value = 1)
:param freq: frequency for calling propagator (Default value = 1)
:param delay: should propagator be delayed if other propagators have found reductions? (Default value = True)

Definition at line 3705 of file scip.pyx.

References Model._scip, SCIPincludeProp(), and pyscipopt.scip.str_conversion.

◆ includeReader()

def includeReader (   self,
  Reader,
  reader,
  name,
  desc,
  ext 
)
Include a reader

:param Reader reader: reader
:param name: name of reader
:param desc: description of reader
:param ext: file extension of reader

Definition at line 3687 of file scip.pyx.

References Model._scip, SCIPincludeReader(), and pyscipopt.scip.str_conversion.

◆ includeRelax()

def includeRelax (   self,
  Relax,
  relax,
  name,
  desc,
  priority = 10000,
  freq = 1 
)
Include a relaxation handler.

:param Relax relax: relaxation handler
:param name: name of relaxation handler
:param desc: description of relaxation handler
:param priority: priority of the relaxation handler (negative: after LP, non-negative: before LP, Default value = 10000)
:param freq: frequency for calling relaxation handler

Definition at line 3762 of file scip.pyx.

References Model._scip, SCIPincludeRelax(), and pyscipopt.scip.str_conversion.

◆ includeSepa()

def includeSepa (   self,
  Sepa,
  sepa,
  name,
  desc,
  priority = 0,
  freq = 10,
  maxbounddist = 1.0,
  usessubscip = False,
  delay = False 
)
Include a separator

:param Sepa sepa: separator
:param name: name of separator
:param desc: description of separator
:param priority: priority of separator (>= 0: before, < 0: after constraint handlers)
:param freq: frequency for calling separator
:param maxbounddist: maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for applying separation
:param usessubscip: does the separator use a secondary SCIP instance? (Default value = False)
:param delay: should separator be delayed, if other separators found cuts? (Default value = False)

Definition at line 3666 of file scip.pyx.

References Model._scip, SCIPincludeSepa(), and pyscipopt.scip.str_conversion.

◆ infinity()

def infinity (   self)
Retrieve SCIP's infinity value

Definition at line 1141 of file scip.pyx.

References Model._scip, and SCIPinfinity().

◆ initBendersDefault()

def initBendersDefault (   self,
  subproblems 
)
initialises the default Benders' decomposition with a dictionary of subproblems

Keyword arguments:
subproblems -- a single Model instance or dictionary of Model instances

Definition at line 3245 of file scip.pyx.

References Model._scip, SCIPcreateBendersDefault(), SCIPfindBenders(), and Model.setBoolParam().

◆ inProbing()

def inProbing (   self)
returns whether we are in probing mode; probing mode is activated via startProbing() and stopped via endProbing()

Definition at line 4148 of file scip.pyx.

References Model._scip, and SCIPinProbing().

◆ inRepropagation()

def inRepropagation (   self)
returns if the current node is already solved and only propagated again.

Definition at line 4085 of file scip.pyx.

References Model._scip, and SCIPinRepropagation().

◆ interruptSolve()

def interruptSolve (   self)
Interrupt the solving process as soon as possible.

Definition at line 4194 of file scip.pyx.

References Model._scip, and SCIPinterruptSolve().

◆ isCutEfficacious()

def isCutEfficacious (   self,
  Row,
  cut,
  not,
  None,
  Solution,
  sol = None 
)
returns whether the cut's efficacy with respect to the given primal solution or the current LP solution is greater than the minimal cut efficacy

Definition at line 1960 of file scip.pyx.

References Model._scip, and SCIPisCutEfficacious().

◆ isEQ()

def isEQ (   self,
  val1,
  val2 
)
checks, if values are in range of epsilon

Definition at line 1181 of file scip.pyx.

References Model._scip, and SCIPisEQ().

◆ isFeasEQ()

def isFeasEQ (   self,
  val1,
  val2 
)
checks, if relative difference of values is in range of feasibility tolerance

Definition at line 1185 of file scip.pyx.

References Model._scip, and SCIPisFeasEQ().

◆ isFeasIntegral()

def isFeasIntegral (   self,
  value 
)
returns whether value is integral within the LP feasibility bounds

Definition at line 1177 of file scip.pyx.

References Model._scip, and SCIPisFeasIntegral().

◆ isFeasNegative()

def isFeasNegative (   self,
  value 
)
returns whether value < -feastol

Definition at line 1173 of file scip.pyx.

References Model._scip, and SCIPisFeasNegative().

◆ isFeasZero()

def isFeasZero (   self,
  value 
)
returns whether abs(value) < feastol

Definition at line 1165 of file scip.pyx.

References Model._scip, and SCIPisFeasZero().

◆ isGE()

def isGE (   self,
  val1,
  val2 
)
returns whether val1 >= val2 - eps

Definition at line 1197 of file scip.pyx.

References Model._scip, and SCIPisGE().

◆ isGT()

def isGT (   self,
  val1,
  val2 
)
returns whether val1 > val2 + eps

Definition at line 1201 of file scip.pyx.

References Model._scip, and SCIPisGT().

◆ isInfinity()

def isInfinity (   self,
  value 
)
returns whether value is SCIP's infinity

Definition at line 1169 of file scip.pyx.

References Model._scip, and SCIPisInfinity().

◆ isLE()

def isLE (   self,
  val1,
  val2 
)
returns whether val1 <= val2 + eps

Definition at line 1189 of file scip.pyx.

References Model._scip, and SCIPisLE().

◆ isLPSolBasic()

def isLPSolBasic (   self)
returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis

Definition at line 1860 of file scip.pyx.

References Model._scip, and SCIPisLPSolBasic().

◆ isLT()

def isLT (   self,
  val1,
  val2 
)
returns whether val1 < val2 - eps

Definition at line 1193 of file scip.pyx.

References Model._scip, and SCIPisLT().

◆ isNLPConstructed()

def isNLPConstructed (   self)
returns whether SCIP's internal NLP has been constructed

Definition at line 2960 of file scip.pyx.

References Model._scip, and SCIPisNLPConstructed().

◆ isObjChangedProbing()

def isObjChangedProbing (   self)
returns whether the objective function has changed during probing mode

Definition at line 4144 of file scip.pyx.

References Model._scip, and SCIPisObjChangedProbing().

◆ isZero()

def isZero (   self,
  value 
)
returns whether abs(value) < eps

Definition at line 1161 of file scip.pyx.

References Model._scip, and SCIPisZero().

◆ lpiGetIterations()

def lpiGetIterations (   self)
Get the iteration count of the last solved LP

Definition at line 1225 of file scip.pyx.

References Model._scip, SCIPgetLPI(), and SCIPlpiGetIterations().

◆ newProbingNode()

def newProbingNode (   self)
creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the
probing path with a call to backtrackProbing()

Definition at line 4100 of file scip.pyx.

References Model._scip, and SCIPnewProbingNode().

◆ optimize()

def optimize (   self)
Optimize the problem.

Definition at line 3225 of file scip.pyx.

References Model._bestSol, Model._scip, SCIPgetBestSol(), and SCIPsolve().

◆ presolve()

def presolve (   self)
Presolve the problem.

Definition at line 3240 of file scip.pyx.

References Model._scip, and SCIPpresolve().

◆ printBestSol()

def printBestSol (   self,
  write_zeros = False 
)
Prints the best feasible primal solution.

Definition at line 4246 of file scip.pyx.

References Model._scip, and SCIPprintBestSol().

◆ printCons()

◆ printNlRow()

def printNlRow (   self,
  NLRow,
  nlrow 
)
prints nonlinear row

Definition at line 3009 of file scip.pyx.

References Model._scip, and SCIPprintNlRow().

◆ printRow()

def printRow (   self,
  Row,
  row,
  not,
  None 
)
Prints row.

Definition at line 1930 of file scip.pyx.

References Model._scip, and SCIPprintRow().

◆ printSol()

def printSol (   self,
  Solution,
  solution = None,
  write_zeros = False 
)
Print the given primal solution.

Keyword arguments:
solution -- solution to print
write_zeros -- include variables that are set to zero

Definition at line 4250 of file scip.pyx.

References Model._scip, and SCIPprintSol().

◆ printStatistics()

def printStatistics (   self)
Print statistics.

Definition at line 4645 of file scip.pyx.

References Model._scip, and SCIPprintStatistics().

◆ printVersion()

def printVersion (   self)
Print version, copyright information and compile mode

Definition at line 1073 of file scip.pyx.

References Model._scip, and SCIPprintVersion().

◆ propagateProbing()

def propagateProbing (   self,
  maxproprounds 
)
applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
:param maxproprounds: maximal number of propagation rounds (Default value = -1, that is, no limit)
returns:
cutoff -- whether the probing node can be cutoff
ndomredsfound -- number of domain reductions found

Definition at line 4178 of file scip.pyx.

References Model._scip, and SCIPpropagateProbing().

◆ readParams()

def readParams (   self,
  file 
)
Read an external parameter file.

:param file: file to be read

Definition at line 4836 of file scip.pyx.

References Model._scip, SCIPreadParams(), and pyscipopt.scip.str_conversion.

◆ readProblem()

def readProblem (   self,
  filename,
  extension = None 
)
Read a problem instance from an external file.

:param filename: problem file name
:param extension: specify file extension/type (Default value = None)

Definition at line 4880 of file scip.pyx.

References Model._scip, SCIPreadProb(), and pyscipopt.scip.str_conversion.

◆ readSol()

def readSol (   self,
  filename 
)
Reads a given solution file, problem has to be transformed in advance.

Keyword arguments:
filename -- name of the input file

Definition at line 4318 of file scip.pyx.

References Model._scip, SCIPreadSol(), and pyscipopt.scip.str_conversion.

◆ readSolFile()

def readSolFile (   self,
  filename 
)
Reads a given solution file.

Solution is created but not added to storage/the model.
Use 'addSol' OR 'trySol' to add it.

Keyword arguments:
filename -- name of the input file

Definition at line 4327 of file scip.pyx.

References Model._scip, Model.createSol(), SCIPreadSolFile(), and pyscipopt.scip.str_conversion.

◆ redirectOutput()

def redirectOutput (   self)
Send output to python instead of terminal.

Definition at line 4677 of file scip.pyx.

References Model._scip, and SCIPsetMessagehdlr().

◆ releaseRow()

def releaseRow (   self,
  Row,
  row,
  not,
  None 
)
decreases usage counter of LP row, and frees memory if necessary

Definition at line 1911 of file scip.pyx.

References Model._scip, and SCIPreleaseRow().

◆ repropagateNode()

def repropagateNode (   self,
  Node,
  node 
)
marks the given node to be propagated again the next time a node of its subtree is processed

Definition at line 1777 of file scip.pyx.

References Model._scip, and SCIPrepropagateNode().

◆ resetParam()

def resetParam (   self,
  name 
)
Reset parameter setting to its default value

:param name: parameter to reset

Definition at line 4858 of file scip.pyx.

References Model._scip, SCIPresetParam(), and pyscipopt.scip.str_conversion.

◆ resetParams()

def resetParams (   self)
Reset parameter settings to their default values

Definition at line 4867 of file scip.pyx.

References Model._scip, and SCIPresetParams().

◆ restartSolve()

def restartSolve (   self)
Restarts the solving process as soon as possible.

Definition at line 4198 of file scip.pyx.

References Model._scip, and SCIPrestartSolve().

◆ separateSol()

def separateSol (   self,
  Solution,
  sol = None,
  pretendroot = False,
  allowlocal = True,
  onlydelayed = False 
)
separates the given primal solution or the current LP solution by calling the separators and constraint handlers'
separation methods;
the generated cuts are stored in the separation storage and can be accessed with the methods SCIPgetCuts() and
SCIPgetNCuts();
after evaluating the cuts, you have to call SCIPclearCuts() in order to remove the cuts from the
separation storage;
it is possible to call SCIPseparateSol() multiple times with different solutions and evaluate the found cuts
afterwards
:param Solution sol: solution to separate, None to use current lp solution (Default value = None)
:param pretendroot: should the cut separators be called as if we are at the root node? (Default value = "False")
:param allowlocal: should the separator be asked to separate local cuts (Default value = True)
:param onlydelayed: should only separators be called that were delayed in the previous round? (Default value = False)
returns
delayed -- whether a separator was delayed
cutoff -- whether the node can be cut off

Definition at line 1987 of file scip.pyx.

References Model._scip, and SCIPseparateSol().

◆ setBendersSubproblemIsConvex()

def setBendersSubproblemIsConvex (   self,
  Benders,
  benders,
  probnumber,
  isconvex = True 
)
sets a flag indicating whether the subproblem is convex

Keyword arguments:
benders -- the Benders' decomposition which contains the subproblem
probnumber -- the problem number of the subproblem that the convexity will be set for
isconvex -- flag to indicate whether the subproblem is convex

Definition at line 3363 of file scip.pyx.

References SCIPbendersSetSubproblemIsConvex().

◆ setBoolParam()

def setBoolParam (   self,
  name,
  value 
)
Set a boolean-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4695 of file scip.pyx.

References Model._scip, SCIPsetBoolParam(), and pyscipopt.scip.str_conversion.

◆ setCharParam()

def setCharParam (   self,
  name,
  value 
)
Set a char-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4735 of file scip.pyx.

References Model._scip, SCIPsetCharParam(), and pyscipopt.scip.str_conversion.

◆ setCheck()

def setCheck (   self,
  Constraint,
  cons,
  newCheck 
)
Set "check" flag of a constraint.

Keyword arguments:
cons -- constraint
newCheck -- new check value

Definition at line 2807 of file scip.pyx.

References Model._scip, and SCIPsetConsChecked().

◆ setEmphasis()

def setEmphasis (   self,
  paraemphasis,
  quiet = True 
)
Set emphasis settings

:param paraemphasis: emphasis to set
:param quiet: hide output? (Default value = True)

Definition at line 4871 of file scip.pyx.

References Model._scip, and SCIPsetEmphasis().

◆ setEnforced()

def setEnforced (   self,
  Constraint,
  cons,
  newEnf 
)
Set "enforced" flag of a constraint.

Keyword arguments:
cons -- constraint
newEnf -- new enforced value

Definition at line 2798 of file scip.pyx.

References Model._scip, and SCIPsetConsEnforced().

◆ setHeuristics()

def setHeuristics (   self,
  setting 
)
Set heuristics parameter settings.

:param setting: the parameter setting (SCIP_PARAMSETTING)

Definition at line 1377 of file scip.pyx.

References Model._scip, and SCIPsetHeuristics().

◆ setInitial()

def setInitial (   self,
  Constraint,
  cons,
  newInit 
)
Set "initial" flag of a constraint.

Keyword arguments:
cons -- constraint
newInit -- new initial value

Definition at line 2780 of file scip.pyx.

References Model._scip, and SCIPsetConsInitial().

◆ setIntParam()

def setIntParam (   self,
  name,
  value 
)
Set an int-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4705 of file scip.pyx.

References Model._scip, SCIPsetIntParam(), and pyscipopt.scip.str_conversion.

◆ setLogfile()

def setLogfile (   self,
  path 
)
sets the log file name for the currently installed message handler
:param path: name of log file, or None (no log)

Definition at line 4686 of file scip.pyx.

References Model._scip, SCIPsetMessagehdlrLogfile(), and pyscipopt.scip.str_conversion.

◆ setLongintParam()

def setLongintParam (   self,
  name,
  value 
)
Set a long-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4715 of file scip.pyx.

References Model._scip, SCIPsetLongintParam(), and pyscipopt.scip.str_conversion.

◆ setMaximize()

def setMaximize (   self)
Set the objective sense to maximization.

Definition at line 1239 of file scip.pyx.

References Model._scip, and SCIPsetObjsense().

◆ setMinimize()

def setMinimize (   self)
Set the objective sense to minimization.

Definition at line 1235 of file scip.pyx.

References Model._scip, and SCIPsetObjsense().

◆ setObjective()

def setObjective (   self,
  coeffs,
  sense = 'minimize',
  clear = 'true' 
)
Establish the objective function as a linear expression.

:param coeffs: the coefficients
:param sense: the objective sense (Default value = 'minimize')
:param clear: set all other variables objective coefficient to zero (Default value = 'true')

Definition at line 1256 of file scip.pyx.

References Model._scip, Model.addObjoffset(), Model.getObjoffset(), SCIPchgVarObj(), SCIPgetNOrigVars(), SCIPgetOrigVars(), Model.setMaximize(), and Model.setMinimize().

◆ setObjIntegral()

def setObjIntegral (   self)
informs SCIP that the objective value is always integral in every feasible solution
Note: This function should be used to inform SCIP that the objective function is integral, helping to improve the
performance. This is useful when using column generation. If no column generation (pricing) is used, SCIP
automatically detects whether the objective function is integral or can be scaled to be integral. However, in
any case, the user has to make sure that no variable is added during the solving process that destroys this
property.

Definition at line 1335 of file scip.pyx.

References Model._scip, and SCIPsetObjIntegral().

◆ setObjlimit()

def setObjlimit (   self,
  objlimit 
)
Set a limit on the objective function.
Only solutions with objective value better than this limit are accepted.

:param objlimit: limit on the objective function

Definition at line 1243 of file scip.pyx.

References Model._scip, and SCIPsetObjlimit().

◆ setParam()

def setParam (   self,
  name,
  value 
)
Set a parameter with value in int, bool, real, long, char or str.

:param name: name of parameter
:param value: value of parameter

Definition at line 4756 of file scip.pyx.

References Model._scip, SCIPgetParam(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetRealParam(), SCIPsetStringParam(), and pyscipopt.scip.str_conversion.

◆ setParams()

def setParams (   self,
  params 
)
Sets multiple parameters at once.

:param params: dict mapping parameter names to their values.

Definition at line 4828 of file scip.pyx.

References Model.setParam().

◆ setParamsCountsols()

def setParamsCountsols (   self)
Sets SCIP parameters such that a valid counting process is possible.

Definition at line 4914 of file scip.pyx.

References Model._scip, and SCIPsetParamsCountsols().

◆ setPresolve()

def setPresolve (   self,
  setting 
)
Set presolving parameter settings.

:param setting: the parameter settings (SCIP_PARAMSETTING)

Definition at line 1356 of file scip.pyx.

References Model._scip, and SCIPsetPresolving().

◆ setProbName()

def setProbName (   self,
  name 
)
Set problem name

Definition at line 1364 of file scip.pyx.

References Model._scip, SCIPsetProbName(), and pyscipopt.scip.str_conversion.

◆ setRealParam()

def setRealParam (   self,
  name,
  value 
)
Set a real-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4725 of file scip.pyx.

References Model._scip, SCIPsetRealParam(), and pyscipopt.scip.str_conversion.

◆ setRelaxSolVal()

def setRelaxSolVal (   self,
  Variable,
  var,
  val 
)
sets the value of the given variable in the global relaxation solution

Definition at line 3086 of file scip.pyx.

References Model._scip, and SCIPsetRelaxSolVal().

◆ setRemovable()

def setRemovable (   self,
  Constraint,
  cons,
  newRem 
)
Set "removable" flag of a constraint.

Keyword arguments:
cons -- constraint
newRem -- new removable value

Definition at line 2789 of file scip.pyx.

References Model._scip, and SCIPsetConsRemovable().

◆ setSeparating()

def setSeparating (   self,
  setting 
)
Set separating parameter settings.

:param setting: the parameter settings (SCIP_PARAMSETTING)

Definition at line 1369 of file scip.pyx.

References Model._scip, and SCIPsetSeparating().

◆ setSolVal()

def setSolVal (   self,
  Solution,
  solution,
  Variable,
  var,
  val 
)
Set a variable in a solution.

:param Solution solution: solution to be modified
:param Variable var: variable in the solution
:param val: value of the specified variable

Definition at line 4350 of file scip.pyx.

References Model._scip, and SCIPsetSolVal().

◆ setStringParam()

def setStringParam (   self,
  name,
  value 
)
Set a string-valued parameter.

:param name: name of parameter
:param value: value of parameter

Definition at line 4745 of file scip.pyx.

References Model._scip, SCIPsetStringParam(), and pyscipopt.scip.str_conversion.

◆ setupBendersSubproblem()

def setupBendersSubproblem (   self,
  probnumber,
  Benders,
  benders = None,
  Solution,
  solution = None,
  checktype = PY_SCIP_BENDERSENFOTYPE.LP 
)
sets up the Benders' subproblem given the master problem solution

Keyword arguments:
probnumber -- the index of the problem that is to be set up
benders -- the Benders' decomposition to which the subproblem belongs to
solution -- the master problem solution that is used for the set up, if None, then the LP solution is used
checktype -- the type of solution check that prompted the solving of the Benders' subproblems, either
    PY_SCIP_BENDERSENFOTYPE: LP, RELAX, PSEUDO or CHECK. Default is LP

Definition at line 3373 of file scip.pyx.

References Model._scip, SCIPfindBenders(), and SCIPsetupBendersSubproblem().

◆ solveBendersSubproblem()

def solveBendersSubproblem (   self,
  probnumber,
  solvecip,
  Benders,
  benders = None,
  Solution,
  solution = None 
)
solves the Benders' decomposition subproblem. The convex relaxation will be solved unless
the parameter solvecip is set to True.

Keyword arguments:
probnumber -- the index of the problem that is to be set up
solvecip -- should the CIP of the subproblem be solved, if False, then only the convex relaxation is solved
benders -- the Benders' decomposition to which the subproblem belongs to
solution -- the master problem solution that is used for the set up, if None, then the LP solution is used

Definition at line 3400 of file scip.pyx.

References Model._scip, SCIPfindBenders(), and SCIPsolveBendersSubproblem().

◆ solveConcurrent()

def solveConcurrent (   self)
Transforms, presolves, and solves problem using additional solvers which emphasize on
finding solutions.

Definition at line 3230 of file scip.pyx.

References Model._bestSol, Model._scip, Model.optimize(), SCIPgetBestSol(), and SCIPsolveConcurrent().

◆ solveDiveLP()

def solveDiveLP (   self,
  itlim = -1 
)
solves the LP of the current dive no separation or pricing is applied
no separation or pricing is applied
:param itlim: maximal number of LP iterations to perform (Default value = -1, that is, no limit)
returns two booleans:
lperror -- if an unresolved lp error occured
cutoff -- whether the LP was infeasible or the objective limit was reached

Definition at line 4071 of file scip.pyx.

References Model._scip, and SCIPsolveDiveLP().

◆ solveProbingLP()

def solveProbingLP (   self,
  itlim = -1 
)
solves the LP at the current probing node (cannot be applied at preprocessing stage)
no separation or pricing is applied
:param itlim: maximal number of LP iterations to perform (Default value = -1, that is, no limit)
returns two booleans:
lperror -- if an unresolved lp error occured
cutoff -- whether the LP was infeasible or the objective limit was reached

Definition at line 4152 of file scip.pyx.

References Model._scip, and SCIPsolveProbingLP().

◆ startDive()

def startDive (   self)
Initiates LP diving
It allows the user to change the LP in several ways, solve, change again, etc, without affecting the actual LP that has. When endDive() is called,
SCIP will undo all changes done and recover the LP it had before startDive

Definition at line 4024 of file scip.pyx.

References Model._scip, and SCIPstartDive().

◆ startProbing()

def startProbing (   self)
Initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
   SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), SCIPsolveProbingLP(), etc available

Definition at line 4090 of file scip.pyx.

References Model._scip, and SCIPstartProbing().

◆ tightenVarLb()

def tightenVarLb (   self,
  Variable,
  var,
  lb,
  force = False 
)
Tighten the lower bound in preprocessing or current node, if the bound is tighter.

:param var: SCIP variable
:param lb: possible new lower bound
:param force: force tightening even if below bound strengthening tolerance
:return: tuple of bools, (infeasible, tightened)
    infeasible: whether new domain is empty
    tightened: whether the bound was tightened

Definition at line 1523 of file scip.pyx.

References Model._scip, and SCIPtightenVarLb().

◆ tightenVarLbGlobal()

def tightenVarLbGlobal (   self,
  Variable,
  var,
  lb,
  force = False 
)
Tighten the global upper bound, if the bound is tighter.

:param var: SCIP variable
:param lb: possible new upper bound
:param force: force tightening even if below bound strengthening tolerance
:return: tuple of bools, (infeasible, tightened)
    infeasible: whether new domain is empty
    tightened: whether the bound was tightened

Definition at line 1573 of file scip.pyx.

References Model._scip, and SCIPtightenVarLbGlobal().

◆ tightenVarUb()

def tightenVarUb (   self,
  Variable,
  var,
  ub,
  force = False 
)
Tighten the upper bound in preprocessing or current node, if the bound is tighter.

:param var: SCIP variable
:param ub: possible new upper bound
:param force: force tightening even if below bound strengthening tolerance
:return: tuple of bools, (infeasible, tightened)
    infeasible: whether new domain is empty
    tightened: whether the bound was tightened

Definition at line 1540 of file scip.pyx.

References Model._scip, and SCIPtightenVarUb().

◆ tightenVarUbGlobal()

def tightenVarUbGlobal (   self,
  Variable,
  var,
  ub,
  force = False 
)
Tighten the global upper bound, if the bound is tighter.

:param var: SCIP variable
:param ub: possible new upper bound
:param force: force tightening even if below bound strengthening tolerance
:return: tuple of bools, (infeasible, tightened)
    infeasible: whether new domain is empty
    tightened: whether the bound was tightened

Definition at line 1557 of file scip.pyx.

References Model._scip, and SCIPtightenVarUbGlobal().

◆ to_ptr()

def to_ptr (   self,
  give_ownership 
)
Return the underlying Scip pointer to the current Model.

:param give_ownership: Whether the current Model gives away ownership of the
underlying Scip pointer (see `_freescip`).
:return capsule: The underlying pointer to the current Model, wrapped in a
PyCapsule under the name "scip".

Definition at line 1035 of file scip.pyx.

References Model._freescip, and Model._scip.

◆ trySol()

def trySol (   self,
  Solution,
  solution,
  printreason = True,
  completely = False,
  checkbounds = True,
  checkintegrality = True,
  checklprows = True,
  free = True 
)
Check given primal solution for feasibility and try to add it to the storage.

:param Solution solution: solution to store
:param printreason: should all reasons of violations be printed? (Default value = True)
:param completely: should all violation be checked? (Default value = False)
:param checkbounds: should the bounds of the variables be checked? (Default value = True)
:param checkintegrality: has integrality to be checked? (Default value = True)
:param checklprows: have current LP rows (both local and global) to be checked? (Default value = True)
:param free: should solution be freed? (Default value = True)

Definition at line 4362 of file scip.pyx.

References Model._scip, SCIPtrySol(), and SCIPtrySolFree().

◆ updateBendersLowerbounds()

def updateBendersLowerbounds (   self,
  lowerbounds,
  Benders,
  benders = None 
)
"updates the subproblem lower bounds for benders using
the lowerbounds dict. If benders is None, then the default
Benders' decomposition is updated

Definition at line 3326 of file scip.pyx.

References Model._scip, SCIPbendersUpdateSubproblemLowerbound(), and SCIPfindBenders().

◆ updateNodeLowerbound()

def updateNodeLowerbound (   self,
  Node,
  node,
  lb 
)
if given value is larger than the node's lower bound (in transformed problem),
sets the node's lower bound to the new value

:param node: Node, the node to update
:param newbound: float, new bound (if greater) for the node

Definition at line 1726 of file scip.pyx.

References Model._scip, and SCIPupdateNodeLowerbound().

◆ version()

def version (   self)
Retrieve SCIP version

Definition at line 1069 of file scip.pyx.

References SCIPversion().

◆ writeBestSol()

def writeBestSol (   self,
  filename = "origprob.sol",
  write_zeros = False 
)
Write the best feasible primal solution to a file.

Keyword arguments:
filename -- name of the output file
write_zeros -- include variables that are set to zero

Definition at line 4262 of file scip.pyx.

References Model._scip, and SCIPprintBestSol().

◆ writeBestTransSol()

def writeBestTransSol (   self,
  filename = "transprob.sol",
  write_zeros = False 
)
Write the best feasible primal solution for the transformed problem to a file.

Keyword arguments:
filename -- name of the output file
write_zeros -- include variables that are set to zero

Definition at line 4275 of file scip.pyx.

References Model._scip, and SCIPprintBestTransSol().

◆ writeLP()

def writeLP (   self,
  filename = "LP.lp" 
)
writes current LP to a file
:param filename: file name (Default value = "LP.lp")

Definition at line 4204 of file scip.pyx.

References Model._scip, SCIPwriteLP(), and pyscipopt.scip.str_conversion.

◆ writeName()

def writeName (   self,
  Variable,
  var 
)
Write the name of the variable to the std out.

:param Variable var: variable

Definition at line 4527 of file scip.pyx.

References Model._scip, and SCIPwriteVarName().

◆ writeParams()

def writeParams (   self,
  filename = 'param.set',
  comments = True,
  onlychanged = True 
)
Write parameter settings to an external file.

:param filename: file to be written (Default value = 'param.set')
:param comments: write parameter descriptions as comments? (Default value = True)
:param onlychanged: write only modified parameters (Default value = True)

Definition at line 4845 of file scip.pyx.

References Model._scip, SCIPwriteParams(), and pyscipopt.scip.str_conversion.

◆ writeProblem()

def writeProblem (   self,
  filename = 'model.cip',
  trans = False,
  genericnames = False 
)
Write current model/problem to a file.

:param filename: the name of the file to be used (Default value = 'model.cip'). Should have an extension corresponding to one of the readable file formats, described in https://www.scipopt.org/doc/html/group__FILEREADERS.php.
:param trans: indicates whether the transformed problem is written to file (Default value = False)
:param genericnames: indicates whether the problem should be written with generic variable and constraint names (Default value = False)

Definition at line 1395 of file scip.pyx.

References Model._scip, SCIPwriteOrigProblem(), SCIPwriteTransProblem(), and pyscipopt.scip.str_conversion.

◆ writeSol()

def writeSol (   self,
  Solution,
  solution,
  filename = "origprob.sol",
  write_zeros = False 
)
Write the given primal solution to a file.

Keyword arguments:
solution -- solution to write
filename -- name of the output file
write_zeros -- include variables that are set to zero

Definition at line 4288 of file scip.pyx.

References Model._scip, and SCIPprintSol().

◆ writeStatistics()

def writeStatistics (   self,
  filename = "origprob.stats" 
)
Write statistics to a file.

Keyword arguments:
filename -- name of the output file

Definition at line 4649 of file scip.pyx.

References Model._scip, and SCIPprintStatistics().

◆ writeTransSol()

def writeTransSol (   self,
  Solution,
  solution,
  filename = "transprob.sol",
  write_zeros = False 
)
Write the given transformed primal solution to a file.

Keyword arguments:
solution -- transformed solution to write
filename -- name of the output file
write_zeros -- include variables that are set to zero

Definition at line 4302 of file scip.pyx.

References Model._scip, and SCIPprintTransSol().

Member Data Documentation

◆ model

model = Model(createscip=False)
static

Definition at line 1000 of file scip.pyx.


The documentation for this class was generated from the following file: