1

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

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?

4

2 回答 2

2

我认为问题可能与“登录时分配”标准有关(除非我误解了它)。例如,当第一个人 (A) 登录时,没有其他人可以“分配”给他们。或者,在每个人都需要交谈一次并且您有 3 个人(A、B、C)已经登录的情况下

 A->B 
 B->C
 C->A 

是一个解决方案。但是,如果 D 现在稍后登录,则没有人可以与之交谈,因此无法满足 D 的要求。

另一方面,如果管理员可以等到所有人都登录,那么对于 p 个人(标记为 1,2,3...p)每个需要与 q <= p 其他人通信的简单解决方案是:

 for i = 1 to p
   for j = 1 to q
     i communicates with (i+j) mod p

如果您每次登录时都需要一组不同的通信,那么只需将标签 1..p 随机分配给人员 A、B、...

于 2012-10-10T22:55:07.650 回答
0

当一个人进来并需要分配与哪些(其他)人交谈时,请稍微修改您的程序,如下所示:

  1. 获取所有人的名单,但当然不要让自己离开(因为你不能自言自语)。

  2. 根据与每个人交谈的次数对该列表进行排序。

  3. 通过从“最低优先”的有序列表中挑选来填充您的谈话子集。这将提高任何下一个进来的人都有足够选择的可能性。

  4. 作为一种可能的进一步改进,在与谈话统计数据相同“低”数量的候选人中,首先选择那些他们自己说话较少的人,如果整个设置使得他们更有可能成为下一个进来的人(所以你宁愿和他们交谈,让更多的人为他们敞开心扉)。

于 2012-10-10T22:23:52.860 回答