Hello everyone.
The Problem
==========
I am working on a speed date project. The "who meets whom" part is already solved, and the output of that is a full list with all the pairs that will be meeting that day. The actual speed dating day will consist of **N rounds**, and will have **P participants**. The restrictions are:
- **P** is an **even** number
- Each participant is represented by a number, from 1 to P
- N is equal or lower than P-1
- **Each person meets N other people**, and **is seen by N people as well**. Consequently, people don't "sit out" (i.e. everyone must meet someone on all rounds)
- People meet in pairs, and naturally, one person can only have one meeting on each round.
The Need
==========
**What I need is an algorithm that creates the schedule for the different rounds** (i.e. indicates which pairs are meeting in which round).
The Input
==========
As for the **input**, you are given a list with 2 columns. Each line contains a pair that must meet, and there are " P * N / 2 pairs "(i.e. each round accommodates P/2 pairs).
The lowest number between the two people is on the left column. Not sure this matters.
I can also point out that N will probably be 3, 4 or 5, and that P will be somewhere in the range of 30-40 (again, even numbers only). **I don't need the fastest solution in the world**. If you have an algorithm that solves the problem in under 6 hours with the power of an average desktop, I am happy enough.
Examples
==========
http://i.stack.imgur.com/0aXU6.png : Example 1 has 6 people and 4 rounds. Example 2 has 30 people and 4 rounds.
**Output of the example 1**: One can read the table as: (1st line example) Person1(p1) is meeting p2 on round1, then meets p3 on round 2, then p4 on r3, and finally p5 on r4
**Output of the Example 2:** This showcases where one can start seeing some issues: as we try to allocate the pairs, some clashes start to occur. 1st clash in this example occurs at Yellow (line 19 of the input), and a 2nd clash occurs at red (line 29 of the input). The yellow case was "solved" by simply delaying the pair 6 & 10 to the 2nd round. But when we try to make players 8 & 9 meet, we can see how attempting to make that happen, would cause a cascade of effects on the table.
The Problem
==========
I am working on a speed date project. The "who meets whom" part is already solved, and the output of that is a full list with all the pairs that will be meeting that day. The actual speed dating day will consist of **N rounds**, and will have **P participants**. The restrictions are:
- **P** is an **even** number
- Each participant is represented by a number, from 1 to P
- N is equal or lower than P-1
- **Each person meets N other people**, and **is seen by N people as well**. Consequently, people don't "sit out" (i.e. everyone must meet someone on all rounds)
- People meet in pairs, and naturally, one person can only have one meeting on each round.
The Need
==========
**What I need is an algorithm that creates the schedule for the different rounds** (i.e. indicates which pairs are meeting in which round).
The Input
==========
As for the **input**, you are given a list with 2 columns. Each line contains a pair that must meet, and there are " P * N / 2 pairs "(i.e. each round accommodates P/2 pairs).
The lowest number between the two people is on the left column. Not sure this matters.
I can also point out that N will probably be 3, 4 or 5, and that P will be somewhere in the range of 30-40 (again, even numbers only). **I don't need the fastest solution in the world**. If you have an algorithm that solves the problem in under 6 hours with the power of an average desktop, I am happy enough.
Examples
==========
http://i.stack.imgur.com/0aXU6.png : Example 1 has 6 people and 4 rounds. Example 2 has 30 people and 4 rounds.
**Output of the example 1**: One can read the table as: (1st line example) Person1(p1) is meeting p2 on round1, then meets p3 on round 2, then p4 on r3, and finally p5 on r4
**Output of the Example 2:** This showcases where one can start seeing some issues: as we try to allocate the pairs, some clashes start to occur. 1st clash in this example occurs at Yellow (line 19 of the input), and a 2nd clash occurs at red (line 29 of the input). The yellow case was "solved" by simply delaying the pair 6 & 10 to the 2nd round. But when we try to make players 8 & 9 meet, we can see how attempting to make that happen, would cause a cascade of effects on the table.