Quadratic knapsack problem (source code)

= Quadratic knapsack problem
{title2=$\max\{v^{\mathsf T}x+\sum_{i\ne j}p_{ij}x_ix_j:w^{\mathsf T}x\leq B,\ x\in\{0,1\}^n\}$}

= QKP
{c}
{synonym}

The quadratic knapsack problem includes pairwise interactions between selected items. For symmetric $p_{ij}$, a sum over all ordered pairs counts each unordered interaction twice; an alternative convention sums only over $i<j$. The objective convention must be kept consistent when bounding or fixing variables.