Algorithm to split people into groups with most diversity per group [closed]

ⅰ亾dé卋堺 提交于 2021-02-05 05:55:27

问题


I'd like an algorithm to put people into groups for an upcoming conference. There's lots of people going, from different regions, departments, genders etc, and they want to split people up as much as possible so get diversity in each group.

So is there either a well known algorithm or even tool in (say) Excel or something to solve this problem, which must be very common?

To simplify the problem say there are n people (say 100) To be split into g groups (say 6) and there should be as close to even number in each group.

They have regions: London, North, Midlands, West, Scotland (mostly London)

Gender: Female, Male, Other

Departments: Sales, Support, Management

Grade: 6 different grades

Additional info There are differing proportions of people in each category, i.e. more sales than management.

There probably is a priority in the ordering, they want an even gender split more than an even department split.

I work in C# but happy to read in anything.

Thanks! Ben


回答1:


This is not a trivial problem by any means, and hard, if not impossible to solve with an exact algorithm. I don't know an academic analogue, but this is a perfect use case for stochastic/probabilistic optimization.

You need a fitness function that can convey how diverse the current assignment is with a single number, e.g. something simple and intuitive like:

sum
  for each group
    for each trait
      trait_weight * abs(%_occurrence_in_group - %_occurrence_in_population)

(in the above case, lower is better)

Choose a method like simulated annealing or a genetic algorithm, and search for an extremum.




回答2:


Lets first define a utility function. We want one that's accurate but quick to calculate, so how about how close the proportion of people of each category is in a group compared to the actual proportion of each category in total.

so if a group of 8 has 5 males, 3 males , 4 salespeople and 4 support, but there is an equal split of males and females in total, and 2/3rds the total number of people are sales, the other 1/3rd support the utility function will be -((5/8-1/2)+(3/8-1/2)+(4/8-2/3)+(4/8-1/3))

The reason there is a minus in front is so that the utility function increases with diversity.

Once you've defined a utility function, there's a lot of ways to go about it, including simulated annealing for example. However for your purposes I recommend hill climbing with random restart, as I think it will be sufficient.

Randomly assign people to different groups, then calculate the utility function. Randomly select one person from 1 group and another from another group, and if the utility will be higher when you swap them do so. Continue swapping, for a number of rounds (eg,200), and then record the assignment and the utility function. Restart from a new random assignment, and repeat the whole process a few more times. Pick the one with the highest utility function.

If that's not clear, ask me to clarify.



来源:https://stackoverflow.com/questions/46115135/algorithm-to-split-people-into-groups-with-most-diversity-per-group

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!