I've been thinking about a division problem for groups that I haven't found a dynamic programming solution and I'm trying to analyze the complexity of the problem.
There is a set of $n$ positive numbers ($S$), a vector of group sizes (let's call it $Sizes$), and a parameter $Y$. Find a way for divide the $n$ numbers into groups that their size describes in $Sizes$ s.t. the $constraint$ in close as possible to $Y$.
For example, $ S = \{1,1,2,2,3,4,4,7,9,11\}$, $Sizes = [2,2,3,3]$, $Y=2$ and $constraint =$ the variance of the group. Of course that the $constraint$ could be changed in other cases. But this is representative example.
Has this problem any dynamic programming solution? or that the complexity is exponential (which means $NP$ problem)?
Which approximation approaches can help me in this case?
Thanks in advance!