Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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

like image 742
Hallis Avatar asked Jun 09 '09 07:06

Hallis


People also ask

What is the success rate of speed dating?

According to the New York Times, participants in speed dating experience an average of 2 in 10 or 3 in 10 matches. Online dating participants, in contrast, only find a compatible match with 1 in 100 or fewer of the profiles they study.

How long should you wait to contact someone after speed dating?

A common piece of advice for singles is to wait three days before contacting someone after a date, or before responding to texts and messages. The idea is not to seem too eager. With speed dating, we recommend you don't leave it so long to contact a match.

How long should a speed date be?

Speed dating events usually last 1-2 hours, in which you'll have dates with between 10-20 people in that hour. Traditionally the venue is a bar, however online speed dating is becoming popular, where you meet people through short video calls.


1 Answers

I wouldn't bother with genetic algorithms. Instead, I would do the following, which is a slight refinement on repeated perfect shuffles.

While (there are two people who haven't met):

  1. Consider the graph where each node is a guest and edge (A, B) exists if A and B have NOT sat at the same table. Find all the connected components of this graph. If there are any connected components of size < tablesize, schedule those connected components at tables. Note that even this is actually an instance of a hard problem known as Bin packing, but first fit decreasing will probably be fine, which can be accomplished by sorting the connected components in order of biggest to smallest, and then putting them each of them in turn at the first table where they fit.
  2. Perform a random permutation of the remaining elements. (In other words, seat the remaining people randomly, which at first will be everyone.)
  3. Increment counter indicating number of rounds.

Repeat the above for a while until the number of rounds seems to converge.

like image 89
Martin Hock Avatar answered Nov 16 '22 01:11

Martin Hock