Skip to main content

Questions tagged [knapsack]

For questions related to the knapsack problem that seeks to find the number of each item to include in a limited container (in an integer knapsack or whether to include an item in a binary knapsack), given each item's weight and value, with the goal of maximizing the total value.

Filter by
Sorted by
Tagged with
3 votes
1 answer
189 views

I have been solving the exercises in: https://github.com/mmghannam/colgen2025/tree/main The first bonus exercise asks for plotting the evolution of the dual values but I haven't understood how SCIP ...
Diana Gutierrez's user avatar
0 votes
0 answers
34 views

We define the all-subset-sum problem as follows. Given a set $S$ of positive integers and a target $T$, the goal is to find all the maximal distinct subsets of $S$ summing to $T$. A maximal set is a ...
Samuel Bismuth's user avatar
2 votes
1 answer
316 views

Hello long lost friends! Summary Does the formulation below, i.e., an Assignment Problem with one extra linear inequality, have a name, and has it been studied? Context Just for reference: there are ...
Leo's user avatar
  • 131
1 vote
2 answers
239 views

How can the formulation of $P2$ guarantee that it is a relaxation of $P1$? (if $w=0$, $1$ is much bigger than $2$).
user15009's user avatar
1 vote
0 answers
85 views

I have a variation of the knapsack problem where each item has a profit ($p_i$), weight ($w_i$), and penalty ($t_i$). The objective is to maximize the summation of the selected items' profits minus ...
OR Junior's user avatar
  • 613
2 votes
1 answer
1k views

Is 0-1 knapsack problem still NP-Hard with an equality constraint? $$\begin{aligned} & \text { maximize } \sum_{i=1}^n v_i x_i \\ & \text { subject to } \sum_{i=1}^n w_i x_i = W \text { and } ...
Anson's user avatar
  • 43
1 vote
0 answers
161 views

I am trying to solve something similar to a knapsack problem: $$\max \sum v_{n}P_{n}$$ subject to some basic weight constraints. However, what makes this problem difficult to solve is that $P_{n}$ is ...
BenBernke's user avatar
  • 185
1 vote
1 answer
156 views

Can anyone explain how the writer rewrite the objective function in (7) to be written as (8)?
AhmedHassan's user avatar
0 votes
2 answers
239 views

This is an exercise from Wolsey that I can't solve. Show how to go from Equivalence (1) to (2) and from Equivalence (2) to (3): $$ \begin{align} X &= \{ x \in \{0, 1\}^4~\mid~97x_1 + 32x_2 + ...
Tio Pikachu Lizardon's user avatar
1 vote
0 answers
136 views

I'm giving a seminar to PhD students in pure math, and one of the things I'd like to do is show that more applied optimization can also make its way into pure Mathematics. As for classical problems, I'...
João Dionísio's user avatar
1 vote
0 answers
209 views

The original goal was to program a knapsack problem that gives the rows of the following matrix as the solutions: which has the definition: $$T(n,k)=a(\gcd(n,k))$$ where the Dirichlet inverse of the ...
Mats Granvik's user avatar
0 votes
1 answer
139 views

Problem Description I have many examples (say $N$) to choose from to train my machine learning model. However, I could only select $n \ll N$ based on a set of $K$ attributes $\{a_1, a_2, \cdots, a_k\}$...
Mr.Robot's user avatar
  • 171
1 vote
0 answers
60 views

For a long-done project presentation, I implemented the Primal Effective Capacity (PECH) Heuristic to look for initial greedy solutions for the Multidimensional Knapsack (MDK) problem in Python. I ...
JJMae's user avatar
  • 165
3 votes
2 answers
152 views

Is the following expression a knapsack constraint? $ \sum_i a(i) y(i) \ge W$, where $y(i)$ binaries, $a(i),W$ reals. What confuses me is the $\ge$ sign. Alternatively, do solvers generate cuts out of ...
Clement's user avatar
  • 2,320
5 votes
2 answers
507 views

Consider a knapsack problem with binary variables and a standard knapsack constraint $\sum_{j\in N}a_jx_j\leq b$. A set $C\subseteq N$ is a cover if $\sum_{j\in C}a_j >b$ If $C\subseteq N$ is a ...
Joris Kinable's user avatar

15 30 50 per page