The PINQ agent is in charge of guaranteeing that the budget is not exceeded when answering to multiple queries over the same dataset. In line 7, we instantiate an object Us with the preference tuples, which can be queried in a differentially-private fashion according to the agent policies. Then (lines 9 and 10), we query Us to count, applying differential privacy, the number of recommendation by users of stereotype s for each POI p; for each query, we spend a budget b. We repeat this procedure for each stereotype in S (lines 4 to 12). Finally, the obtained differentially-private statistics DPS are returned.
The above statistics are used by the POI-recommendations algorithm (Algorithm 2) to retrieve actual POIs recommendations upon user’s request. The algorithm takes as input also the requested number k of recommendations, the spatial granule g that includes the user, her stereotype s, her interest categories I, and the set of POIs P. The set G of spatial granules in which POIs are searched is instantiated with g (line 3), and the set R of POIs to be recommended is instantiated with the empty set (line 4). Then (lines 5 to 14), the algorithm queries the DPS until the desired number of POIs is reached. At first, the initial candidate set C of POIs (i.e., those in G and belonging to at least one category in I) is retrieved (line 6). From that set, we select those POIs that received a large number of preferences from users of stereotype s, to create a new set Rc of POIs to be actually recommended to the user (line 7). If Rc contains too few POIs (lines 8 to 10), we enlarge the query region G to include contiguous spatial granules, and we repeat the algorithm from line 5. Otherwise (lines 11 to 13), we get the k POIs in Rc that received the highest number of preferences from users in s, and return them to the user.