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.