cons_knapsack.h
Go to the documentation of this file.
27 * @brief Constraint handler for knapsack constraints of the form \f$a^T x \le b\f$, x binary and \f$a \ge 0\f$.
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
69 * This constraint handler handles a special type of linear constraints, namely knapsack constraints.
74 * with non-negative integer coefficients \f$a_i\f$, integer right-hand side \f$b\f$, and binary variables \f$x_i\f$.
79 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
110 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
116 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
117 * method SCIPcreateConsKnapsack(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
121 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
168/** gets the array of variables in the knapsack constraint; the user must not modify this array! */
175/** gets the array of weights in the knapsack constraint; the user must not modify this array! */
196/** returns the linear relaxation of the given knapsack constraint; may return NULL if no LP row was yet created;
214 * @note in case you provide the solitems or nonsolitems array you also have to provide the counter part, as well
238/** solves knapsack problem in maximization form approximately by solving the LP-relaxation of the problem using Dantzig's
239 * method and rounding down the solution; if needed, one can provide arrays to store all selected items and all not
273/* relaxes given general linear constraint into a knapsack constraint and separates lifted knapsack cover inequalities */
281 SCIP_Real* knapvals, /**< coefficients of the variables in the continuous knapsack constraint */
282 SCIP_Real valscale, /**< -1.0 if lhs of row is used as rhs of c. k. constraint, +1.0 otherwise */
294 SCIP_Bool* infeasible, /**< pointer to return whether the problem was detected to be infeasible */
common defines and data types used in all packages of SCIP
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13845
SCIP_RETCODE SCIPcreateRowKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13991
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
Definition: cons_knapsack.c:13766
SCIP_RETCODE SCIPsolveKnapsackApproximately(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval)
Definition: cons_knapsack.c:1594
SCIP_RETCODE SCIPcleanupConssKnapsack(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible, int *ndelconss)
Definition: cons_knapsack.c:14027
SCIP_RETCODE SCIPseparateKnapsackCuts(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, SCIP_VAR **vars, int nvars, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_SOL *sol, SCIP_Bool usegubs, SCIP_Bool *cutoff, int *ncuts)
Definition: cons_knapsack.c:5564
SCIP_RETCODE SCIPcreateConsBasicKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
Definition: cons_knapsack.c:13747
SCIP_RETCODE SCIPchgCapacityKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_Longint capacity)
Definition: cons_knapsack.c:13814
SCIP_RETCODE SCIPseparateRelaxedKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_SEPA *sepa, int nknapvars, SCIP_VAR **knapvars, SCIP_Real *knapvals, SCIP_Real valscale, SCIP_Real rhs, SCIP_SOL *sol, SCIP_Bool *cutoff, int *ncuts)
Definition: cons_knapsack.c:5781
SCIP_RETCODE SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success)
Definition: cons_knapsack.c:1090
SCIP_RETCODE SCIPcreateConsKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
Definition: cons_knapsack.c:13660
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13891
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13788
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13868
SCIP_Real SCIPgetDualfarkasKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13940
SCIP_ROW * SCIPgetRowKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13968
SCIP_Real SCIPgetDualsolKnapsack(SCIP *scip, SCIP_CONS *cons)
Definition: cons_knapsack.c:13914
SCIP_RETCODE SCIPincludeConshdlrKnapsack(SCIP *scip)
Definition: cons_knapsack.c:13503
Definition: multiprecision.hpp:66
static SCIP_RETCODE separate(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result)
Main separation function.
Definition: sepa_flower.c:1221
Definition: struct_cons.h:47
Definition: struct_lp.h:205
Definition: struct_sepa.h:47
Definition: struct_sol.h:74
Definition: struct_var.h:262
Definition: struct_scip.h:72
type definitions for constraints and constraint handlers
type definitions for LP management
type definitions for return codes for SCIP methods
type definitions for SCIP's main datastructure
type definitions for separators
type definitions for storing primal CIP solutions
type definitions for problem variables