PySCIPOpt
Python Interface to the SCIP Optimization Suite
Model Class Reference

Public Member Functions

def create (self)
 
def includeDefaultPlugins (self)
 
def createProbBasic (self, problemName='model')
 
def freeProb (self)
 
def freeTransform (self)
 
def version (self)
 
def printVersion (self)
 
def getProbName (self)
 
def getTotalTime (self)
 
def getSolvingTime (self)
 
def getReadingTime (self)
 
def getPresolvingTime (self)
 
def getNNodes (self)
 
def getCurrentNode (self)
 
def getGap (self)
 
def getDepth (self)
 
def infinity (self)
 
def epsilon (self)
 
def feastol (self)
 
def feasFrac (self, value)
 
def frac (self, value)
 
def isZero (self, value)
 
def isFeasZero (self, value)
 
def isInfinity (self, value)
 
def isFeasNegative (self, value)
 
def isLE (self, val1, val2)
 
def isLT (self, val1, val2)
 
def isGE (self, val1, val2)
 
def isGT (self, val1, val2)
 
def getCondition (self, exact=False)
 
def setMinimize (self)
 
def setMaximize (self)
 
def setObjlimit (self, objlimit)
 
def getObjlimit (self)
 
def setObjective (self, coeffs, sense='minimize', clear='true')
 
def getObjective (self)
 
def addObjoffset (self, offset, solutions=False)
 
def getObjoffset (self, original=True)
 
def setPresolve (self, setting)
 
def setProbName (self, name)
 
def setSeparating (self, setting)
 
def setHeuristics (self, setting)
 
def disablePropagation (self, onlyroot=False)
 
def writeProblem (self, filename='model.cip', trans=False)
 
def addVar (self, name='', vtype='C', lb=0.0, ub=None, obj=0.0, pricedVar=False)
 
def releaseVar (self, Variable, var)
 
def getTransformedVar (self, Variable, var)
 
def addVarLocks (self, Variable, var, nlocksdown, nlocksup)
 
def fixVar (self, Variable, var, val)
 
def delVar (self, Variable, var)
 
def tightenVarLb (self, Variable, var, lb, force=False)
 
def tightenVarUb (self, Variable, var, ub, force=False)
 
def tightenVarUbGlobal (self, Variable, var, ub, force=False)
 
def tightenVarLbGlobal (self, Variable, var, lb, force=False)
 
def chgVarLb (self, Variable, var, lb)
 
def chgVarUb (self, Variable, var, ub)
 
def chgVarLbGlobal (self, Variable, var, lb)
 
def chgVarUbGlobal (self, Variable, var, ub)
 
def chgVarLbNode (self, Node, node, Variable, var, lb)
 
def chgVarUbNode (self, Node, node, Variable, var, ub)
 
def chgVarType (self, Variable, var, vtype)
 
def getVars (self, transformed=False)
 
def getNVars (self)
 
def getNConss (self)
 
def updateNodeLowerbound (self, Node, node, lb)
 
def getLPSolstat (self)
 
def constructLP (self)
 
def getLPObjVal (self)
 
def getLPColsData (self)
 
def getLPRowsData (self)
 
def getNLPRows (self)
 
def getNLPCols (self)
 
def getLPBasisInd (self)
 
def getLPBInvRow (self, row)
 
def getLPBInvARow (self, row)
 
def isLPSolBasic (self)
 
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 getRowActivity (self, Row, row)
 
def getRowLPActivity (self, Row, row)
 
def releaseRow (self, Row, row, not, None)
 
def cacheRowExtensions (self, Row, row, not, None)
 
def flushRowExtensions (self, Row, row, not, None)
 
def addVarToRow (self, Row, row, not, None, Variable, var, not, None, value)
 
def printRow (self, Row, row, not, None)
 
def addPoolCut (self, Row, row, not, None)
 
def getCutEfficacy (self, Row, cut, not, None, Solution, sol=None)
 
def isCutEfficacious (self, Row, cut, not, None, Solution, sol=None)
 
def addCut (self, Row, cut, not, None, forcecut=False)
 
def getNCuts (self)
 
def getNCutsApplied (self)
 
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 addConsCoeff (self, Constraint, cons, Variable, var, coeff)
 
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 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 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 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 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 addConsIndicator (self, cons, binvar=None, name="IndicatorCons", initial=True, separate=True, enforce=True, check=True, propagate=True, local=False, dynamic=False, removable=False, stickingatnode=False)
 
def addPyCons (self, Constraint, cons)
 
def addVarSOS1 (self, Constraint, cons, Variable, var, weight)
 
def appendVarSOS1 (self, Constraint, cons, Variable, var)
 
def addVarSOS2 (self, Constraint, cons, Variable, var, weight)
 
def appendVarSOS2 (self, Constraint, cons, Variable, var)
 
def setInitial (self, Constraint, cons, newInit)
 
def setRemovable (self, Constraint, cons, newRem)
 
def setEnforced (self, Constraint, cons, newEnf)
 
def setCheck (self, Constraint, cons, newCheck)
 
def chgRhs (self, Constraint, cons, rhs)
 
def chgLhs (self, Constraint, cons, lhs)
 
def getRhs (self, Constraint, cons)
 
def getLhs (self, Constraint, cons)
 
def getActivity (self, Constraint, cons, Solution, sol=None)
 
def getSlack (self, Constraint, cons, Solution, sol=None, side=None)
 
def getTransformedCons (self, Constraint, cons)
 
def getTermsQuadratic (self, Constraint, cons)
 
def setRelaxSolVal (self, Variable, var, val)
 
def getConss (self)
 
def getNConss (self)
 
def delCons (self, Constraint, cons)
 
def delConsLocal (self, Constraint, cons)
 
def getValsLinear (self, Constraint, cons)
 
def getDualMultiplier (self, Constraint, cons)
 
def getDualsolLinear (self, Constraint, cons)
 
def getDualfarkasLinear (self, Constraint, cons)
 
def getVarRedcost (self, Variable, var)
 
def optimize (self)
 
def presolve (self)
 
def initBendersDefault (self, subproblems)
 
def computeBestSolSubproblems (self)
 
def freeBendersSubproblems (self)
 
def updateBendersLowerbounds (self, lowerbounds, Benders, benders=None)
 
def activateBenders (self, str, name, int, nsubproblems)
 
def addBendersSubproblem (self, str, name, subproblem)
 
def getBendersVar (self, Variable, var, Benders, benders=None, probnumber=-1)
 
def includeEventhdlr (self, Eventhdlr, eventhdlr, name, desc)
 
def includePricer (self, Pricer, pricer, name, desc, priority=1, delay=True)
 
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 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 includePresol (self, Presol, presol, name, desc, priority, maxrounds, timing=SCIP_PRESOLTIMING_FAST)
 
def includeSepa (self, Sepa, sepa, name, desc, priority=0, freq=10, maxbounddist=1.0, usessubscip=False, delay=False)
 
def includeProp (self, Prop, prop, name, desc, presolpriority, presolmaxrounds, proptiming, presoltiming=SCIP_PRESOLTIMING_FAST, priority=1, freq=1, delay=True)
 
def includeHeur (self, Heur, heur, name, desc, dispchar, priority=10000, freq=1, freqofs=0, maxdepth=-1, timingmask=SCIP_HEURTIMING_BEFORENODE, usessubscip=False)
 
def includeRelax (self, Relax, relax, name, desc, priority=10000, freq=1)
 
def includeBranchrule (self, Branchrule, branchrule, name, desc, priority, maxdepth, maxbounddist)
 
def includeBenders (self, Benders, benders, name, desc, priority=1, cutlp=True, cutpseudo=True, cutrelax=True, shareaux=False)
 
def getLPBranchCands (self)
 
def branchVar (self, variable)
 
def branchVarVal (self, variable, value)
 
def calcNodeselPriority (self, Variable, variable, branchdir, targetvalue)
 
def calcChildEstimate (self, Variable, variable, targetvalue)
 
def createChild (self, nodeselprio, estimate)
 
def startDive (self)
 
def endDive (self)
 
def chgVarObjDive (self, Variable, var, newobj)
 
def chgVarLbDive (self, Variable, var, newbound)
 
def chgVarUbDive (self, Variable, var, newbound)
 
def getVarLbDive (self, Variable, var)
 
def getVarUbDive (self, Variable, var)
 
def chgRowLhsDive (self, Row, row, newlhs)
 
def chgRowRhsDive (self, Row, row, newrhs)
 
def addRowDive (self, Row, row)
 
def solveDiveLP (self, itlim=-1)
 
def inRepropagation (self)
 
def startProbing (self)
 
def endProbing (self)
 
def chgVarObjProbing (self, Variable, var, newobj)
 
def fixVarProbing (self, Variable, var, fixedval)
 
def isObjChangedProbing (self)
 
def inProbing (self)
 
def solveProbingLP (self, itlim=-1)
 
def interruptSolve (self)
 
def createSol (self, Heur, heur=None)
 
def printBestSol (self, write_zeros=False)
 
def printSol (self, Solution, solution, write_zeros=False)
 
def writeBestSol (self, filename="origprob.sol", write_zeros=False)
 
def writeSol (self, Solution, solution, filename="origprob.sol", write_zeros=False)
 
def readSol (self, filename)
 
def readSolFile (self, filename)
 
def setSolVal (self, Solution, solution, Variable, var, val)
 
def trySol (self, Solution, solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, free=True)
 
def checkSol (self, Solution, solution, printreason=True, completely=False, checkbounds=True, checkintegrality=True, checklprows=True, original=False)
 
def addSol (self, Solution, solution, free=True)
 
def freeSol (self, Solution, solution)
 
def getSols (self)
 
def getBestSol (self)
 
def getSolObjVal (self, Solution, sol, original=True)
 
def getObjVal (self, original=True)
 
def getSolVal (self, Solution, sol, Variable, var)
 
def getVal (self, Variable, var)
 
def getPrimalbound (self)
 
def getDualbound (self)
 
def getDualboundRoot (self)
 
def writeName (self, Variable, var)
 
def getStage (self)
 
def getStatus (self)
 
def getObjectiveSense (self)
 
def catchEvent (self, eventtype, Eventhdlr, eventhdlr)
 
def dropEvent (self, eventtype, Eventhdlr, eventhdlr)
 
def catchVarEvent (self, Variable, var, eventtype, Eventhdlr, eventhdlr)
 
def dropVarEvent (self, Variable, var, eventtype, Eventhdlr, eventhdlr)
 
def catchRowEvent (self, Row, row, eventtype, Eventhdlr, eventhdlr)
 
def dropRowEvent (self, Row, row, eventtype, Eventhdlr, eventhdlr)
 
def printStatistics (self)
 
def writeStatistics (self, filename="origprob.stats")
 
def getNLPs (self)
 
def hideOutput (self, quiet=True)
 
def redirectOutput (self)
 
def setBoolParam (self, name, value)
 
def setIntParam (self, name, value)
 
def setLongintParam (self, name, value)
 
def setRealParam (self, name, value)
 
def setCharParam (self, name, value)
 
def setStringParam (self, name, value)
 
def setParam (self, name, value)
 
def getParam (self, name)
 
def readParams (self, file)
 
def writeParams (self, filename='param.set', comments=True, onlychanged=True)
 
def resetParam (self, name)
 
def resetParams (self)
 
def setEmphasis (self, paraemphasis, quiet=True)
 
def readProblem (self, file, extension=None)
 
def count (self)
 
def getNCountedSols (self)
 
def setParamsCountsols (self)
 
def freeReoptSolve (self)
 
def chgReoptObjective (self, coeffs, sense='minimize')
 

Detailed Description

Definition at line 620 of file scip.pyx.

Member Function Documentation

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

Keyword arguments:
name -- the name of the Benders' decomposition plugin
nsubproblems -- the number of subproblems in the Benders' decomposition

Definition at line 2517 of file scip.pyx.

References SCIPactivateBenders(), and SCIPfindBenders().

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

Keyword arguments:
name -- the Benders' decomposition that the subproblem is added to
subproblem --  the subproblem to add to the decomposition

Definition at line 2529 of file scip.pyx.

References SCIPaddBendersSubproblem(), and SCIPfindBenders().

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 quadratic constraint.

:param cons: list of coefficients
: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 during 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 1417 of file scip.pyx.

References Model._addGenNonlinearCons(), Model._addLinCons(), Model._addNonlinearCons(), Model._addQuadCons(), SCIPaddBilinTermQuadratic(), SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddLinearVarQuadratic(), SCIPblkmem(), SCIPcreateConsLinear(), SCIPcreateConsNonlinear(), SCIPcreateConsQuadratic(), SCIPexprtreeSetVars(), SCIPgetNConss(), SCIPinfinity(), and SCIPreleaseCons().

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 1759 of file scip.pyx.

References Model.addConsOr(), SCIPaddCons(), SCIPcreateConsAnd(), and SCIPreleaseCons().

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 1876 of file scip.pyx.

References Model.addConsIndicator(), SCIPaddCons(), SCIPaddVarCardinality(), SCIPappendVarCardinality(), SCIPcreateConsCardinality(), and SCIPreleaseCons().

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 1668 of file scip.pyx.

References Model.addConsSOS1(), and SCIPaddCoefLinear().

def addConsIndicator (   self,
  cons,
  binvar = None,
  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 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 1927 of file scip.pyx.

References SCIPaddCons(), SCIPaddVarIndicator(), SCIPcreateConsIndicator(), and SCIPreleaseCons().

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 1798 of file scip.pyx.

References Model.addConsXor(), SCIPaddCons(), SCIPcreateConsOr(), and SCIPreleaseCons().

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 1681 of file scip.pyx.

References Model.addConsSOS2(), SCIPaddCons(), SCIPaddVarSOS1(), SCIPappendVarSOS1(), and SCIPcreateConsSOS1().

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 1720 of file scip.pyx.

References Model.addConsAnd(), SCIPaddCons(), SCIPaddVarSOS2(), SCIPappendVarSOS2(), and SCIPcreateConsSOS2().

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 1837 of file scip.pyx.

References Model.addConsCardinality(), SCIPaddCons(), SCIPcreateConsXor(), and SCIPreleaseCons().

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 1399 of file scip.pyx.

References SCIPaddRow().

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 862 of file scip.pyx.

References SCIPaddObjoffset(), and SCIPaddOrigObjoffset().

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

Definition at line 1387 of file scip.pyx.

References SCIPaddPoolCut().

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

:param Constraint cons: constraint to add

Definition at line 1983 of file scip.pyx.

References SCIPaddCons().

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

Definition at line 2998 of file scip.pyx.

References SCIPaddRowDive().

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 3207 of file scip.pyx.

References SCIPaddSol(), and SCIPaddSolFree().

def addVar (   self,
  name = '',
  vtype = 'C',
  lb = 0.0,
  ub = None,
  obj = 0.0,
  pricedVar = False 
)
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 (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)

Definition at line 946 of file scip.pyx.

References SCIPaddPricedVar(), SCIPaddVar(), SCIPcreateVarBasic(), SCIPgetNVars(), SCIPinfinity(), SCIPreleaseVar(), and SCIPvarSetData().

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 1010 of file scip.pyx.

References SCIPaddVarLocks().

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 1992 of file scip.pyx.

References SCIPaddVarSOS1().

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 2011 of file scip.pyx.

References SCIPaddVarSOS2().

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 1378 of file scip.pyx.

References SCIPaddVarToRow().

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 2002 of file scip.pyx.

References SCIPappendVarSOS1().

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 2021 of file scip.pyx.

References SCIPappendVarSOS2().

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.

Definition at line 2885 of file scip.pyx.

References SCIPbranchVar().

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

Definition at line 2900 of file scip.pyx.

References SCIPbranchVarVal().

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 1367 of file scip.pyx.

References SCIPcacheRowExtensions().

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 2930 of file scip.pyx.

References SCIPcalcChildEstimate().

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 2917 of file scip.pyx.

References SCIPcalcNodeselPriority().

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

Definition at line 3344 of file scip.pyx.

References SCIPcatchEvent(), and SCIPfindEventhdlr().

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

Definition at line 3384 of file scip.pyx.

References SCIPcatchRowEvent(), and SCIPfindEventhdlr().

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

Definition at line 3364 of file scip.pyx.

References SCIPcatchVarEvent(), and SCIPfindEventhdlr().

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 3188 of file scip.pyx.

References SCIPcheckSol(), and SCIPcheckSolOrig().

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 2085 of file scip.pyx.

References SCIPchgLhsLinear(), SCIPchgLhsQuadratic(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPinfinity().

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 3651 of file scip.pyx.

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

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 2066 of file scip.pyx.

References SCIPchgRhsLinear(), SCIPchgRhsQuadratic(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPinfinity().

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 2986 of file scip.pyx.

References SCIPchgRowLhsDive().

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 2992 of file scip.pyx.

References SCIPchgRowRhsDive().

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 1110 of file scip.pyx.

References SCIPchgVarLb(), and SCIPinfinity().

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

Definition at line 2970 of file scip.pyx.

References SCIPchgVarLbDive().

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 1133 of file scip.pyx.

References SCIPchgVarLbGlobal(), and SCIPinfinity().

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 1155 of file scip.pyx.

References SCIPchgVarLbNode(), and SCIPinfinity().

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

Definition at line 2966 of file scip.pyx.

References SCIPchgVarObjDive().

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

Definition at line 3031 of file scip.pyx.

References SCIPchgVarObjProbing().

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 1177 of file scip.pyx.

References SCIPchgVarType().

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 1121 of file scip.pyx.

References SCIPchgVarUb(), and SCIPinfinity().

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

Definition at line 2974 of file scip.pyx.

References SCIPchgVarUbDive().

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 1144 of file scip.pyx.

References SCIPchgVarUbGlobal(), and SCIPinfinity().

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 1166 of file scip.pyx.

References SCIPchgVarUbNode(), and SCIPinfinity().

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 2453 of file scip.pyx.

References SCIPbendersGetNSubproblems(), SCIPgetBenders(), SCIPgetNActiveBenders(), SCIPsetupBendersSubproblem(), and SCIPsolveBendersSubproblem().

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 1240 of file scip.pyx.

References SCIPconstructLP().

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

Definition at line 3629 of file scip.pyx.

References SCIPcount().

def create (   self)
Create a new SCIP instance

Definition at line 649 of file scip.pyx.

References SCIPcreate().

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 2942 of file scip.pyx.

References SCIPcreateChild().

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 2659 of file scip.pyx.

References SCIPcreateCons(), and SCIPfindConshdlr().

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 1318 of file scip.pyx.

References SCIPcreateEmptyRowSepa(), SCIPfindSepa(), and SCIPinfinity().

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 1337 of file scip.pyx.

References SCIPcreateEmptyRowUnspec(), and SCIPinfinity().

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 657 of file scip.pyx.

References SCIPcreateProbBasic().

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 3067 of file scip.pyx.

References SCIPcreateSol(), and SCIPfindHeur().

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

:param Constraint cons: constraint to be deleted

Definition at line 2282 of file scip.pyx.

References SCIPdelCons().

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 2290 of file scip.pyx.

References SCIPdelConsLocal().

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

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

Definition at line 1033 of file scip.pyx.

References SCIPdelVar().

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 915 of file scip.pyx.

References Model.setIntParam().

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

Definition at line 3354 of file scip.pyx.

References SCIPdropEvent(), and SCIPfindEventhdlr().

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 3394 of file scip.pyx.

References SCIPdropRowEvent(), and SCIPfindEventhdlr().

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 3374 of file scip.pyx.

References SCIPdropVarEvent(), and SCIPfindEventhdlr().

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

Definition at line 2962 of file scip.pyx.

References SCIPendDive().

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

Definition at line 3027 of file scip.pyx.

References SCIPendProbing().

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

Definition at line 722 of file scip.pyx.

References SCIPepsilon().

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

Definition at line 730 of file scip.pyx.

References SCIPfeasFrac().

def feastol (   self)
Retrieve feasibility tolerance

Definition at line 726 of file scip.pyx.

References SCIPfeastol().

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 1020 of file scip.pyx.

References SCIPfixVar().

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

Definition at line 3035 of file scip.pyx.

References SCIPfixVarProbing().

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 1374 of file scip.pyx.

References SCIPflushRowExtensions().

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

Definition at line 734 of file scip.pyx.

References SCIPfrac().

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

Definition at line 2481 of file scip.pyx.

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

def freeProb (   self)
Frees problem and solution process data

Definition at line 666 of file scip.pyx.

References SCIPfreeProb().

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

Definition at line 3647 of file scip.pyx.

References SCIPfreeReoptSolve().

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

:param Solution solution: solution to be freed

Definition at line 3221 of file scip.pyx.

References SCIPfreeSol().

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

Definition at line 670 of file scip.pyx.

References SCIPfreeTransform().

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 2132 of file scip.pyx.

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

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 2542 of file scip.pyx.

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

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

Definition at line 3242 of file scip.pyx.

References Model._bestSol, and SCIPgetBestSol().

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 770 of file scip.pyx.

References SCIPgetLPI(), and SCIPlpiGetRealSolQuality().

def getConss (   self)
Retrieve all constraints.

Definition at line 2268 of file scip.pyx.

References SCIPgetConss(), and SCIPgetNConss().

def getCurrentNode (   self)
Retrieve current node.

Definition at line 706 of file scip.pyx.

References SCIPgetCurrentNode().

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 1391 of file scip.pyx.

References SCIPgetCutEfficacy().

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

Definition at line 714 of file scip.pyx.

References SCIPgetDepth().

def getDualbound (   self)
Retrieve the best dual bound.

Definition at line 3300 of file scip.pyx.

References SCIPgetDualbound().

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

Definition at line 3304 of file scip.pyx.

References SCIPgetDualboundRoot().

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

:param Constraint cons: linear constraint

Definition at line 2379 of file scip.pyx.

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

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

:param Constraint cons: linear constraint

Definition at line 2319 of file scip.pyx.

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

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

Definition at line 710 of file scip.pyx.

References SCIPgetGap().

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

:param Constraint cons: linear or quadratic constraint

Definition at line 2118 of file scip.pyx.

References SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLhsLinear(), and SCIPgetLhsQuadratic().

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 1280 of file scip.pyx.

References SCIPgetLPBasisInd(), and SCIPgetNLPRows().

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

Definition at line 1301 of file scip.pyx.

References SCIPgetLPBInvARow(), and SCIPgetNLPCols().

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

Definition at line 1290 of file scip.pyx.

References SCIPgetLPBInvRow(), and SCIPgetNLPRows().

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 2851 of file scip.pyx.

References SCIPgetLPBranchCands(), and SCIPgetNLPBranchCands().

def getLPColsData (   self)
Retrieve current LP columns

Definition at line 1256 of file scip.pyx.

References SCIPgetLPColsData().

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

Definition at line 1251 of file scip.pyx.

References SCIPgetLPObjval().

def getLPRowsData (   self)
Retrieve current LP rows

Definition at line 1264 of file scip.pyx.

References SCIPgetLPRowsData().

def getLPSolstat (   self)
Gets solution status of current LP

Definition at line 1235 of file scip.pyx.

References SCIPgetLPSolstat().

def getNConss (   self)
Retrieve the number of constraints.

Definition at line 1220 of file scip.pyx.

References SCIPgetNConss().

def getNConss (   self)
Retrieve number of all constraints

Definition at line 2278 of file scip.pyx.

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

def getNCountedSols (   self)
Get number of feasible solution.

Definition at line 3633 of file scip.pyx.

References SCIPgetNCountedSols().

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

Definition at line 1405 of file scip.pyx.

References SCIPgetNCuts().

def getNCutsApplied (   self)
Retrieve number of currently applied cuts

Definition at line 1409 of file scip.pyx.

References Model.addCons(), and SCIPgetNCutsApplied().

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

Definition at line 1276 of file scip.pyx.

References SCIPgetNLPCols().

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

Definition at line 1272 of file scip.pyx.

References SCIPgetNLPRows().

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

Definition at line 3422 of file scip.pyx.

References SCIPgetNLPs().

def getNNodes (   self)
Retrieve the total number of processed nodes.

Definition at line 702 of file scip.pyx.

References SCIPgetNNodes().

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

Definition at line 1216 of file scip.pyx.

References SCIPgetNVars().

def getObjective (   self)
Retrieve objective function as Expr

Definition at line 851 of file scip.pyx.

References Model.getVars().

def getObjectiveSense (   self)
Retrieve objective sense.

Definition at line 3334 of file scip.pyx.

References SCIPgetObjsense().

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

Definition at line 805 of file scip.pyx.

References SCIPgetObjlimit().

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

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

Definition at line 874 of file scip.pyx.

References SCIPgetOrigObjoffset(), and SCIPgetTransObjoffset().

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 3262 of file scip.pyx.

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

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 3540 of file scip.pyx.

References SCIPgetParam().

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

Definition at line 698 of file scip.pyx.

References SCIPgetPresolvingTime().

def getPrimalbound (   self)
Retrieve the best primal bound.

Definition at line 3296 of file scip.pyx.

References SCIPgetPrimalbound().

def getProbName (   self)
Retrieve problem name

Definition at line 682 of file scip.pyx.

References SCIPgetProbName().

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

Definition at line 694 of file scip.pyx.

References SCIPgetReadingTime().

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

:param Constraint cons: linear or quadratic constraint

Definition at line 2104 of file scip.pyx.

References SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetRhsLinear(), and SCIPgetRhsQuadratic().

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

Definition at line 1354 of file scip.pyx.

References SCIPgetRowActivity().

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

Definition at line 1358 of file scip.pyx.

References SCIPgetRowLPActivity().

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 2162 of file scip.pyx.

References Model.getStage(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetActivityLinear(), SCIPgetActivityQuadratic(), SCIPgetLhsLinear(), SCIPgetLhsQuadratic(), SCIPgetRhsLinear(), and SCIPgetRhsQuadratic().

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 3247 of file scip.pyx.

References SCIPgetSolOrigObj(), and SCIPgetSolTransObj().

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

Definition at line 3229 of file scip.pyx.

References SCIPgetNSols(), and SCIPgetSols().

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

:param Solution sol: solution
:param Variable var: variable to query the value of

Definition at line 3273 of file scip.pyx.

References SCIPgetSolVal().

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

Definition at line 690 of file scip.pyx.

References SCIPgetSolvingTime().

def getStage (   self)
Retrieve current SCIP stage

Definition at line 3316 of file scip.pyx.

References SCIPgetStage().

def getStatus (   self)
Retrieve solution status.

Definition at line 3320 of file scip.pyx.

References SCIPgetStatus().

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

:param Constraint cons: constraint

Definition at line 2216 of file scip.pyx.

References SCIPgetBilinTermsQuadratic(), SCIPgetCoefsLinearVarsQuadratic(), SCIPgetLinearVarsQuadratic(), SCIPgetNBilinTermsQuadratic(), SCIPgetNLinearVarsQuadratic(), SCIPgetNQuadVarTermsQuadratic(), and SCIPgetQuadVarTermsQuadratic().

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 686 of file scip.pyx.

References SCIPgetTotalTime().

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

:param Constraint cons: constraint

Definition at line 2206 of file scip.pyx.

References SCIPgetTransformedCons().

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

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

Definition at line 1000 of file scip.pyx.

References SCIPtransformVar().

def getVal (   self,
  Variable,
  var 
)
Retrieve the value of the best known solution.
Can only be called after solving is completed.

:param Variable var: variable to query the value of

Definition at line 3285 of file scip.pyx.

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

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 2298 of file scip.pyx.

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

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

Definition at line 2978 of file scip.pyx.

References SCIPgetVarLbDive().

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 2392 of file scip.pyx.

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

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

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

Definition at line 1196 of file scip.pyx.

References SCIPgetNOrigVars(), SCIPgetNVars(), SCIPgetOrigVars(), and SCIPgetVars().

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

Definition at line 2982 of file scip.pyx.

References SCIPgetVarUbDive().

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

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

Definition at line 3428 of file scip.pyx.

References SCIPsetMessagehdlrQuiet().

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 2822 of file scip.pyx.

References SCIPfindBenders(), and SCIPincludeBenders().

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 2800 of file scip.pyx.

References Model.includeBenders(), and SCIPincludeBranchrule().

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 2624 of file scip.pyx.

References Model.createCons(), and SCIPincludeConshdlr().

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

Definition at line 653 of file scip.pyx.

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 2573 of file scip.pyx.

References SCIPincludeEventhdlr().

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 2753 of file scip.pyx.

References SCIPincludeHeur().

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 2685 of file scip.pyx.

References SCIPincludePresol().

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 2597 of file scip.pyx.

References Model.includeConshdlr(), SCIPactivatePricer(), SCIPfindPricer(), and SCIPincludePricer().

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 2725 of file scip.pyx.

References Model.includeHeur(), and SCIPincludeProp().

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 2781 of file scip.pyx.

References SCIPincludeRelax().

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 2703 of file scip.pyx.

References Model.includeProp(), and SCIPincludeSepa().

def infinity (   self)
Retrieve SCIP's infinity value

Definition at line 718 of file scip.pyx.

References SCIPinfinity().

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 2417 of file scip.pyx.

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

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

Definition at line 3043 of file scip.pyx.

References SCIPinProbing().

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

Definition at line 3016 of file scip.pyx.

References SCIPinRepropagation().

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

Definition at line 3061 of file scip.pyx.

References SCIPinterruptSolve().

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 1395 of file scip.pyx.

References SCIPisCutEfficacious().

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

Definition at line 750 of file scip.pyx.

References SCIPisFeasNegative().

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

Definition at line 742 of file scip.pyx.

References SCIPisFeasZero().

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

Definition at line 762 of file scip.pyx.

References SCIPisGE().

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

Definition at line 766 of file scip.pyx.

References SCIPisGT().

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

Definition at line 746 of file scip.pyx.

References SCIPisInfinity().

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

Definition at line 754 of file scip.pyx.

References SCIPisLE().

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

Definition at line 1312 of file scip.pyx.

References SCIPisLPSolBasic().

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

Definition at line 758 of file scip.pyx.

References SCIPisLT().

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

Definition at line 3039 of file scip.pyx.

References SCIPisObjChangedProbing().

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

Definition at line 738 of file scip.pyx.

References SCIPisZero().

def optimize (   self)
Optimize the problem.

Definition at line 2407 of file scip.pyx.

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

def presolve (   self)
Presolve the problem.

Definition at line 2412 of file scip.pyx.

References SCIPpresolve().

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

Definition at line 3084 of file scip.pyx.

References SCIPprintBestSol().

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

Definition at line 1382 of file scip.pyx.

References SCIPprintRow().

def printSol (   self,
  Solution,
  solution,
  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 3088 of file scip.pyx.

References SCIPprintSol().

def printStatistics (   self)
Print statistics.

Definition at line 3406 of file scip.pyx.

References SCIPprintStatistics().

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

Definition at line 678 of file scip.pyx.

References SCIPprintVersion().

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

:param file: file to be read

Definition at line 3570 of file scip.pyx.

References SCIPreadParams().

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

:param file: file to be read
:param extension: specify file extension/type (Default value = None)

Definition at line 3613 of file scip.pyx.

References SCIPreadProb().

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 3126 of file scip.pyx.

References SCIPreadSol().

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 3135 of file scip.pyx.

References Model.createSol(), and SCIPreadSolFile().

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

Definition at line 3438 of file scip.pyx.

References SCIPsetMessagehdlr().

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

Definition at line 1363 of file scip.pyx.

References SCIPreleaseRow().

def releaseVar (   self,
  Variable,
  var 
)
Release the variable.

:param Variable var: variable to be released

Definition at line 992 of file scip.pyx.

References SCIPreleaseVar().

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

:param name: parameter to reset

Definition at line 3591 of file scip.pyx.

References SCIPresetParam().

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

Definition at line 3600 of file scip.pyx.

References SCIPresetParams().

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

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

Definition at line 3449 of file scip.pyx.

References SCIPsetBoolParam().

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

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

Definition at line 3489 of file scip.pyx.

References SCIPsetCharParam().

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

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

Definition at line 2057 of file scip.pyx.

References SCIPsetConsChecked().

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

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

Definition at line 3604 of file scip.pyx.

References SCIPsetEmphasis().

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

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

Definition at line 2048 of file scip.pyx.

References SCIPsetConsEnforced().

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

:param setting: the parameter setting (SCIP_PARAMSETTING)

Definition at line 907 of file scip.pyx.

References SCIPsetHeuristics().

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

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

Definition at line 2030 of file scip.pyx.

References SCIPsetConsInitial().

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

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

Definition at line 3459 of file scip.pyx.

References SCIPsetIntParam().

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

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

Definition at line 3469 of file scip.pyx.

References SCIPsetLongintParam().

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

Definition at line 792 of file scip.pyx.

References SCIPsetObjsense().

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

Definition at line 788 of file scip.pyx.

References SCIPsetObjsense().

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 809 of file scip.pyx.

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

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 796 of file scip.pyx.

References SCIPsetObjlimit().

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 3510 of file scip.pyx.

References SCIPgetParam(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetRealParam(), and SCIPsetStringParam().

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

Definition at line 3643 of file scip.pyx.

References SCIPsetParamsCountsols().

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

:param setting: the parameter settings (SCIP_PARAMSETTING)

Definition at line 886 of file scip.pyx.

References SCIPsetPresolving().

def setProbName (   self,
  name 
)
Set problem name

Definition at line 894 of file scip.pyx.

References SCIPsetProbName().

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

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

Definition at line 3479 of file scip.pyx.

References SCIPsetRealParam().

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

Definition at line 2264 of file scip.pyx.

References SCIPsetRelaxSolVal().

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

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

Definition at line 2039 of file scip.pyx.

References SCIPsetConsRemovable().

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

:param setting: the parameter settings (SCIP_PARAMSETTING)

Definition at line 899 of file scip.pyx.

References SCIPsetSeparating().

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 3157 of file scip.pyx.

References SCIPsetSolVal().

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

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

Definition at line 3499 of file scip.pyx.

References SCIPsetStringParam().

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 3002 of file scip.pyx.

References SCIPsolveDiveLP().

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 3047 of file scip.pyx.

References SCIPsolveProbingLP().

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 2955 of file scip.pyx.

References SCIPstartDive().

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

Definition at line 3021 of file scip.pyx.

References SCIPstartProbing().

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 1044 of file scip.pyx.

References SCIPtightenVarLb().

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 1094 of file scip.pyx.

References SCIPtightenVarLbGlobal().

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 1061 of file scip.pyx.

References SCIPtightenVarUb().

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 1078 of file scip.pyx.

References SCIPtightenVarUbGlobal().

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 3169 of file scip.pyx.

References SCIPtrySol(), and SCIPtrySolFree().

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 2499 of file scip.pyx.

References SCIPbendersUpdateSubproblemLowerbound(), and SCIPfindBenders().

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 1224 of file scip.pyx.

References SCIPupdateNodeLowerbound().

def version (   self)
Retrieve SCIP version

Definition at line 674 of file scip.pyx.

References SCIPversion().

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 3097 of file scip.pyx.

References SCIPprintBestSol().

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

:param Variable var: variable

Definition at line 3308 of file scip.pyx.

References SCIPwriteVarName().

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 3579 of file scip.pyx.

References SCIPwriteParams().

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

:param filename: the name of the file to be used (Default value = 'model.cip')
:param trans: indicates whether the transformed problem is written to file (Default value = False)

Definition at line 925 of file scip.pyx.

References SCIPwriteOrigProblem(), and SCIPwriteTransProblem().

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 3110 of file scip.pyx.

References SCIPprintSol().

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

Keyword arguments:
filename -- name of the output file

Definition at line 3410 of file scip.pyx.

References SCIPprintStatistics().


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