Requirements:
- You can have X number of people
- These X people will be a set number before everyone is invited to log-in, set by an admin.
- Each person will be talked to the same number of times.
- This will be configured by an admin.
- Each person can only talk to another person once
- A person can't talk to themselves
- A person will come in and get assigned upon log-in who they will communicate with (its not pre-determined)
For example:
- We have 6 people
- We can set a number of one way interactions between 1 and 5.
- Possible 1: Lets say we go with 6 one way interactions
- Each person will talk to all the other people once. So Person A will talk to B, C, D, E and F
- Possible 2: Lets say we go with 2 one way interactions
- Possible Combination 1
- Person A will talk to: B and C
- Person B will talk to: C and D
- Person C will talk to: D and E
- Person D will talk to: E and F
- Person E will talk to: F and A
- Person F will talk to: A and B
- Possible Combination 2
- Person A will talk to: D and F
- Person B will talk to: C and E
- Person C will talk to: F and A
- Person D will talk to: B and C
- Person E will talk to: A and B
- Person F will talk to: D and E
- Possible Combination 1
Here is what I've come up with so far and I'll explain where I'm stuck.
- As User A I go in and request who I can communicate with.
- It will run through the following steps.
- Goes out and finds any person I've already been assigned to communicate with.
- Now gets a collection of all people, excludes the calling user and the people it already has been assigned to.
- Now loops through those people and figures out how many users are talking to each of those eligible people
- Now it will remove any of those eligible people who have been talked to by the maximum amount of interactions.
- Finally will pick a random person from that list and assign them to me.
The problem is, lets say using from my example combo 1:
- User A got BC
- User B got CA
- User C got AB
- User D got CE
- User E only has F as an option but needs another person
- User F only has E as an option but needs another person
- F and E still are requiring another person to talk to them.
What can I do to prevent my problem?