Everyone has already heard about theories of six handshakes and the like. After hearing these, I rush to write a small userjs to the opera, (raw, not yet spread), which saves data from those pages of the site
vkontakte.ru , which I visited, namely lists of friends. All information is neatly added to the mysql database in the format id — friend id — Friend's name. I sat in contact after that, I was about 10 o'clock, getting on the pages of friends, and not only. I found out that I am familiar with Pavel Durov through 6 handshakes. (if anyone is interested, it was drawn clumsy, but the
graph of the dating chain).
I visited each of the pages personally.
I did not write any grabers, parsers, automata!So, in order to continue the experiment, I suggest:
Several Habrad volunteers can leave their comments on VKontakte profile id. Requirement - the list of friends must be open. I'm trying for a day to draw a chain of dating to Pavel Durov and to me.
UPD:Zivaka, id288968 (in id brackets):
Dmitry Zivaka Mamaev (288968) - Eugene <! - glazs -> Glazyrin (474078) - Leonid Kalentiev (424064) - Alex Alex Yumanov (9650028) [lived in the same hostel] - Damir ainu Fakhrutdinov (2416637) [I ]
AND:
Dmitry Zivaka Mamaev (288968) - Eugene <! - glazs -> Glazyrin (474078) - Leonid Kalentiev (424064) - Roman FotoGraf Hasayev (4459542) —Amir [Herr Mad] Ivanov (2315639) [former colleague] - Damir ainu Fakhrutdinov (2416637) [Me]
The rest of the updates under the cut
UPD2:bishop3000, id3624179:
Oleg bishop Fedorov (3624179) - Alexey Xor Sukhoruchko (782864) - Anna Chernykh (202063) - Alexander Viktorovich Bespalov (17) - Pavel Durov (1)
4 Handshakes to Durov, before me, respectively, 8 (Anna Chernykh (202063) and Mitenka Mironov (70) have several common acquaintances, and the latter is depicted on the graph)
UPD3: It is quite difficult to find connections from people who have closed lists of friends, or who are in Ukraine, Belarus, etc. Excuse me. I found seven people. I believe the experiment was considered successful. But not finished =)
UPD4: Kolger, id210630
Nikita Smirnov (210630) - Elena A. Popova (49838) - Nadya Petrova (3461) - Mitenka Mironov (70) —Alexander Bespalov (17) - Pavel Durov (1)
UPD5: Taxup, id1516701
Tahir ARES.KZ ™ Bikkinin (1516701) - Maxim Fridrikin (249136) - Andrey Lyubimov (61983) - Roman * RomaNTIC * Akamyolkov (219) - Pavel Durov (1)
UPD: VasilioRuzanni, id427647
Vasilio 'El Nino' ​​Ruzanni (427647) - Tatiana Tanni Real Ma Yongkina (148457) - Tatiana Plutalova (34) - Pavel Durov (1)
Thanks to Vasilio 'El Nino' ​​Ruzanni, a bug was detected in the script (quotes in the nickname + crooked SQL query = error)
lifeforweb id575175
Igor Gusarov (575175) - Taras Kutorov (604746) —Veniamin Meltsev (128195) - Ilya (NashRok-Piter) Sakmarov (94759) - Svetlana Klimicheva (822) —Asya Shchyol (254) - Pavel Durov (1)
UPD:Knowledgeable and able people - please! Tell me with the solution of the problem:
So, the problem: We have a graph. It is specified in the form of a table: Id, Id of a friend, name of a friend.
It is necessary to find the shortest path between the vertices of the graph, which are more than 5 edges apart.
Restrictions: the base in MySQL, the base is large, so you can not merge it all into an array. But it is possible to get a list of friends of a person. Getting a list of friends of the second circle takes from one to 5 seconds. Accordingly, the number of requests and execution time is limited (for example, the execution time of the script is 20 seconds). Wednesday: php5.
I have found a solution with 4 edges, by loading lists of friends of the second round, and their search among themselves.
There are 4 columns in the friends table: id, myid, frid, name. 1 key field, second person id, third friend id.
A piece of dump here . The table should not be called friends_copy, as in the dump, but friends.
Current search algorithm (only 4 handshakes):
ramainen.ru/i/download/graf.php.txtupd:rozboris id738345
Boris Rozboris Rosenstein (738345) - Ilya Petrovich Razenstein (721470) —Andrey Lopatin (11191) - Pavel Durov (1)
upd: The connection is not with Durov and with me (although it also exists), but between two habrachelovekami:
tinkk id888570,
Rchee id241410
Sergey t1nkk ... Ponomarenko (888 570) - Dasha * without_me * Shevlyakova (1,221,260) - Anja - Lady Fox - Hurhulu (2,379,374) - Elizabeth Likogra Kondakova (5,064,604) - Daniel Lenkov (896 189) - Roman Kubasov (384539) - Maxim Zakharov (274 521 ) - Art Loving myself Bandin (241410)
upd: kiroru id48437:
Kirill Kiro Pavlov (48437) - Yevgeny Andrianov (2108557) —Nargiz Narciss Kulizade (967409) - Denis AIK Schetnev (332306) - Elvira * Ryzhaya_ Velha * Habibulin (779335) —Diana Kayumova (6753283) I-year I-40 Ibrah Habibulin (779335) - Id actor Ibrahb Habibulin (779335) —Diana Kayumova (6753283) Iryfor Id Habibulin (779335) ]
AND:
Kirill Kiro Pavlov (48437) - Yevgeny Andrianov (2108557) —Nargiz Narciss Kulizade (967409) - Denis AIK Schetnev (332306) - Elvira * Ryzhaya_ Velha * Khabibulin (779335) - Alexander “Erandill” Yevra (12 it 12 it it ) 12 33 12 12 12 12 12 12 12 12 7 7 7 7 7 7 ) —Tatyana Plutalova (34) —Pavel Durov (1)
upd: habrachelovek Timon, id222737
Pavel Durov (1) - Alexander Viktorovich Bespalov (17) - Anna Chernykh (202063) - Anton Prozorov (1188737) - Elizaveta Gavrilova (114645) —Natalya Uliankova (119648) - Tatyana Yaikina (10338577) - Maria Chernysheva (14335577) - Timur Timurka Tazetdinov (222737)
upd: zemlanin id6821354
Anton zemlanin Verinov (6821354) - Alexey Woody Hudochenkov (5021145) - Galina Cheshuinova (7327547) - Arthur Araslanov (1562516) - Pulat Salikhov (1178113) - Aliya Islamova (4218480) - Damir ainu Fakhrutdinov (2416637)))
AND:
Anton zemlanin Verinov (6821354) - Aleksey Woody Khudochenkov (5021145) - Galina Cheshuinova (7327547) - Arthur Araslanov (1562516) - Anastasia Yurina (160885) - Rail Zamaletdinov (676776) - Damir ainu Fakhrutdinov (2416637)
UPD:I apologize if I missed someone! There were many requests, some closed lists of friends, some did not work out. So, Count:

Habralyudi, me and Pavel Durov are highlighted.