# Tag Info

You can linearize the objective as follows. Let binary decision variable $x_i$ indicate whether item $i$ is chosen, and let binary decision variable $y_c$ indicate whether the count of chosen items is $c$. Let $w_i$ be the weight of item $i$, and let $b_c$ be the bonus/penalty for choosing $c$ items. The problem is to maximize $$\sum_i w_i x_i + \sum_c b_c ... 7 If I understand correctly, binary variable g_j indicates whether group j is special, binary variable a_{i,j} indicates whether exactly i items are taken from group j, and binary variable b_i indicates whether exactly i items are taken from the special group. You want to enforce the logical implication$$b_i \implies \bigvee_j (g_j \land a_{i,j}...