Page 1 of 1

how to count friends in social network

Posted: Sat Jun 09, 2007 3:05 pm
by itsmani1
HI
I want to count friends in a social network type system,
Like if A is friend of B and B is friend of C you can say A is connected with 2 peoples
now the thing is where there are so many users and they are connected with each other how to count them so that one user don't get repeats.
More importantly we also need to make sure if 50 user login at same time and server starts counting it don't gets down etc.

any idea or help?


thanks

Posted: Sat Jun 09, 2007 4:02 pm
by Ambush Commander
I don't think the behavior you're asking for is desirable. Visualize it like a net: people are connected with other people, who are connected with others, etc. Eventually, everyone is connected, and thus everybody is everybody's friend. We have algorithms for searching these sorts of nets, let alone counting them...

Counting immediate friends, however, is simple.

Posted: Mon Jun 11, 2007 2:45 am
by itsmani1
Ok,
Thanks for the reply man.
can you suggest any of the scripts?