You will need a tree of some sort, and I'm tempted to say you might need to have to walk the tree, as I can't think of any other way to discover friends of friends x number of levels away. Could be a creative solution though...friendster may cheat in some way.
According to this page Friendster uses a connected component algorithm. http://www.rickbradley.com/chron/ Out of curiosity I looked into this algorithm and my brain started smoking. Definitely not an afternoon project :) >This is pretty off topic but I'm posting it here because I think it's an >interesting problem and there are some smart people here. (And any solution >developed would be in CF of course. ;) ) > >There are a couple of networking sites out there that are pretty popular. > >http://friendster.com >http://ryze.com > >In some ways they are just like most dating sites. People can come, post a >profile, and do simple searches to find other members. > >However, what's interesting is that they also allow you to see friends of >friends and display a path of the links in-between. > >Example: > >Joe signs up. Mary signs up. Mary finds out she is connected to Joe because >she is a friend with Mike who is friends Bob who is friends with Joe, and so >on. > >The question is. What would the best way to design such a site be? How >would you set up the database design? How would you structure the queries >efficiently to determine these links and have the site still function well >under load? > >Any push in the right direction is appreciated. > >thanks, > >-Benjamin > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com