in reply to Re^3: Average Price Algorithm
in thread Average Price Algorithm

Many thanks for the example!

GrandFather, I'm wondering if you would share your thoughts on

It strikes me that it has something to do with relative factorization. For example, had the example been scaled down by 10 so that the number of buckets was relatively prime vis a vis the number of items assigned to each value, then the strategy of minimizing net deviation would have succeeded in finding the optimal result. Conversely, had the code I posted taken relative factorization into account, it would have found the optimal solution.

Are there other examples you can think of, for which taking into account relative factorization would not help?

Best, beth