[SciPy-User] Hi everyone , I wanna consult one question about linear calculate
I have little basic knowledge about python, can build CMS with Django ,install,upgrade,uninstall python modules. I occur one question in fact work, and I fee Scipy can fix the question ,but I can't understand how to use Scipy and using which module or function even I have read two books about Numpy and Scipy in two weeks. So I have to seek help form somebody.
Here is the question's description ::
We have 50 numbers [A1,A2,A3,A4,A5,A6,A7,A8,A9...A50] and we also know the average of these numbers , for example the average is 3219, we will group the 50 numbers into 11 groups,So the average number 3218 and the sum of each group also will have 11 subtractions , and in the sum of 11 subtract abs value , the minimize one is our target. we wanna find the minimize sum of the 11 subtractions, and the group style of the 50 numbers.
1. We have 50 numbers [A1, A2, A3, ..., A49, A50] and the avg of these numbers: 3219;
Re: Hi everyone , I wanna consult one question about linear calculate
This isn't a SciPy-User question, it would be better asked on a mathematical list. But now that you're here. I won't answer the question here as it's off-topic, but to help guide you to a more appropriate forum I'll note that this is not a problem of linear calculation since your cost function is nonlinear due to the use of abs. Moreover the constraint that the coefficients be boolean rather than real put this outside the realm of numerical linear algebra. Instead it's a problem of "combinatorial optimization", a "partition problem", like the "knapsack problem". Those terms might help you search for a solution in the literature or for a suitable forum.
For a link which is on a more suitable forum and also contains answers to a closely related problem which you might find useful, try: