How to find best set of customers

46 Views Asked by At

I've got a problem with getting optimized solution from this task:

We have n customers, which buy articles from m suppliers. There are much more customers and suppliers on the market. We've got sales data from the m suppliers concernig total market. We want to find a mix from our customers which best represents the market.

Example:

Customer   Supplier A  Supplier B  Supplier C  Total
4711       10          30          10           50
4712       20          40          40          100
4713        5          11           9           25
Total      35          81          59          175
%          20%         46%         34%         100%

From our supplies we know:

Supplier A  Supplier B  Supplier C Total
5000        1500        7000       13500
37%         11%         52%        100%

My idea was to find $$ f = \min( \sum_{k=0}^m(T_k - S_k)^2) $$ where $$ T_k = \sum_{j=0}^n{x_j} * \frac{Customer_{j,k}}{\sum_{i=0}^mCustomer_{i,j}} \hspace{20mm} x_j = {<0,1>} $$ and $$ S_k = \frac{Supplier_k} {\sum_jSupplier_j} $$

I have lpsolve55.dll, but how can I construct input data for it?

Regards, Gabriel