快速约会算法 [英] Speed dating algorithm
问题描述
我在一家咨询机构和上午的大部分时间在客户所在地。正因为如此,我很少能符合我的同事。为了得到更好地相互了解,我们将安排晚宴。还会有很多小表,这样的人能有一个聊天。为了去跟许多不同的人可能在聚会上,每个人都必须在一定的时间间隔切换表,说每隔一小时。
I work in a consulting organization and am most of the time at customer locations. Because of that I rarely meet my colleagues. To get to know each other better we are going to arrange a dinner party. There will be many small tables so people can have a chat. In order to talk to as many different people as possible during the party, everybody has to switch tables at some interval, say every hour.
如何编写创建表转换时间表的程序?只给你一些数字;在这种情况下,将有大约40人,可以有至多8人在每个表。但是,该算法需要是通用当然
How do I write a program that creates the table switching schedule? Just to give you some numbers; in this case there will be around 40 people and there can be at most 8 people at each table. But, the algorithm needs to be generic of course
推荐答案
这听起来像遗传算法的应用程序:
This sounds like an application for genetic algorithm:
- 选择一个随机排列的40位客人 - 这是座位安排
- 重复随机排列N次(N是你有多少次切换在夜晚座位)
- 联合的排列在一起 - 这是染色体的一种生物
- 重复供你想怎么过许多生物体培育出一代
- 健康分数的人每个人终于看到了一晚的数量(或者 - 人数的倒数,他们没有看到)
- 在繁殖,变异和使用常规方法引入新的生物和重复,直到你得到一个满意的答案
您可以添加你喜欢到健身任何其他因素,如男性/女性比例等方面没有显着改变基本的方法。
You can add in any other factors you like into the fitness, such as male/female ratio and so on without greatly changing the underlying method.
这篇关于快速约会算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!