The traditional knapsack problem is that: given a sequence of $i$ items with positive weights $w\_1,w\_2,...,w\_i$, positive values $v\_1,v\_2,...,v\_i$, and a bag with capacity $B$, we want to insert items into the bag without exceeding the capacity $B$ while maximising the total values (i.e., maximising $\sum\_{h=1}^i p\_h\*v\_h$ subject to (1) $p\_h=0$ or 1, (2) $\sum\_{h=1}^i p\_h\*w\_h \leq B$ ). I know the decision problem of knapsack problem is NP-complete and thus the optimisation version is NP-hard.


But what if we have the constraint restricting the capacity such that $\sum\_{h=1}^i w\_h <B< \sum\_{h=1}^i 2w\_h$? Is it still Np-hard under this constraint?



Knapsack problem with capacity constraint
I assume that your constraint should read $\sum\_{h=1}^i p\_h w\_h < B < 2 \sum\_{h=1}^i p\_h w\_h$, not $\sum\_{h=1}^i w\_h < B$ otherwise the trivial solution $p\_h \equiv 1$ always applies.


There is an reduction by adding a very heavy and expensive item. Take any Knapsack problem like you stated. Calculate $W := \sum\_h w\_h$, $V:= \sum\_h v\_h$. We can assume that $0 < B < W$, otherwise the solution is trivial. Now add another item with $w\_{i+1} := W$ and $v\_{i+1} := V+1$ and use a new capacity $\tilde{B} := B+W$. The new problem is obviously polynomial in size wrt. to the old one.


Now any Knappsack solution to this new problem has to include item $i+1$, as taking only this item is already better than ignoring it and taking all of the others. This means that you can take an optimal Knapsack solution to the new problem, remove this item and get an optimal Knapsack solution to the old one and vice versa. But since $\tilde{B} < 2W = 2w\_{i+1}$, any optimal solution to the new problem also automatically satisfies your constraint.


