Algorithm for selecting n vectors out of a set while minimizing cost
问题 assuming we have: set U of n-dimensional vectors (vector v = < x1,x2 ... ,xn >) constraint n-dimensional vector c = < x1...xn > n-dimensional vector of weights w = < x1...xn > integer S i need algorithm that would select S vectors from U into set R while minimizing function cost(R) cost(R) = sum(abs(c-sumVectors(R))*w) (sumVectors is a function that sums all vectors like so: sumVectors({< 1,2 >; < 3 ,4>}) = < 4,6 > while sum(< 1, 2, 3 >) returns scalar 6) The solution does not have to be