cons_knapsack.h File Reference Detailed DescriptionConstraint handler for knapsack constraints of the form , x binary and . This constraint handler handles a special type of linear constraints, namely knapsack constraints. A knapsack constraint has the form
with non-negative integer coefficients , integer right-hand side , and binary variables . Definition in file cons_knapsack.h. #include "scip/scip.h" Go to the source code of this file. Function Documentation
creates the handler for knapsack constraints and includes it in SCIP
Definition at line 13000 of file cons_knapsack.c. Referenced by SCIPincludeDefaultPlugins().
creates and captures a knapsack constraint
Definition at line 13130 of file cons_knapsack.c. References consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPconshdlrGetData(), SCIPcreateCons(), SCIPcreateConsBasicKnapsack(), SCIPerrorMessage, and SCIPfindConshdlr(). Referenced by createAndAddLinearCons(), createCapacityRestriction(), createNormalizedKnapsack(), and SCIPcreateConsBasicKnapsack().
creates and captures a knapsack constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsKnapsack(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
Definition at line 13198 of file cons_knapsack.c. References FALSE, NULL, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIPaddCoefKnapsack(), SCIPcreateConsKnapsack(), and TRUE. Referenced by SCIP_DECL_SOLVECUMULATIVE(), and SCIPcreateConsKnapsack().
adds new item to knapsack constraint
Definition at line 13217 of file cons_knapsack.c. Referenced by addCoefTerm(), createCapacityRestriction(), SCIP_DECL_SOLVECUMULATIVE(), SCIPaddCoefPseudoboolean(), and SCIPcreateConsBasicKnapsack().
gets the capacity of the knapsack constraint
Definition at line 13238 of file cons_knapsack.c. References NULL, SCIP_Longint, SCIPABORT, SCIPchgCapacityKnapsack(), SCIPconsGetData(), and SCIPerrorMessage. Referenced by addKnapsackConstraints(), checkKnapsack(), getLinearConsSides(), SCIP_DECL_READERWRITE(), SCIPmatrixCreate(), SCIPwriteGms(), SCIPwriteLp(), SCIPwritePip(), writeFzn(), writeOpbConstraints(), and writeOpbObjective().
changes capacity of the knapsack constraint
Definition at line 13262 of file cons_knapsack.c. References NULL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_STAGE_PROBLEM, SCIPconsGetData(), SCIPerrorMessage, SCIPgetNVarsKnapsack(), and SCIPgetStage(). Referenced by SCIPgetCapacityKnapsack(). gets the number of items in the knapsack constraint
Definition at line 13291 of file cons_knapsack.c. References NULL, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, and SCIPgetVarsKnapsack(). Referenced by addKnapsackConstraints(), checkKnapsack(), getLinearConsNVars(), getLinearConsVarsData(), SCIP_DECL_READERWRITE(), SCIPchgCapacityKnapsack(), SCIPmatrixCreate(), SCIPwriteCcg(), SCIPwriteGms(), SCIPwriteLp(), SCIPwritePbm(), SCIPwritePip(), SCIPwritePpm(), writeFzn(), writeOpbConstraints(), and writeOpbObjective(). gets the array of variables in the knapsack constraint; the user must not modify this array!
Definition at line 13312 of file cons_knapsack.c. References NULL, SCIP_Longint, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, and SCIPgetWeightsKnapsack(). Referenced by addKnapsackConstraints(), checkKnapsack(), getLinearConsVarsData(), SCIP_DECL_READERWRITE(), SCIPgetNVarsKnapsack(), SCIPmatrixCreate(), SCIPwriteCcg(), SCIPwriteGms(), SCIPwriteLp(), SCIPwritePbm(), SCIPwritePip(), SCIPwritePpm(), writeFzn(), writeOpbConstraints(), and writeOpbObjective().
gets the array of weights in the knapsack constraint; the user must not modify this array!
Definition at line 13333 of file cons_knapsack.c. References NULL, SCIP_Real, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, and SCIPgetDualsolKnapsack(). Referenced by addKnapsackConstraints(), checkKnapsack(), getLinearConsVarsData(), SCIP_DECL_READERWRITE(), SCIPgetVarsKnapsack(), SCIPmatrixCreate(), SCIPwriteCcg(), SCIPwriteGms(), SCIPwriteLp(), SCIPwritePbm(), SCIPwritePip(), SCIPwritePpm(), writeFzn(), and writeOpbConstraints(). gets the dual solution of the knapsack constraint in the current LP
Definition at line 13354 of file cons_knapsack.c. References NULL, SCIP_INVALID, SCIP_Real, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, SCIPgetDualfarkasKnapsack(), and SCIProwGetDualsol(). Referenced by SCIPgetWeightsKnapsack(). gets the dual Farkas value of the knapsack constraint in the current infeasible LP
Definition at line 13378 of file cons_knapsack.c. References NULL, SCIP_INVALID, SCIPABORT, SCIPconsGetData(), SCIPerrorMessage, SCIPgetRowKnapsack(), and SCIProwGetDualfarkas(). Referenced by SCIPgetDualsolKnapsack(). returns the linear relaxation of the given knapsack constraint; may return NULL if no LP row was yet created; the user must not modify the row!
Definition at line 13404 of file cons_knapsack.c. References NULL, SCIPABORT, SCIPconsGetData(), and SCIPerrorMessage. Referenced by SCIPgetDualfarkasKnapsack().
solves knapsack problem in maximization form exactly using dynamic programming; if needed, one can provide arrays to store all selected items and all not selected items solves knapsack problem in maximization form exactly using dynamic programming; if needed, one can provide arrays to store all selected items and all not selected items
Definition at line 949 of file cons_knapsack.c. References FALSE, IDX, MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_MAX, SCIP_NOMEMORY, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocMemoryArray, SCIPcalcGreComDiv(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPfreeMemoryArray, SCIPsolveKnapsackApproximately(), SCIPsortDownRealIntLong(), SCIPsortDownRealLongRealInt(), and TRUE. Referenced by dualPresolving(), getFlowCover(), and getHighestCapacityUsage().
solves knapsack problem in maximization form approximately by solving the LP-relaxation of the problem using Dantzig's method and rounding down the solution; if needed, one can provide arrays to store all selected items and all not selected items
Definition at line 1492 of file cons_knapsack.c. References checkSolveKnapsack(), NULL, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, and SCIPsortDownRealLongRealInt(). Referenced by getCover(), and SCIPsolveKnapsackExactly().
separates lifted valid inequalities for given knapsack problem separates different classes of valid inequalities for the 0-1 knapsack problem
Definition at line 5524 of file cons_knapsack.c. References FALSE, getCover(), getFeasibleSet(), GUBsetCreate(), GUBsetFree(), GUBsetGetCliquePartition(), makeCoverMinimal(), SCIP_GUBSet::ngubconss, NULL, SCIP_GUBSet::nvars, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetName(), SCIPdebugMessage, SCIPdebugPrintf, SCIPfreeBufferArray, SCIPgetSolVals(), SCIPincConsAge(), SCIPseparateRelaxedKnapsack(), SCIPvarGetName(), separateSequLiftedMinimalCoverInequality(), separateSupLiftedMinimalCoverInequality(), TRUE, and USESUPADDLIFT. Referenced by getFeasibleSet(), SCIPseparateRelaxedKnapsack(), and separateCons().
Definition at line 5741 of file cons_knapsack.c. References BMSclearMemoryArray, CONSHDLR_NAME, DEFAULT_USEGUBS, FALSE, KNAPSACKRELAX_MAXDELTA, KNAPSACKRELAX_MAXDNOM, KNAPSACKRELAX_MAXSCALE, MAXABSVBCOEF, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcalcIntegralScalar(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebug, SCIPdebugMessage, SCIPdebugPrintCons, SCIPdebugPrintf, SCIPepsilon(), SCIPfeasFloor(), SCIPfindConshdlr(), SCIPfloor(), SCIPfreeBufferArray, SCIPgetNContVars(), SCIPgetNegatedVar(), SCIPgetNVars(), SCIPgetSolVal(), SCIPgetVars(), SCIPisGE(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPreallocMemoryArray, SCIPseparateKnapsackCuts(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetNVlbs(), SCIPvarGetNVubs(), SCIPvarGetProbindex(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIPvarGetVlbCoefs(), SCIPvarGetVlbConstants(), SCIPvarGetVlbVars(), SCIPvarGetVubCoefs(), SCIPvarGetVubConstants(), SCIPvarGetVubVars(), SCIPvarIsActive(), SCIPvarIsBinary(), separateCons(), and TRUE. Referenced by addCut(), and SCIPseparateKnapsackCuts(). |