I am trying to allocate customers $C_i$ to financial advisers $P_j$. Each customer has a policy value $x_i$. I'm assuming that the number of customers ($n$) allocated to each adviser is the same, and that the same customer cannot be assigned to multiple advisers. Therefore each partner will have an allocation of policy values like so:
$P_1 = [x_1,x_2,x_3]$, $P_2 = [x_4,x_5,x_6]$, $P_3 = [x_7,x_8,x_9]$
After allocating customers, the average policy value is calculated for each adviser. I want to allocate customers to advisers in a way that minimises the variance in average policy values between each of the advisers.
What I have tried
My current algorithm randomly samples $n$ customers without replacement from the dataset and assigns each sample to an adviser. Once the allocations are made, the average policy value for each adviser is calculated and I compute the variance between each of the advisers. I repeat this over a defined number of iterations and return the allocation with the lowest variance. As expected, when dealing with larger volumes of advisers and customers this is not the most efficient process.
- Is there an algorithm that converges towards the optimal allocation rather than randomly allocating on every iteration?
- How can I frame this problem as an objective function to minimise the variance?
- Any links to implementations (preferably Python) would be appreciated if possible