# Quadratic integer Programming

Would anyone mind helping me solve this problem

$$\min\space f(x) = \frac12 x^\mathrm TQx + bx + c \qquad \text{s.t. } \sum_i x_i=\lambda$$

where $x$ is a vector whose entries are positive integers and $Q$ is positive definite.

-

## migrated from mathoverflow.netJul 4 '13 at 19:47

This question came from our site for professional mathematicians.

In which context did you encounter this problem? –  Stefan Kohl Jun 28 '13 at 9:51
Actually the problem is that there are some integers which their summation is constant and I want to minimize the variance of them (which is a quadratic programming problem). I'm electrical engineering M.Sc. student. In my thesis I encountered this problem. –  Mahdi Khosravi Jun 28 '13 at 10:01
Could you tell us what exactly $Q$ and $b$ are? I think mathematica has some tools to help. –  Ali Jun 28 '13 at 11:05
yes they are integer-valued. actually, Q= 2*(I + [1]), b=λe where I is the Identity matrix and [1] is a matrix who all its elements are 1 and e = [1 1 .... 1]'. –  Mahdi Khosravi Jun 28 '13 at 11:40
If you know the sum of n integers you know there average and the variance will be minimized with the integers as close to the average as possible so I think you will have to consider at most two integers, the two closest to the average or the average itself if that is an integer. –  Kristal Jun 28 '13 at 16:47