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 | addCoefLinear (self, Constraint, cons, Variable, var, value) |
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 | addConsDisjunction (self, conss, name='', initial=True, relaxcons=None, enforce=True, check=True, local=False, modifiable=False, dynamic=False) |
def | addConsElemDisjunction (self, Constraint, disj_cons, Constraint, cons) |
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 | addExprNonlinear (self, Constraint, cons, Union[Expr, GenExpr] expr, float, coef) |
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 | allColsInLP (self) |
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, 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 | chgCoefLinear (self, Constraint, cons, Variable, var, value) |
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 | createConsFromExpr (self, cons, 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 | createOrigSol (self, Heur, heur=None) |
def | createPartialSol (self, Heur, heur=None) |
def | createProbBasic (self, problemName='model') |
def | createSol (self, Heur, heur=None) |
def | delCoefLinear (self, Constraint, cons, Variable, var) |
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 | endStrongbranch (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 | getBipartiteGraphRepresentation (self, prev_col_features=None, prev_edge_features=None, prev_row_features=None, static_only=False, suppress_warnings=False) |
def | getBranchScoreMultiple (self, Variable, var, gains) |
def | getColRedCost (self, Column, col) |
def | getCondition (self, exact=False) |
def | getConsNVars (self, Constraint, constraint) |
def | getConss (self, transformed=True) |
def | getConsVars (self, Constraint, constraint) |
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, transformed=True) |
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, transformed=True) |
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 | getPrimalRay (self) |
def | getPrimalRayVal (self, Variable, var) |
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 | getSolTime (self, Solution, sol) |
def | getSolVal (self, Solution, sol, Expr, expr) |
def | getSolvingTime (self) |
def | getStage (self) |
def | getStageName (self) |
def | getStatus (self) |
def | getTermsQuadratic (self, Constraint, cons) |
def | getTotalTime (self) |
def | getTransformedCons (self, Constraint, cons) |
def | getTransformedVar (self, Variable, var) |
def | getTreesizeEstimation (self) |
def | getVal (self, Expr, expr) |
def | getValsLinear (self, Constraint, cons) |
def | getVarDict (self) |
def | getVarLbDive (self, Variable, var) |
def | getVarRedcost (self, Variable, var) |
def | getVars (self, transformed=False) |
def | getVarStrongbranch (self, Variable, var, itlim, idempotent=False, integral=False) |
def | getVarStrongbranchLast (self, Variable, var) |
def | getVarStrongbranchNode (self, Variable, var) |
def | getVarUbDive (self, Variable, var) |
def | hasPrimalRay (self) |
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 | printExternalCodeVersions (self) |
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 | readStatistics (self, filename) |
def | redirectOutput (self) |
def | relax (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, expr, 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 | startStrongbranch (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 | updateVarPseudocost (self, Variable, var, valdelta, objdelta, weight) |
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, verbose=True) |
def | writeProblem (self, filename='model.cip', trans=False, genericnames=False, verbose=True) |
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) | |
Main class holding a pointer to SCIP for managing most interactions
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 1012 of file scip.pxi.
References Model._bestSol, Model._freescip, Model._modelvars, Model._scip, Model.createProbBasic(), Model.includeDefaultPlugins(), SCIPcopy(), SCIPcopyOrig(), SCIPcreate(), pyscipopt.scip.str_conversion, and Model.version().
def __dealloc__ | ( | self | ) |
Definition at line 1051 of file scip.pxi.
References Model._freescip, Model._scip, and SCIPfree().
def __eq__ | ( | self, | |
other | |||
) |
Definition at line 1060 of file scip.pxi.
References Event.__class__, Column.__class__, Row.__class__, NLRow.__class__, Node.__class__, Constraint.__class__, Model.__class__, and Model._scip.
def __hash__ | ( | self | ) |
Definition at line 1057 of file scip.pxi.
References Model._scip.
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 3677 of file scip.pxi.
References Model._scip, and SCIPactivateBenders().
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 3686 of file scip.pxi.
References Model._scip, and SCIPaddBendersSubproblem().
def addCoefLinear | ( | self, | |
Constraint, | |||
cons, | |||
Variable, | |||
var, | |||
value | |||
) |
Adds coefficient to linear constraint (if it is not zero) :param Constraint cons: linear constraint :param Variable var: variable of constraint entry :param value: coefficient of constraint entry
Definition at line 3195 of file scip.pxi.
References Model._scip, and SCIPaddCoefLinear().
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 2428 of file scip.pxi.
References Model._scip, Model.createConsFromExpr(), SCIPaddCons(), 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 2781 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPcreateConsAnd(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
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 2898 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPaddVarCardinality(), SCIPappendVarCardinality(), SCIPcreateConsCardinality(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
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 2666 of file scip.pxi.
References Model._scip, and SCIPaddCoefLinear().
def addConsDisjunction | ( | self, | |
conss, | |||
name = '' , |
|||
initial = True , |
|||
relaxcons = None , |
|||
enforce = True , |
|||
check = True , |
|||
local = False , |
|||
modifiable = False , |
|||
dynamic = False |
|||
) |
Add a disjunction constraint. :param Iterable[Constraint] conss: An iterable of constraint objects to be included initially in the disjunction. Currently, these must be expressions. :param name: the name of the disjunction constraint. :param initial: should the LP relaxation of disjunction constraint be in the initial LP? (Default value = True) :param relaxcons: a conjunction constraint containing the linear relaxation of the disjunction constraint, or None. (Default value = None) :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 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) :return The added @ref scip#Constraint "Constraint" object.
Definition at line 2537 of file scip.pxi.
References Model._scip, Model.createConsFromExpr(), SCIPaddCons(), SCIPaddConsElemDisjunction(), SCIPcreateConsDisjunction(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
def addConsElemDisjunction | ( | self, | |
Constraint, | |||
disj_cons, | |||
Constraint, | |||
cons | |||
) |
Appends a constraint to a disjunction. :param Constraint disj_cons: the disjunction constraint to append to. :param Constraint cons: the Constraint to append :return The disjunction constraint with added @ref scip#Constraint object.
Definition at line 2588 of file scip.pxi.
References Model._scip, SCIPaddConsElemDisjunction(), and SCIPreleaseCons().
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 2948 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPaddVarIndicator(), SCIPcreateConsIndicator(), SCIPgetNegatedVar(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
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 2690 of file scip.pxi.
References Model._scip, and SCIPaddConsLocal().
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 2676 of file scip.pxi.
References Model._scip, and SCIPaddConsNode().
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 2820 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPcreateConsOr(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
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 2472 of file scip.pxi.
References Model.addCons().
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 2703 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPaddVarSOS1(), SCIPappendVarSOS1(), SCIPcreateConsSOS1(), and pyscipopt.scip.str_conversion.
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 2742 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPaddVarSOS2(), SCIPappendVarSOS2(), SCIPcreateConsSOS2(), and pyscipopt.scip.str_conversion.
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 2859 of file scip.pxi.
References Model._scip, SCIPaddCons(), SCIPcreateConsXor(), SCIPreleaseCons(), and pyscipopt.scip.str_conversion.
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 2095 of file scip.pxi.
References Model._scip, and SCIPaddRow().
def addExprNonlinear | ( | self, | |
Constraint, | |||
cons, | |||
Union[Expr,GenExpr] | expr, | ||
float, | |||
coef | |||
) |
Add coef*expr to nonlinear constraint.
Definition at line 2650 of file scip.pxi.
References Model._scip, Model.addCons(), Model.delCons(), Model.getStage(), SCIPaddExprNonlinear(), and SCIPgetExprNonlinear().
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 1401 of file scip.pxi.
References Model._scip, SCIPaddObjoffset(), and SCIPaddOrigObjoffset().
def addPoolCut | ( | self, | |
Row, | |||
row, | |||
not, | |||
None | |||
) |
if not already existing, adds row to global cut pool
Definition at line 2079 of file scip.pxi.
References Model._scip, and SCIPaddPoolCut().
def addPyCons | ( | self, | |
Constraint, | |||
cons | |||
) |
Adds a customly created cons. :param Constraint cons: constraint to add
Definition at line 3021 of file scip.pxi.
References Model._scip, and SCIPaddCons().
def addRowDive | ( | self, | |
Row, | |||
row | |||
) |
adds a row to the LP in current dive
Definition at line 4401 of file scip.pxi.
References Model._scip, and 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 4804 of file scip.pxi.
References Model._scip, SCIPaddSol(), and SCIPaddSolFree().
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 1516 of file scip.pxi.
References Model._modelvars, Model._scip, SCIPaddPricedVar(), SCIPaddVar(), SCIPcreateVarBasic(), SCIPgetNVars(), SCIPinfinity(), SCIPreleaseVar(), SCIPvarSetData(), and pyscipopt.scip.str_conversion.
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 1585 of file scip.pxi.
References Model._scip, and 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 3030 of file scip.pxi.
References Model._scip, and 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 3049 of file scip.pxi.
References Model._scip, and 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 2052 of file scip.pxi.
References Model._scip, and SCIPaddVarToRow().
def allColsInLP | ( | self | ) |
checks if all columns, i.e. every variable with non-empty column is present in the LP. This is not True when performing pricing for instance.
Definition at line 1976 of file scip.pxi.
References Model._scip, and SCIPallColsInLP().
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 3040 of file scip.pxi.
References Model._scip, and 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 3059 of file scip.pxi.
References Model._scip, and SCIPappendVarSOS2().
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 4500 of file scip.pxi.
References Model._scip, and SCIPapplyCutsProbing().
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 4440 of file scip.pxi.
References Model._scip, and SCIPbacktrackProbing().
def branchVar | ( | self, | |
Variable, | |||
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 4287 of file scip.pxi.
References Model._scip, and 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 (it is None otherwise)
Definition at line 4303 of file scip.pxi.
References Model._scip, and 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 2041 of file scip.pxi.
References Model._scip, and 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 4333 of file scip.pxi.
References Model._scip, and 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 4320 of file scip.pxi.
References Model._scip, and SCIPcalcNodeselPriority().
def catchEvent | ( | self, | |
eventtype, | |||
Eventhdlr, | |||
eventhdlr | |||
) |
catches a global (not variable or row dependent) event
Definition at line 5063 of file scip.pxi.
References Model._scip, SCIPcatchEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
def catchRowEvent | ( | self, | |
Row, | |||
row, | |||
eventtype, | |||
Eventhdlr, | |||
eventhdlr | |||
) |
catches a row coefficient, constant, or side change event on the given row
Definition at line 5107 of file scip.pxi.
References Model._scip, SCIPcatchRowEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
def catchVarEvent | ( | self, | |
Variable, | |||
var, | |||
eventtype, | |||
Eventhdlr, | |||
eventhdlr | |||
) |
catches an objective value or domain change event on the given transformed variable
Definition at line 5087 of file scip.pxi.
References Model._scip, SCIPcatchVarEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
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 3834 of file scip.pxi.
References Model._scip, SCIPcheckBendersSubproblemOptimality(), and SCIPfindBenders().
def checkQuadraticNonlinear | ( | self, | |
Constraint, | |||
cons | |||
) |
returns if the given constraint is quadratic :param Constraint cons: constraint
Definition at line 3337 of file scip.pxi.
References Model._scip, and SCIPcheckQuadraticNonlinear().
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 4785 of file scip.pxi.
References Model._scip, SCIPcheckSol(), and SCIPcheckSolOrig().
def chgCoefLinear | ( | self, | |
Constraint, | |||
cons, | |||
Variable, | |||
var, | |||
value | |||
) |
Changes coefficient of variable in linear constraint; deletes the variable if coefficient is zero; adds variable if not yet contained in the constraint This method may only be called during problem creation stage for an original constraint and variable. This method requires linear time to search for occurences of the variable in the constraint data. :param Constraint cons: linear constraint :param Variable var: variable of constraint entry :param value: new coefficient of constraint entry
Definition at line 3170 of file scip.pxi.
References Model._scip, and SCIPchgCoefLinear().
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 3123 of file scip.pxi.
References Model._scip, SCIPchgLhsLinear(), SCIPchgLhsNonlinear(), 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 5528 of file scip.pxi.
References Model._scip, 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 right hand side (set to None for +infinity)
Definition at line 3104 of file scip.pxi.
References Model._scip, SCIPchgRhsLinear(), SCIPchgRhsNonlinear(), 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 4389 of file scip.pxi.
References Model._scip, and 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 4395 of file scip.pxi.
References Model._scip, and SCIPchgRowRhsDive().
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 5574 of file scip.pxi.
References Model._scip, and SCIPchgVarBranchPriority().
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 1685 of file scip.pxi.
References Model._scip, SCIPchgVarLb(), and SCIPinfinity().
def chgVarLbDive | ( | self, | |
Variable, | |||
var, | |||
newbound | |||
) |
changes variable's current lb in current dive
Definition at line 4373 of file scip.pxi.
References Model._scip, and 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 1707 of file scip.pxi.
References Model._scip, 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 1729 of file scip.pxi.
References Model._scip, SCIPchgVarLbNode(), and SCIPinfinity().
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 4454 of file scip.pxi.
References Model._scip, SCIPchgVarLbProbing(), and SCIPinfinity().
def chgVarObjDive | ( | self, | |
Variable, | |||
var, | |||
newobj | |||
) |
changes (column) variable's objective value in current dive
Definition at line 4369 of file scip.pxi.
References Model._scip, and SCIPchgVarObjDive().
def chgVarObjProbing | ( | self, | |
Variable, | |||
var, | |||
newobj | |||
) |
changes (column) variable's objective value during probing mode
Definition at line 4450 of file scip.pxi.
References Model._scip, and 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 1751 of file scip.pxi.
References Model._scip, and 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 1696 of file scip.pxi.
References Model._scip, SCIPchgVarUb(), and SCIPinfinity().
def chgVarUbDive | ( | self, | |
Variable, | |||
var, | |||
newbound | |||
) |
changes variable's current ub in current dive
Definition at line 4377 of file scip.pxi.
References Model._scip, and 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 1718 of file scip.pxi.
References Model._scip, 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 1740 of file scip.pxi.
References Model._scip, SCIPchgVarUbNode(), and SCIPinfinity().
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 4464 of file scip.pxi.
References Model._scip, SCIPchgVarUbProbing(), 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 3615 of file scip.pxi.
References Model._bestSol, Model._scip, 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 1900 of file scip.pxi.
References Model._scip, and SCIPconstructLP().
def count | ( | self | ) |
Counts the number of feasible points of problem.
Definition at line 5502 of file scip.pxi.
References Model._scip, and SCIPcount().
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 4345 of file scip.pxi.
References Model._scip, and 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 3955 of file scip.pxi.
References Model._scip, SCIPcreateCons(), SCIPfindConshdlr(), and pyscipopt.scip.str_conversion.
def createConsFromExpr | ( | self, | |
cons, | |||
name = '' , |
|||
initial = True , |
|||
separate = True , |
|||
enforce = True , |
|||
check = True , |
|||
propagate = True , |
|||
local = False , |
|||
modifiable = False , |
|||
dynamic = False , |
|||
removable = False , |
|||
stickingatnode = False |
|||
) |
Create a linear or nonlinear constraint without adding it to the SCIP problem. This is useful for creating disjunction constraints without also enforcing the individual constituents. Currently, this can only be used as an argument to `.addConsElemDisjunction`. To add an individual linear/nonlinear constraint, prefer `.addCons()`. :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 created @ref scip#Constraint "Constraint" object.
Definition at line 2382 of file scip.pxi.
References Model._createConsGenNonlinear(), Model._createConsLinear(), Model._createConsNonlinear(), Model._createConsQuadratic(), Model._scip, SCIPgetNConss(), and SCIPinfinity().
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 1992 of file scip.pxi.
References Model._scip, SCIPcreateEmptyRowSepa(), SCIPfindSepa(), SCIPinfinity(), and pyscipopt.scip.str_conversion.
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 2011 of file scip.pxi.
References Model._scip, SCIPcreateEmptyRowUnspec(), SCIPinfinity(), and pyscipopt.scip.str_conversion.
def createOrigSol | ( | self, | |
Heur, | |||
heur = None |
|||
) |
Create a new primal solution in the original space. :param Heur heur: heuristic that found the solution (Default value = None)
Definition at line 4585 of file scip.pxi.
References Model._scip, SCIPcreateOrigSol(), SCIPfindHeur(), and pyscipopt.scip.str_conversion.
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 4568 of file scip.pxi.
References Model._scip, SCIPcreatePartialSol(), SCIPfindHeur(), and pyscipopt.scip.str_conversion.
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 1122 of file scip.pxi.
References Model._scip, SCIPcreateProbBasic(), and pyscipopt.scip.str_conversion.
def createSol | ( | self, | |
Heur, | |||
heur = None |
|||
) |
Create a new primal solution in the transformed space. :param Heur heur: heuristic that found the solution (Default value = None)
Definition at line 4550 of file scip.pxi.
References Model._scip, SCIPcreateSol(), SCIPfindHeur(), and pyscipopt.scip.str_conversion.
def delCoefLinear | ( | self, | |
Constraint, | |||
cons, | |||
Variable, | |||
var | |||
) |
Deletes variable from linear constraint This method may only be called during problem creation stage for an original constraint and variable. This method requires linear time to search for occurences of the variable in the constraint data. :param Constraint cons: linear constraint :param Variable var: variable of constraint entry
Definition at line 3183 of file scip.pxi.
References Model._scip, and SCIPdelCoefLinear().
def delCons | ( | self, | |
Constraint, | |||
cons | |||
) |
Delete constraint from the model :param Constraint cons: constraint to be deleted
Definition at line 3438 of file scip.pxi.
References Model._scip, and 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 3446 of file scip.pxi.
References Model._scip, and 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 1608 of file scip.pxi.
References Model._modelvars, Model._scip, and 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 1474 of file scip.pxi.
References Model.setIntParam().
def dropEvent | ( | self, | |
eventtype, | |||
Eventhdlr, | |||
eventhdlr | |||
) |
drops a global event (stops to track event)
Definition at line 5075 of file scip.pxi.
References Model._scip, SCIPdropEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
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 5117 of file scip.pxi.
References Model._scip, SCIPdropRowEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
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 5097 of file scip.pxi.
References Model._scip, SCIPdropVarEvent(), SCIPfindEventhdlr(), and pyscipopt.scip.str_conversion.
def enableReoptimization | ( | self, | |
enable = True |
|||
) |
include specific heuristics and branching rules for reoptimization
Definition at line 1310 of file scip.pxi.
References Model._scip, and SCIPenableReoptimization().
def endDive | ( | self | ) |
Quits probing and resets bounds and constraints to the focus node's environment
Definition at line 4365 of file scip.pxi.
References Model._scip, and SCIPendDive().
def endProbing | ( | self | ) |
Quits probing and resets bounds and constraints to the focus node's environment
Definition at line 4430 of file scip.pxi.
References Model._scip, and SCIPendProbing().
def endStrongbranch | ( | self | ) |
End strong branching. Needs to be called if startStrongBranching was called previously. Between these calls the user can access all strong branching functionality.
Definition at line 5591 of file scip.pxi.
References Model._scip, and SCIPendStrongbranch().
def epsilon | ( | self | ) |
Retrieve epsilon for e.g. equality checks
Definition at line 1234 of file scip.pxi.
References Model._scip, and 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 1242 of file scip.pxi.
References Model._scip, and SCIPfeasFrac().
def feastol | ( | self | ) |
Retrieve feasibility tolerance
Definition at line 1238 of file scip.pxi.
References Model._scip, and 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 1595 of file scip.pxi.
References Model._scip, and SCIPfixVar().
def fixVarProbing | ( | self, | |
Variable, | |||
var, | |||
fixedval | |||
) |
Fixes a variable at the current probing node.
Definition at line 4474 of file scip.pxi.
References Model._scip, and 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 2048 of file scip.pxi.
References Model._scip, and 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 1246 of file scip.pxi.
References Model._scip, and SCIPfrac().
def freeBendersSubproblems | ( | self | ) |
Calls the free subproblem function for the Benders' decomposition. This will free all subproblems for all decompositions.
Definition at line 3642 of file scip.pxi.
References Model._scip, SCIPbendersGetNSubproblems(), SCIPfreeBendersSubproblem(), SCIPgetBenders(), and SCIPgetNActiveBenders().
def freeProb | ( | self | ) |
Frees problem and solution process data
Definition at line 1131 of file scip.pxi.
References Model._scip, and SCIPfreeProb().
def freeReoptSolve | ( | self | ) |
Frees all solution process data and prepares for reoptimization
Definition at line 5524 of file scip.pxi.
References Model._scip, and SCIPfreeReoptSolve().
def freeSol | ( | self, | |
Solution, | |||
solution | |||
) |
Free given solution :param Solution solution: solution to be freed
Definition at line 4818 of file scip.pxi.
References Model._scip, and SCIPfreeSol().
def freeTransform | ( | self | ) |
Frees all solution process data including presolving and transformed problem, only original problem is kept
Definition at line 1135 of file scip.pxi.
References Model._modelvars, Model._scip, and SCIPfreeTransform().
|
static |
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 3206 of file scip.pxi.
References Model._scip, Model.getStage(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetActivityLinear().
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 3814 of file scip.pxi.
References Model._scip, SCIPbendersGetAuxiliaryVar(), and SCIPfindBenders().
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 3765 of file scip.pxi.
References Model._scip, SCIPbendersSubproblem(), and SCIPfindBenders().
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 3785 of file scip.pxi.
References Model._scip, SCIPfindBenders(), SCIPgetBendersMasterVar(), and SCIPgetBendersSubproblemVar().
def getBestboundNode | ( | self | ) |
gets the node with smallest lower bound from the tree (child, sibling, or leaf).
Definition at line 1865 of file scip.pxi.
References Model._scip, and SCIPgetBestboundNode().
def getBestChild | ( | self | ) |
gets the best child of the focus node w.r.t. the node selection strategy.
Definition at line 1849 of file scip.pxi.
References Model._scip, and SCIPgetBestChild().
def getBestLeaf | ( | self | ) |
gets the best leaf from the node queue w.r.t. the node selection strategy.
Definition at line 1857 of file scip.pxi.
References Model._scip, and SCIPgetBestLeaf().
def getBestNode | ( | self | ) |
gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy.
Definition at line 1861 of file scip.pxi.
References Model._scip, and SCIPgetBestNode().
def getBestSibling | ( | self | ) |
gets the best sibling of the focus node w.r.t. the node selection strategy.
Definition at line 1853 of file scip.pxi.
References Model._scip, and SCIPgetBestSibling().
def getBestSol | ( | self | ) |
Retrieve currently best known feasible primal solution.
Definition at line 4858 of file scip.pxi.
References Model._bestSol, Model._scip, and SCIPgetBestSol().
def getBipartiteGraphRepresentation | ( | self, | |
prev_col_features = None , |
|||
prev_edge_features = None , |
|||
prev_row_features = None , |
|||
static_only = False , |
|||
suppress_warnings = False |
|||
) |
This function generates the bipartite graph representation of an LP, which was first used in the following paper: @inproceedings{conf/nips/GasseCFCL19, title={Exact Combinatorial Optimization with Graph Convolutional Neural Networks}, author={Gasse, Maxime and Chételat, Didier and Ferroni, Nicola and Charlin, Laurent and Lodi, Andrea}, booktitle={Advances in Neural Information Processing Systems 32}, year={2019} } The exact features have been modified compared to the original implementation. This function is used mainly in the machine learning community for MIP. A user can only call it during the solving process, when there is an LP object. This means calling it from some user defined plugin on the Python side. An example plugin is a branching rule or an event handler, which is exclusively created to call this function. The user must then make certain to return the appropriate SCIP_RESULT (e.g. DIDNOTRUN) :param prev_col_features: The list of column features previously returned by this function :param prev_edge_features: The list of edge features previously returned by this function :param prev_row_features: The list of row features previously returned by this function :param static_only: Whether exclusively static features should be generated :param suppress_warnings: Whether warnings should be suppressed
Definition at line 5702 of file scip.pxi.
References Model._scip, SCIPcolGetAge(), SCIPcolGetBasisStatus(), SCIPcolGetLb(), SCIPcolGetLPPos(), SCIPcolGetObj(), SCIPcolGetPrimsol(), SCIPcolGetUb(), SCIPcolGetVar(), SCIPfeasFrac(), SCIPgetBestSol(), SCIPgetColRedcost(), SCIPgetLPCols(), SCIPgetLPRows(), SCIPgetNLPCols(), SCIPgetNLPRows(), SCIPgetRowLPActivity(), SCIPgetRowObjParallelism(), SCIPgetSolVal(), SCIPgetStage(), SCIPisEQ(), SCIPisInfinity(), SCIProwGetAge(), SCIProwGetBasisStatus(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetDualsol(), SCIProwGetLhs(), SCIProwGetNLPNonz(), SCIProwGetNorm(), SCIProwGetRhs(), SCIProwGetVals(), SCIPvarGetAvgSol(), and SCIPvarGetType().
def getBranchScoreMultiple | ( | self, | |
Variable, | |||
var, | |||
gains | |||
) |
Calculates the branching score out of the gain predictions for a branching with arbitrary many children. :param Variable var: variable to calculate the score for :param gains: list of gains for each child.
Definition at line 5675 of file scip.pxi.
References Model._scip, and SCIPgetBranchScoreMultiple().
def getColRedCost | ( | self, | |
Column, | |||
col | |||
) |
gets the reduced cost of the column in the current LP :param Column col: the column of the LP for which the reduced cost will be retrieved
Definition at line 1983 of file scip.pxi.
References Model._scip, and SCIPgetColRedcost().
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 1294 of file scip.pxi.
References Model._scip, SCIPgetLPI(), and SCIPlpiGetRealSolQuality().
def getConsNVars | ( | self, | |
Constraint, | |||
constraint | |||
) |
Gets number of variables in a constraint. :param constraint: Constraint to get the number of variables from.
Definition at line 2599 of file scip.pxi.
References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetConsNVars().
def getConss | ( | self, | |
transformed = True |
|||
) |
Retrieve all constraints. :param transformed: get transformed variables instead of original (Default value = True)
Definition at line 3414 of file scip.pxi.
References Model._scip, SCIPgetConss(), SCIPgetNConss(), SCIPgetNOrigConss(), and SCIPgetOrigConss().
def getConsVars | ( | self, | |
Constraint, | |||
constraint | |||
) |
Gets variables in a constraint. :param constraint: Constraint to get the variables from.
Definition at line 2617 of file scip.pxi.
References Model._modelvars, Model._scip, SCIPgetConsNVars(), and SCIPgetConsVars().
def getCurrentNode | ( | self | ) |
Retrieve current node.
Definition at line 1218 of file scip.pxi.
References Model._scip, and 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 2083 of file scip.pxi.
References Model._scip, and SCIPgetCutEfficacy().
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 2091 of file scip.pxi.
References Model._scip, and SCIPgetCutLPSolCutoffDistance().
def getDepth | ( | self | ) |
Retrieve the depth of the current node
Definition at line 1226 of file scip.pxi.
References Model._scip, and SCIPgetDepth().
def getDualbound | ( | self | ) |
Retrieve the best dual bound.
Definition at line 4977 of file scip.pxi.
References Model._scip, and SCIPgetDualbound().
def getDualboundRoot | ( | self | ) |
Retrieve the best root dual bound.
Definition at line 4981 of file scip.pxi.
References Model._scip, and SCIPgetDualboundRoot().
def getDualfarkasLinear | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve the dual farkas value to a linear constraint. :param Constraint cons: linear constraint
Definition at line 3513 of file scip.pxi.
References Model._scip, Model.getTransformedCons(), and SCIPgetDualfarkasLinear().
def getDualMultiplier | ( | self, | |
Constraint, | |||
cons | |||
) |
DEPRECATED: Retrieve the dual solution to a linear constraint. :param Constraint cons: linear constraint
Definition at line 3504 of file scip.pxi.
References Model.getDualsolLinear().
def getDualsolLinear | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve the dual solution to a linear constraint. :param Constraint cons: linear constraint
Definition at line 3489 of file scip.pxi.
References Model._scip, Model.getTransformedCons(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetDualsolLinear().
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 3541 of file scip.pxi.
References Model._scip, and SCIPgetDualSolVal().
def getGap | ( | self | ) |
Retrieve the gap, i.e. |(primalbound - dualbound)/min(|primalbound|,|dualbound|)|.
Definition at line 1222 of file scip.pxi.
References Model._scip, and SCIPgetGap().
def getLhs | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve left hand side value of a constraint. :param Constraint cons: linear or quadratic constraint
Definition at line 3156 of file scip.pxi.
References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetLhsLinear(), and SCIPgetLhsNonlinear().
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 1434 of file scip.pxi.
References Model._scip, SCIPgetLocalOrigEstimate(), and SCIPgetLocalTransEstimate().
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 1940 of file scip.pxi.
References Model._scip, SCIPgetLPBasisInd(), and SCIPgetNLPRows().
def getLPBInvARow | ( | self, | |
row | |||
) |
gets a row from B^-1 * A
Definition at line 1961 of file scip.pxi.
References Model._scip, SCIPgetLPBInvARow(), and SCIPgetNLPCols().
def getLPBInvRow | ( | self, | |
row | |||
) |
gets a row from the inverse basis matrix B^-1
Definition at line 1950 of file scip.pxi.
References Model._scip, 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 4235 of file scip.pxi.
References Model._scip, and SCIPgetLPBranchCands().
def getLPColsData | ( | self | ) |
Retrieve current LP columns
Definition at line 1916 of file scip.pxi.
References Model._scip, and SCIPgetLPColsData().
def getLPObjVal | ( | self | ) |
gets objective value of current LP (which is the sum of column and loose objective value)
Definition at line 1911 of file scip.pxi.
References Model._scip, and SCIPgetLPObjval().
def getLPRowsData | ( | self | ) |
Retrieve current LP rows
Definition at line 1924 of file scip.pxi.
References Model._scip, and SCIPgetLPRowsData().
def getLPSolstat | ( | self | ) |
Gets solution status of current LP
Definition at line 1895 of file scip.pxi.
References Model._scip, and SCIPgetLPSolstat().
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 4841 of file scip.pxi.
References Model._scip, and SCIPgetNBestSolsFound().
def getNBinVars | ( | self | ) |
gets number of binary active problem variables
Definition at line 1819 of file scip.pxi.
References Model._scip, and SCIPgetNBinVars().
def getNChildren | ( | self | ) |
gets number of children of focus node.
Definition at line 1210 of file scip.pxi.
References Model._scip, and SCIPgetNChildren().
def getNConss | ( | self, | |
transformed = True |
|||
) |
Retrieve number of all constraints
Definition at line 3431 of file scip.pxi.
References Model._scip, SCIPgetNConss(), and SCIPgetNOrigConss().
def getNCountedSols | ( | self | ) |
Get number of feasible solution.
Definition at line 5510 of file scip.pxi.
References Model._scip, and SCIPgetNCountedSols().
def getNCuts | ( | self | ) |
Retrieve total number of cuts in storage
Definition at line 2101 of file scip.pxi.
References Model._scip, and SCIPgetNCuts().
def getNCutsApplied | ( | self | ) |
Retrieve number of currently applied cuts
Definition at line 2105 of file scip.pxi.
References Model._scip, and SCIPgetNCutsApplied().
def getNFeasibleLeaves | ( | self | ) |
Retrieve number of leaf nodes processed with feasible relaxation solution.
Definition at line 1198 of file scip.pxi.
References Model._scip, and SCIPgetNFeasibleLeaves().
def getNInfeasibleLeaves | ( | self | ) |
gets number of infeasible leaf nodes processed.
Definition at line 1202 of file scip.pxi.
References Model._scip, and SCIPgetNInfeasibleLeaves().
def getNIntVars | ( | self | ) |
gets number of integer active problem variables
Definition at line 1815 of file scip.pxi.
References Model._scip, and SCIPgetNIntVars().
def getNLeaves | ( | self | ) |
gets number of leaves in the tree.
Definition at line 1206 of file scip.pxi.
References Model._scip, and SCIPgetNLeaves().
def getNLimSolsFound | ( | self | ) |
gets number of feasible primal solutions respecting the objective limit found so far
Definition at line 4837 of file scip.pxi.
References Model._scip, and SCIPgetNLimSolsFound().
def getNLPCols | ( | self | ) |
Retrieve the number of cols currently in the LP
Definition at line 1936 of file scip.pxi.
References Model._scip, and SCIPgetNLPCols().
def getNLPIterations | ( | self | ) |
Retrieve the total number of LP iterations so far.
Definition at line 1186 of file scip.pxi.
References Model._scip, and SCIPgetNLPIterations().
def getNLPRows | ( | self | ) |
Retrieve the number of rows currently in the LP
Definition at line 1932 of file scip.pxi.
References Model._scip, and SCIPgetNLPRows().
def getNLPs | ( | self | ) |
gets total number of LPs solved so far
Definition at line 5246 of file scip.pxi.
References Model._scip, and SCIPgetNLPs().
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 3325 of file scip.pxi.
References Model._scip, and SCIPgetNlRowActivityBounds().
def getNlRows | ( | self | ) |
returns a list with the nonlinear rows in SCIP's internal NLP
Definition at line 3292 of file scip.pxi.
References Model._scip, Model.getNNlRows(), and SCIPgetNLPNlRows().
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 3299 of file scip.pxi.
References Model._scip, and SCIPgetNlRowSolActivity().
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 3312 of file scip.pxi.
References Model._scip, and SCIPgetNlRowSolFeasibility().
def getNNlRows | ( | self | ) |
gets current number of nonlinear rows in SCIP's internal NLP
Definition at line 3288 of file scip.pxi.
References Model._scip, and SCIPgetNNLPNlRows().
def getNNodes | ( | self | ) |
gets number of processed nodes in current run, including the focus node.
Definition at line 1190 of file scip.pxi.
References Model._scip, and SCIPgetNNodes().
def getNReaders | ( | self | ) |
Get number of currently available readers.
Definition at line 5506 of file scip.pxi.
References Model._scip, and SCIPgetNReaders().
def getNSepaRounds | ( | self | ) |
Retrieve the number of separation rounds that have been performed at the current node
Definition at line 2109 of file scip.pxi.
References Model._scip, and SCIPgetNSepaRounds().
def getNSiblings | ( | self | ) |
gets number of siblings of focus node.
Definition at line 1214 of file scip.pxi.
References Model._scip, and SCIPgetNSiblings().
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 4826 of file scip.pxi.
References Model._scip, and SCIPgetNSols().
def getNSolsFound | ( | self | ) |
gets number of feasible primal solutions found so far
Definition at line 4833 of file scip.pxi.
References Model._scip, and SCIPgetNSolsFound().
def getNTotalNodes | ( | self | ) |
gets number of processed nodes in all runs, including the focus node.
Definition at line 1194 of file scip.pxi.
References Model._scip, and SCIPgetNTotalNodes().
def getNVars | ( | self, | |
transformed = True |
|||
) |
Retrieve number of variables in the problems. :param transformed: get transformed variables instead of original (Default value = True)
Definition at line 1805 of file scip.pxi.
References Model._scip, SCIPgetNOrigVars(), and SCIPgetNVars().
def getObjective | ( | self | ) |
Retrieve objective function as Expr
Definition at line 1390 of file scip.pxi.
References Model.getVars().
def getObjectiveSense | ( | self | ) |
Retrieve objective sense.
Definition at line 5053 of file scip.pxi.
References Model._scip, and SCIPgetObjsense().
def getObjlimit | ( | self | ) |
returns current limit on objective function.
Definition at line 1341 of file scip.pxi.
References Model._scip, and SCIPgetObjlimit().
def getObjoffset | ( | self, | |
original = True |
|||
) |
Retrieve constant objective offset :param original: offset of original or transformed problem (Default value = True)
Definition at line 1413 of file scip.pxi.
References Model._scip, SCIPgetOrigObjoffset(), and SCIPgetTransObjoffset().
def getObjVal | ( | self, | |
original = True |
|||
) |
Retrieve the objective value of value of best solution. :param original: objective value in original space (Default value = True)
Definition at line 4890 of file scip.pxi.
References Model._bestSol, Model._scip, Model.getSolObjVal(), Model.getStage(), SCIPgetNSols(), and SCIPsolIsOriginal().
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 1869 of file scip.pxi.
References Model._scip, and SCIPgetOpenNodesData().
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 5375 of file scip.pxi.
References Model._scip, SCIPgetParam(), and pyscipopt.scip.str_conversion.
def getParams | ( | self | ) |
Gets the values of all parameters as a dict mapping parameter names to their values.
Definition at line 5404 of file scip.pxi.
References Model._scip, Model.getParam(), SCIPgetNParams(), and SCIPgetParams().
def getPresolvingTime | ( | self | ) |
Retrieve the curernt presolving time in seconds
Definition at line 1182 of file scip.pxi.
References Model._scip, and SCIPgetPresolvingTime().
def getPrimalbound | ( | self | ) |
Retrieve the best primal bound.
Definition at line 4973 of file scip.pxi.
References Model._scip, and SCIPgetPrimalbound().
def getPrimalRay | ( | self | ) |
Gets primal ray causing unboundedness of the LP relaxation
Definition at line 4958 of file scip.pxi.
References Model._scip, SCIPgetNVars(), SCIPgetPrimalRayVal(), SCIPgetVars(), and SCIPhasPrimalRay().
def getPrimalRayVal | ( | self, | |
Variable, | |||
var | |||
) |
Gets value of given variable in primal ray causing unboundedness of the LP relaxation
Definition at line 4950 of file scip.pxi.
References Model._scip, SCIPgetPrimalRayVal(), and SCIPhasPrimalRay().
def getProbingDepth | ( | self | ) |
returns the current probing depth
Definition at line 4446 of file scip.pxi.
References Model._scip, and SCIPgetProbingDepth().
def getProbName | ( | self | ) |
Retrieve problem name
Definition at line 1166 of file scip.pxi.
References Model._scip, and SCIPgetProbName().
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 4267 of file scip.pxi.
References Model._scip, and SCIPgetPseudoBranchCands().
def getReadingTime | ( | self | ) |
Retrieve the current reading time in seconds
Definition at line 1178 of file scip.pxi.
References Model._scip, and SCIPgetReadingTime().
def getRhs | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve right hand side value of a constraint. :param Constraint cons: linear or quadratic constraint
Definition at line 3142 of file scip.pxi.
References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetRhsLinear(), and SCIPgetRhsNonlinear().
def getRowActivity | ( | self, | |
Row, | |||
row | |||
) |
returns the activity of a row in the last LP or pseudo solution
Definition at line 2028 of file scip.pxi.
References Model._scip, and SCIPgetRowActivity().
def getRowDualSol | ( | self, | |
Row, | |||
row | |||
) |
Gets the dual LP solution of a row
Definition at line 2074 of file scip.pxi.
References SCIProwGetDualsol().
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 3475 of file scip.pxi.
References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPgetRowLinear().
def getRowLPActivity | ( | self, | |
Row, | |||
row | |||
) |
returns the activity of a row in the last LP solution
Definition at line 2032 of file scip.pxi.
References Model._scip, and SCIPgetRowLPActivity().
def getRowNumIntCols | ( | self, | |
Row, | |||
row | |||
) |
Returns number of intergal columns in the row
Definition at line 2060 of file scip.pxi.
References Model._scip, and SCIPgetRowNumIntCols().
def getRowObjParallelism | ( | self, | |
Row, | |||
row | |||
) |
Returns 1 if the row is parallel, and 0 if orthogonal
Definition at line 2064 of file scip.pxi.
References Model._scip, and SCIPgetRowObjParallelism().
def getRowParallelism | ( | self, | |
Row, | |||
row1, | |||
Row, | |||
row2, | |||
orthofunc = 101 |
|||
) |
Returns the degree of parallelism between hyplerplanes. 1 if perfectly parallel, 0 if orthogonal. For two row vectors v, w the parallelism is calculated as: |v*w|/(|v|*|w|). 101 in this case is an 'e' (euclidean) in ASCII. The other acceptable input is 100 (d for discrete).
Definition at line 2068 of file scip.pxi.
References SCIProwGetParallelism().
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 3234 of file scip.pxi.
References Model._scip, Model.getStage(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetActivityLinear(), SCIPgetLhsLinear(), and SCIPgetRhsLinear().
def getSlackVarIndicator | ( | self, | |
Constraint, | |||
cons | |||
) |
Get slack variable of an indicator constraint. :param Constraint cons: indicator constraint
Definition at line 3012 of file scip.pxi.
References SCIPgetSlackVarIndicator().
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 4863 of file scip.pxi.
References Model._scip, SCIPgetSolOrigObj(), and SCIPgetSolTransObj().
def getSols | ( | self | ) |
Retrieve list of all feasible primal solutions stored in the solution storage.
Definition at line 4845 of file scip.pxi.
References Model._scip, SCIPgetNSols(), and SCIPgetSols().
def getSolTime | ( | self, | |
Solution, | |||
sol | |||
) |
Get clock time, when this solution was found. :param Solution sol: solution
Definition at line 4882 of file scip.pxi.
References Model._scip, and SCIPgetSolTime().
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 4912 of file scip.pxi.
References Model._scip, and SCIPgetSolVal().
def getSolvingTime | ( | self | ) |
Retrieve the current solving time in seconds
Definition at line 1174 of file scip.pxi.
References Model._scip, and SCIPgetSolvingTime().
def getStage | ( | self | ) |
Retrieve current SCIP stage
Definition at line 4998 of file scip.pxi.
References Model._scip, and SCIPgetStage().
def getStageName | ( | self | ) |
Returns name of current stage as string
Definition at line 5002 of file scip.pxi.
References Model._getStageNames(), and Model.getStage().
def getStatus | ( | self | ) |
Retrieve solution status.
Definition at line 5015 of file scip.pxi.
References Model._scip, and SCIPgetStatus().
def getTermsQuadratic | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve bilinear, quadratic, and linear terms of a quadratic constraint. :param Constraint cons: constraint
Definition at line 3347 of file scip.pxi.
References Model.checkQuadraticNonlinear(), SCIPexprGetQuadraticBilinTerm(), SCIPexprGetQuadraticData(), SCIPexprGetQuadraticQuadTerm(), SCIPgetExprNonlinear(), and SCIPgetVarExprVar().
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 1170 of file scip.pxi.
References Model._scip, and SCIPgetTotalTime().
def getTransformedCons | ( | self, | |
Constraint, | |||
cons | |||
) |
Retrieve transformed constraint. :param Constraint cons: constraint
Definition at line 3274 of file scip.pxi.
References Model._scip, and SCIPgetTransformedCons().
def getTransformedVar | ( | self, | |
Variable, | |||
var | |||
) |
Retrieve the transformed variable. :param Variable var: original variable to get the transformed of
Definition at line 1574 of file scip.pxi.
References Model._scip, and SCIPgetTransformedVar().
def getTreesizeEstimation | ( | self | ) |
Get an estimation of the final tree size
Definition at line 5697 of file scip.pxi.
References Model._scip.
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 4929 of file scip.pxi.
References Model._bestSol, Model._scip, Model.getSolVal(), Model.getStage(), and SCIPgetStage().
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 3454 of file scip.pxi.
References Model._scip, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetNVarsLinear(), SCIPgetValsLinear(), SCIPgetVarsLinear(), and SCIPvarGetName().
def getVarDict | ( | self | ) |
gets dictionary with variables names as keys and current variable values as items
Definition at line 1823 of file scip.pxi.
References Model.getVal(), and Model.getVars().
def getVarLbDive | ( | self, | |
Variable, | |||
var | |||
) |
returns variable's current lb in current dive
Definition at line 4381 of file scip.pxi.
References Model._scip, and 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 3526 of file scip.pxi.
References Model._scip, 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 1772 of file scip.pxi.
References Model._modelvars, Model._scip, SCIPgetNOrigVars(), SCIPgetNVars(), SCIPgetOrigVars(), and SCIPgetVars().
def getVarStrongbranch | ( | self, | |
Variable, | |||
var, | |||
itlim, | |||
idempotent = False , |
|||
integral = False |
|||
) |
Strong branches and gets information on column variable. :param Variable var: Variable to get strong branching information on :param itlim: LP iteration limit for total strong branching calls :param idempotent: Should SCIP's state remain the same after the call? :param integral: Boolean on whether the variable is currently integer.
Definition at line 5633 of file scip.pxi.
References Model._scip, SCIPgetVarStrongbranchFrac(), and SCIPgetVarStrongbranchInt().
def getVarStrongbranchLast | ( | self, | |
Variable, | |||
var | |||
) |
Get the results of the last strong branching call on this variable (potentially was called at another node). down - The dual bound of the LP after branching down on the variable up - The dual bound of the LP after branchign up on the variable downvalid - Whether down stores a valid dual bound or is NULL upvalid - Whether up stores a valid dual bound or is NULL solval - The solution value of the variable at the last strong branching call lpobjval - The LP objective value at the time of the last strong branching call :param Variable var: variable to get the previous strong branching information from
Definition at line 5597 of file scip.pxi.
References Model._scip, and SCIPgetVarStrongbranchLast().
def getVarStrongbranchNode | ( | self, | |
Variable, | |||
var | |||
) |
Get the node number from the last time strong branching was called on the variable :param Variable var: variable to get the previous strong branching node from
Definition at line 5622 of file scip.pxi.
References Model._scip, and SCIPgetVarStrongbranchNode().
def getVarUbDive | ( | self, | |
Variable, | |||
var | |||
) |
returns variable's current ub in current dive
Definition at line 4385 of file scip.pxi.
References Model._scip, and SCIPgetVarUbDive().
def hasPrimalRay | ( | self | ) |
Returns whether a primal ray is stored that proves unboundedness of the LP relaxation
Definition at line 4944 of file scip.pxi.
References Model._scip, and SCIPhasPrimalRay().
def hideOutput | ( | self, | |
quiet = True |
|||
) |
Hide the output. :param quiet: hide output? (Default value = True)
Definition at line 5252 of file scip.pxi.
References Model._scip, and 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 4174 of file scip.pxi.
References Model._scip, SCIPfindBenders(), SCIPincludeBenders(), and pyscipopt.scip.str_conversion.
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 4204 of file scip.pxi.
References Model._scip, SCIPfindBenderscut(), SCIPincludeBenderscut(), and pyscipopt.scip.str_conversion.
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 3861 of file scip.pxi.
References Model._scip.
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 4133 of file scip.pxi.
References Model._scip, SCIPincludeBranchrule(), and pyscipopt.scip.str_conversion.
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 3916 of file scip.pxi.
References Model._scip, SCIPincludeConshdlr(), and pyscipopt.scip.str_conversion.
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 4115 of file scip.pxi.
References Model._scip, SCIPincludeCutsel(), and pyscipopt.scip.str_conversion.
def includeDefaultPlugins | ( | self | ) |
Includes all default plug-ins into SCIP
Definition at line 1118 of file scip.pxi.
References Model._scip.
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 3870 of file scip.pxi.
References Model._scip, SCIPincludeEventhdlr(), and pyscipopt.scip.str_conversion.
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 4067 of file scip.pxi.
References Model._scip, SCIPincludeHeur(), and pyscipopt.scip.str_conversion.
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 4154 of file scip.pxi.
References Model._scip, SCIPincludeNodesel(), and pyscipopt.scip.str_conversion.
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 3982 of file scip.pxi.
References Model._scip, SCIPincludePresol(), and pyscipopt.scip.str_conversion.
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 3894 of file scip.pxi.
References Model._scip, SCIPactivatePricer(), SCIPfindPricer(), SCIPincludePricer(), and pyscipopt.scip.str_conversion.
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 4039 of file scip.pxi.
References Model._scip, SCIPincludeProp(), and pyscipopt.scip.str_conversion.
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 4021 of file scip.pxi.
References Model._scip, SCIPincludeReader(), and pyscipopt.scip.str_conversion.
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 4096 of file scip.pxi.
References Model._scip, SCIPincludeRelax(), and pyscipopt.scip.str_conversion.
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 4000 of file scip.pxi.
References Model._scip, SCIPincludeSepa(), and pyscipopt.scip.str_conversion.
def infinity | ( | self | ) |
Retrieve SCIP's infinity value
Definition at line 1230 of file scip.pxi.
References Model._scip, and 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 3579 of file scip.pxi.
References Model._scip, 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 4482 of file scip.pxi.
References Model._scip, and SCIPinProbing().
def inRepropagation | ( | self | ) |
returns if the current node is already solved and only propagated again.
Definition at line 4419 of file scip.pxi.
References Model._scip, and SCIPinRepropagation().
def interruptSolve | ( | self | ) |
Interrupt the solving process as soon as possible.
Definition at line 4528 of file scip.pxi.
References Model._scip, and 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 2087 of file scip.pxi.
References Model._scip, and SCIPisCutEfficacious().
def isEQ | ( | self, | |
val1, | |||
val2 | |||
) |
checks, if values are in range of epsilon
Definition at line 1270 of file scip.pxi.
References Model._scip, and SCIPisEQ().
def isFeasEQ | ( | self, | |
val1, | |||
val2 | |||
) |
checks, if relative difference of values is in range of feasibility tolerance
Definition at line 1274 of file scip.pxi.
References Model._scip, and SCIPisFeasEQ().
def isFeasIntegral | ( | self, | |
value | |||
) |
returns whether value is integral within the LP feasibility bounds
Definition at line 1266 of file scip.pxi.
References Model._scip, and SCIPisFeasIntegral().
def isFeasNegative | ( | self, | |
value | |||
) |
returns whether value < -feastol
Definition at line 1262 of file scip.pxi.
References Model._scip, and SCIPisFeasNegative().
def isFeasZero | ( | self, | |
value | |||
) |
returns whether abs(value) < feastol
Definition at line 1254 of file scip.pxi.
References Model._scip, and SCIPisFeasZero().
def isGE | ( | self, | |
val1, | |||
val2 | |||
) |
returns whether val1 >= val2 - eps
Definition at line 1286 of file scip.pxi.
References Model._scip, and SCIPisGE().
def isGT | ( | self, | |
val1, | |||
val2 | |||
) |
returns whether val1 > val2 + eps
Definition at line 1290 of file scip.pxi.
References Model._scip, and SCIPisGT().
def isInfinity | ( | self, | |
value | |||
) |
returns whether value is SCIP's infinity
Definition at line 1258 of file scip.pxi.
References Model._scip, and SCIPisInfinity().
def isLE | ( | self, | |
val1, | |||
val2 | |||
) |
returns whether val1 <= val2 + eps
Definition at line 1278 of file scip.pxi.
References Model._scip, and SCIPisLE().
def isLPSolBasic | ( | self | ) |
returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
Definition at line 1972 of file scip.pxi.
References Model._scip, and SCIPisLPSolBasic().
def isLT | ( | self, | |
val1, | |||
val2 | |||
) |
returns whether val1 < val2 - eps
Definition at line 1282 of file scip.pxi.
References Model._scip, and SCIPisLT().
def isNLPConstructed | ( | self | ) |
returns whether SCIP's internal NLP has been constructed
Definition at line 3284 of file scip.pxi.
References Model._scip, and SCIPisNLPConstructed().
def isObjChangedProbing | ( | self | ) |
returns whether the objective function has changed during probing mode
Definition at line 4478 of file scip.pxi.
References Model._scip, and SCIPisObjChangedProbing().
def isZero | ( | self, | |
value | |||
) |
returns whether abs(value) < eps
Definition at line 1250 of file scip.pxi.
References Model._scip, and SCIPisZero().
def lpiGetIterations | ( | self | ) |
Get the iteration count of the last solved LP
Definition at line 1314 of file scip.pxi.
References Model._scip, SCIPgetLPI(), and SCIPlpiGetIterations().
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 4434 of file scip.pxi.
References Model._scip, and SCIPnewProbingNode().
def optimize | ( | self | ) |
Optimize the problem.
Definition at line 3558 of file scip.pxi.
References Model._bestSol, Model._scip, SCIPgetBestSol(), and SCIPsolve().
def presolve | ( | self | ) |
Presolve the problem.
Definition at line 3573 of file scip.pxi.
References Model._bestSol, Model._scip, SCIPgetBestSol(), and SCIPpresolve().
def printBestSol | ( | self, | |
write_zeros = False |
|||
) |
Prints the best feasible primal solution.
Definition at line 4604 of file scip.pxi.
References Model._scip, and SCIPprintBestSol().
def printCons | ( | self, | |
Constraint, | |||
constraint | |||
) |
Definition at line 2645 of file scip.pxi.
References Model._scip, and SCIPprintCons().
def printExternalCodeVersions | ( | self | ) |
Print external code versions, e.g. symmetry, non-linear solver, lp solver
Definition at line 1157 of file scip.pxi.
References Model._scip, and SCIPprintExternalCodes().
def printNlRow | ( | self, | |
NLRow, | |||
nlrow | |||
) |
prints nonlinear row
Definition at line 3333 of file scip.pxi.
References Model._scip, and SCIPprintNlRow().
def printRow | ( | self, | |
Row, | |||
row, | |||
not, | |||
None | |||
) |
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 4613 of file scip.pxi.
References Model._scip, and SCIPprintSol().
def printStatistics | ( | self | ) |
Print statistics.
Definition at line 5129 of file scip.pxi.
References Model._scip, and SCIPprintStatistics().
def printVersion | ( | self | ) |
Print version, copyright information and compile mode
Definition at line 1148 of file scip.pxi.
References Model._scip, and SCIPprintVersion().
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 4512 of file scip.pxi.
References Model._scip, and SCIPpropagateProbing().
def readParams | ( | self, | |
file | |||
) |
Read an external parameter file. :param file: file to be read
Definition at line 5424 of file scip.pxi.
References Model._scip, SCIPreadParams(), and pyscipopt.scip.str_conversion.
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 5481 of file scip.pxi.
References Model._scip, SCIPreadProb(), and pyscipopt.scip.str_conversion.
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 4708 of file scip.pxi.
References Model._scip, SCIPreadSol(), and pyscipopt.scip.str_conversion.
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 4722 of file scip.pxi.
References Model._scip, Model.createSol(), SCIPreadSolFile(), and pyscipopt.scip.str_conversion.
def readStatistics | ( | self, | |
filename | |||
) |
def redirectOutput | ( | self | ) |
Send output to python instead of terminal.
Definition at line 5262 of file scip.pxi.
References Model._scip, and SCIPsetMessagehdlr().
def relax | ( | self | ) |
Relaxes the integrality restrictions of the model
Definition at line 1840 of file scip.pxi.
References Model.chgVarType(), Model.getStage(), and Model.getVars().
def releaseRow | ( | self, | |
Row, | |||
row, | |||
not, | |||
None | |||
) |
decreases usage counter of LP row, and frees memory if necessary
Definition at line 2037 of file scip.pxi.
References Model._scip, and SCIPreleaseRow().
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 1889 of file scip.pxi.
References Model._scip, and SCIPrepropagateNode().
def resetParam | ( | self, | |
name | |||
) |
Reset parameter setting to its default value :param name: parameter to reset
Definition at line 5459 of file scip.pxi.
References Model._scip, SCIPresetParam(), and pyscipopt.scip.str_conversion.
def resetParams | ( | self | ) |
Reset parameter settings to their default values
Definition at line 5468 of file scip.pxi.
References Model._scip, and SCIPresetParams().
def restartSolve | ( | self | ) |
Restarts the solving process as soon as possible.
Definition at line 4532 of file scip.pxi.
References Model._scip, and SCIPrestartSolve().
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 2114 of file scip.pxi.
References Model._scip, pyscipopt.expr.expr_to_nodes(), SCIPaddExprNonlinear(), SCIPaddLinearVarNonlinear(), SCIPcreateConsLinear(), SCIPcreateConsNonlinear(), SCIPcreateConsQuadraticNonlinear(), SCIPcreateExprAbs(), SCIPcreateExprCos(), SCIPcreateExprExp(), SCIPcreateExprLog(), SCIPcreateExprMonomial(), SCIPcreateExprPow(), SCIPcreateExprProduct(), SCIPcreateExprSin(), SCIPcreateExprSum(), SCIPcreateExprValue(), SCIPcreateExprVar(), SCIPreleaseExpr(), SCIPseparateSol(), and pyscipopt.scip.str_conversion.
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 3697 of file scip.pxi.
References SCIPbendersSetSubproblemIsConvex().
def setBoolParam | ( | self, | |
name, | |||
value | |||
) |
Set a boolean-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5283 of file scip.pxi.
References Model._scip, SCIPsetBoolParam(), and pyscipopt.scip.str_conversion.
def setCharParam | ( | self, | |
name, | |||
value | |||
) |
Set a char-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5323 of file scip.pxi.
References Model._scip, SCIPsetCharParam(), and pyscipopt.scip.str_conversion.
def setCheck | ( | self, | |
Constraint, | |||
cons, | |||
newCheck | |||
) |
Set "check" flag of a constraint. Keyword arguments: cons -- constraint newCheck -- new check value
Definition at line 3095 of file scip.pxi.
References Model._scip, and 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 5472 of file scip.pxi.
References Model._scip, and SCIPsetEmphasis().
def setEnforced | ( | self, | |
Constraint, | |||
cons, | |||
newEnf | |||
) |
Set "enforced" flag of a constraint. Keyword arguments: cons -- constraint newEnf -- new enforced value
Definition at line 3086 of file scip.pxi.
References Model._scip, and SCIPsetConsEnforced().
def setHeuristics | ( | self, | |
setting | |||
) |
Set heuristics parameter settings. :param setting: the parameter setting (SCIP_PARAMSETTING)
Definition at line 1466 of file scip.pxi.
References Model._scip, and SCIPsetHeuristics().
def setInitial | ( | self, | |
Constraint, | |||
cons, | |||
newInit | |||
) |
Set "initial" flag of a constraint. Keyword arguments: cons -- constraint newInit -- new initial value
Definition at line 3068 of file scip.pxi.
References Model._scip, and SCIPsetConsInitial().
def setIntParam | ( | self, | |
name, | |||
value | |||
) |
Set an int-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5293 of file scip.pxi.
References Model._scip, SCIPsetIntParam(), and pyscipopt.scip.str_conversion.
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 5271 of file scip.pxi.
References Model._scip, SCIPsetMessagehdlrLogfile(), and pyscipopt.scip.str_conversion.
def setLongintParam | ( | self, | |
name, | |||
value | |||
) |
Set a long-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5303 of file scip.pxi.
References Model._scip, SCIPsetLongintParam(), and pyscipopt.scip.str_conversion.
def setMaximize | ( | self | ) |
Set the objective sense to maximization.
Definition at line 1328 of file scip.pxi.
References Model._scip, and SCIPsetObjsense().
def setMinimize | ( | self | ) |
Set the objective sense to minimization.
Definition at line 1324 of file scip.pxi.
References Model._scip, and SCIPsetObjsense().
def setObjective | ( | self, | |
expr, | |||
sense = 'minimize' , |
|||
clear = 'true' |
|||
) |
Establish the objective function as a linear expression. :param expr: the objective function SCIP Expr, or constant value :param sense: the objective sense (Default value = 'minimize') :param clear: set all other variables objective coefficient to zero (Default value = 'true')
Definition at line 1345 of file scip.pxi.
References Model._scip, Model.addObjoffset(), Model.getObjoffset(), SCIPchgVarObj(), SCIPgetNOrigVars(), SCIPgetOrigVars(), Model.setMaximize(), and Model.setMinimize().
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 1424 of file scip.pxi.
References Model._scip, and SCIPsetObjIntegral().
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 1332 of file scip.pxi.
References Model._scip, and 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 5344 of file scip.pxi.
References Model._scip, SCIPgetParam(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetRealParam(), SCIPsetStringParam(), and pyscipopt.scip.str_conversion.
def setParams | ( | self, | |
params | |||
) |
Sets multiple parameters at once. :param params: dict mapping parameter names to their values.
Definition at line 5416 of file scip.pxi.
References Model.setParam().
def setParamsCountsols | ( | self | ) |
Sets SCIP parameters such that a valid counting process is possible.
Definition at line 5520 of file scip.pxi.
References Model._scip, and SCIPsetParamsCountsols().
def setPresolve | ( | self, | |
setting | |||
) |
Set presolving parameter settings. :param setting: the parameter settings (SCIP_PARAMSETTING)
Definition at line 1445 of file scip.pxi.
References Model._scip, and SCIPsetPresolving().
def setProbName | ( | self, | |
name | |||
) |
Set problem name
Definition at line 1453 of file scip.pxi.
References Model._scip, SCIPsetProbName(), and pyscipopt.scip.str_conversion.
def setRealParam | ( | self, | |
name, | |||
value | |||
) |
Set a real-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5313 of file scip.pxi.
References Model._scip, SCIPsetRealParam(), and pyscipopt.scip.str_conversion.
def setRelaxSolVal | ( | self, | |
Variable, | |||
var, | |||
val | |||
) |
sets the value of the given variable in the global relaxation solution
Definition at line 3410 of file scip.pxi.
References Model._scip, and SCIPsetRelaxSolVal().
def setRemovable | ( | self, | |
Constraint, | |||
cons, | |||
newRem | |||
) |
Set "removable" flag of a constraint. Keyword arguments: cons -- constraint newRem -- new removable value
Definition at line 3077 of file scip.pxi.
References Model._scip, and SCIPsetConsRemovable().
def setSeparating | ( | self, | |
setting | |||
) |
Set separating parameter settings. :param setting: the parameter settings (SCIP_PARAMSETTING)
Definition at line 1458 of file scip.pxi.
References Model._scip, and 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 4752 of file scip.pxi.
References Model._scip, and SCIPsetSolVal().
def setStringParam | ( | self, | |
name, | |||
value | |||
) |
Set a string-valued parameter. :param name: name of parameter :param value: value of parameter
Definition at line 5333 of file scip.pxi.
References Model._scip, SCIPsetStringParam(), and pyscipopt.scip.str_conversion.
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 3707 of file scip.pxi.
References Model._scip, SCIPfindBenders(), and SCIPsetupBendersSubproblem().
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 3734 of file scip.pxi.
References Model._scip, SCIPfindBenders(), and SCIPsolveBendersSubproblem().
def solveConcurrent | ( | self | ) |
Transforms, presolves, and solves problem using additional solvers which emphasize on finding solutions.
Definition at line 3563 of file scip.pxi.
References Model._bestSol, Model._scip, Model.optimize(), SCIPgetBestSol(), and SCIPsolveConcurrent().
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 4405 of file scip.pxi.
References Model._scip, and 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 4486 of file scip.pxi.
References Model._scip, and 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 4358 of file scip.pxi.
References Model._scip, and SCIPstartDive().
def startProbing | ( | self | ) |
Initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), SCIPsolveProbingLP(), etc available
Definition at line 4424 of file scip.pxi.
References Model._scip, and SCIPstartProbing().
def startStrongbranch | ( | self | ) |
Start strong branching. Needs to be called before any strong branching. Must also later end strong branching. TODO: Propagation option has currently been disabled via Python. If propagation is enabled then strong branching is not done on the LP, but on additionally created nodes (has some overhead)
Definition at line 5584 of file scip.pxi.
References Model._scip, and SCIPstartStrongbranch().
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 1621 of file scip.pxi.
References Model._scip, and 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 1669 of file scip.pxi.
References Model._scip, and 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 1637 of file scip.pxi.
References Model._scip, and 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 1653 of file scip.pxi.
References Model._scip, and SCIPtightenVarUbGlobal().
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 1105 of file scip.pxi.
References Model._freescip, and Model._scip.
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 4766 of file scip.pxi.
References Model._scip, 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 3660 of file scip.pxi.
References Model._scip, 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 1830 of file scip.pxi.
References Model._scip, and SCIPupdateNodeLowerbound().
def updateVarPseudocost | ( | self, | |
Variable, | |||
var, | |||
valdelta, | |||
objdelta, | |||
weight | |||
) |
Updates the pseudo costs of the given variable and the global pseudo costs after a change of valdelta in the variable's solution value and resulting change of objdelta in the LP's objective value. Update is ignored if objdelts is infinite. Weight is in range (0, 1], and affects how it updates the global weighted sum. :param Variable var: Variable whos pseudo cost will be updated :param valdelta: The change in variable value (e.g. the fractional amount removed or added by branching) :param objdelta: The change in objective value of the LP after valdelta change of the variable :param weight: the weight in range (0,1] of how the update affects the stored weighted sum.
Definition at line 5661 of file scip.pxi.
References Model._scip, and SCIPupdateVarPseudocost().
def version | ( | self | ) |
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 4631 of file scip.pxi.
References Model._scip, and SCIPprintBestSol().
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 4650 of file scip.pxi.
References Model._scip, and SCIPprintBestTransSol().
def writeLP | ( | self, | |
filename = "LP.lp" |
|||
) |
writes current LP to a file :param filename: file name (Default value = "LP.lp")
Definition at line 4538 of file scip.pxi.
References Model._scip, SCIPwriteLP(), and pyscipopt.scip.str_conversion.
def writeName | ( | self, | |
Variable, | |||
var | |||
) |
Write the name of the variable to the std out. :param Variable var: variable
Definition at line 4985 of file scip.pxi.
References Model._scip, and SCIPwriteVarName().
def writeParams | ( | self, | |
filename = 'param.set' , |
|||
comments = True , |
|||
onlychanged = True , |
|||
verbose = 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) :param verbose: indicates whether a success message should be printed
Definition at line 5439 of file scip.pxi.
References Model._scip, SCIPwriteParams(), and pyscipopt.scip.str_conversion.
def writeProblem | ( | self, | |
filename = 'model.cip' , |
|||
trans = False , |
|||
genericnames = False , |
|||
verbose = True |
|||
) |
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) :param verbose: indicates whether a success message should be printed
Definition at line 1484 of file scip.pxi.
References Model._scip, SCIPwriteOrigProblem(), SCIPwriteTransProblem(), and pyscipopt.scip.str_conversion.
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 4668 of file scip.pxi.
References Model._scip, and SCIPprintSol().
def writeStatistics | ( | self, | |
filename = "origprob.stats" |
|||
) |
Write statistics to a file. Keyword arguments: filename -- name of the output file
Definition at line 5138 of file scip.pxi.
References Model._scip, and SCIPprintStatistics().
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 4687 of file scip.pxi.
References Model._scip, and SCIPprintTransSol().