Forum Discussion
Equitable distribution by shorter distance - Geolocation
This seems to me an unusual, albeit very interesting, problem for the context.
the link of a pbix file with a draft solution:
there is a function that allows to obtain the manager-client associations for each location, invoking it with the name of the location.
per scaricarli, fai click sul seguente link e segui le istruzioni.
I'm not sure if I have interpreted the need correctly.
The idea is this (assuming that customers are more than managers :)):
I group both customers and managers by location;
for each location I cycle through the list of managers and find the closest customer in the list of customers, which I gradually exclude from the list. This is until the customer list is completely empty.
A different possible way would be to scroll through the list of customers and assign each one to the closest manager, excluding from the list of managers those who gradually become saturated.
an aesthetic change, to make the control of the end of the cycle less brutal.
- Anonymous5 years agoNot applicable
I would like to go back to the literal meaning of the specification for what I understand, to share the following observation.
Assigning to the various customers the closest manager still available (not saturated) without any other specification, implies that the result is highly dependent on the order in which the customers are chosen to be assigned to the closest manager.
If all customers are equally privileged and you choose, starting from the first on the list to the last, you could have a situation in which the sum of the distances thus obtained is much greater than the sum of distances that would be obtained if you scrolled the list of customers on the contrary from the last to the first ,for example.- Dihros5 years agoFrequent Visitor
Thank you very much Anonymous
I was able to analyze your proposal, which I appreciate very much.
In order to be a little clearer what I require is to distribute the total number of clients among the total number of administrators that exist for each location, but this assignment should be based on the shortest distance (or any other factor).
Taking the following example:
All the clients could be assigned to manager 1, since this one is the closest to all the clients, however, it is necessary to take advantage of the resources and assign clients to the rest of the managers, therefore, when the manager already has the number of clients that correspond to him, the client is assigned to the next closest manager and so on.
Clients for each administrator = Total of clientes / Total of managers
Thank you very much in advance
Greetings