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
how to count friends in social network
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
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.
Counting immediate friends, however, is simple.