3 ms·
What does that greedy algorithm work on, given that Facebook doesn't allow you to store a copy of the friend graph? At the point of notification, all you know i
by bemmu 18y ago
What does that greedy algorithm work on, given that Facebook doesn't allow you to store a copy of the friend graph? At the point of notification, all you know is a list of user IDs that have your application, and possibly how many friends each one has.
- jfarmer 18y agoWell, first, you can bend the rules. How does Facebook know whether you're storing the graph or not? They won't unless you violate the TOS in some other, more overt way. Second, Facebook's rules say you can't store it for more than 24 hours. The current copy of the graph is available via API calls -- just call getFriends for each user with a valid session. Third, if your app is big enough you can approximating it by seeing who sends notifications to whom, who clicks on newsfeed items, etc. Fourth, although I used Facebook as an example, this applies to any social network with a notification mechanism. I just used Facebook because it's easier to understand -- they limit the number of notifications at the API level.