I think that the acs_rels system of openacs could be a very good foundation for it. At least that seems to be a use case where having the ability to permission and otherwise explicitely deal with relationships actually make sense, so the implementation of acs_rels as acs_objects is very useful in this case.
And if the levels of separation between users that you query for remain low (I remember that friendster seldom goes deeper than 4 levels), it should be possible to do queries by joining acs_rels against itself a few times - as often as many levels you are interested in.