Блог пользователя KoreanBoy

Автор KoreanBoy, 13 лет назад, По-английски

*

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
M pairs of people?
What does it mean? Are they friends if they are in pair?

What is group of friends?
if A and B are friends, B and C are friends too, is group {A,B,C} group of friends or not?
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
As I understood you just need an undirected graph.
This code generates a random test (n = 25000, m = 100000)with at least 3 groups.
http://pastebin.com/hnzCEuhg
This code also generates a random one(n = 25000, m = 300000), but there will be only one group of friends with high probability.
http://pastebin.com/rt3qnV7W