## 3 Problem Formulation
### Attributes Similarity Scoring Function  
We evaluate the similarity between users from two aspects: text attributes and spatial attributes. For text attribute similarity, Jaccard similarity is usually preferred, which means that the more attributes shared between two nodes there are, the more similar they are. Nevertheless, Jaccard similarity treats all attributes equally, ignoring the corresponding weights, which is inconsistent with the problem studied in our paper. Therefore, we design an improved cosine similarity method to measure their textual similarity. Let \(A(u)=\big{\{}A_{1}(u),A_{2}(u),\ldots,A_{l_{1}}(u)\big{\}}\) and \(A(v)=\big{\{}A_{1}(v),A_{2}(v),\ldots,A_{l_{2}}(v)\big{\}}\) be the attribute set of \(u\) and \(v\), where \(l_{1}\) does not have to equal \(l_{2}\). Their corresponding weights are \(W(u)=\big{\{}W_{1}(u),W_{2}(u),\ldots,W_{l_{1}}(u)\big{\}}\) and \(W(v)=\big{\{}W_{1}(v),W_{2}(v),\ldots,W_{l_{2}}(v)\big{\}}\). In order to compare the similarity of node attributes in the same dimensions, we integrate their attribute sets as \(A(u,v)=A(u)\cup A(v)=\big{\{}A_{1}(u,v),A_{2}(u,v),\ldots,A_{l\_{dimen}}(u,v) \big{\}}\), where \(l\_dimen=|A(u,v)|\), representing the size of the attribute set \(A(u,v)\) without duplicate attributes. Then, taking \(A(u,v)\) as the metric space, we design the attribute weight vector of node \(v\) as \(Vec(v)=(Vec_{1}(v),Vec_{2}(v),\ldots,Vec_{l\_dimen}(v))\). For attribute weight vector \(Vec(v)\), if \(A_{i}(u,v)\in A(v)\), \(i=1,\ldots,l\_dimen\), make \(Vec_{i}(v)=W_{i}(v)\), otherwise \(Vec_{i}(v)=0\). We construct the vector \(Vec(u)=(Vec_{1}(u),Vec_{2}(u),\ldots,Vec_{l\_dimen}(u))\) in the same way. When comparing with different users, the attribute weight vector of \(v\) may be different due to the different metric space. Now, we define the text attribute similarity function of node \(u\) and \(v\) as  
\[\mathit{CosTime}(u,v)=\frac{\mathit{Vec}(u)\cdot\mathit{Vec}(v)}{\|\mathit{Vec }(u)\|\ \|\mathit{Vec}(v)\|} \tag{6}\]  
where \(Vec(u)\) and \(Vec(v)\) are the attribute weight vector of node \(u\) and \(v\), and \(Vec(u)\cdot\mathit{Vec}(v)\) represents the dot product of \(Vec(u)\) and \(Vec(v)\), \(\|Vec(u)\|\) and \(\|Vec(v)\|\) are the lengths of \(Vec(u)\) and \(Vec(v)\). The more shared attributes and the greater the weight of shared attributes, the more similar they are in textual attributes. As shown in Figure 1, we take \(q\) as the query node, \(V_{0}\) and \(V_{1}\) as candidate nodes, and then calculate the similarity with \(q\). If Jaccard is employed, \(Jaccard(q,V_{0})=0.5\), \(Jaccard(q,V_{1})=0.8\), and \(V_{1}\) should be the target node. However, the weights of shared attributes in \(q\) are small, which can not sufficiently represent \(q\)'s interests. When we take \(\mathit{CosTime}\) as the similarity function, \(\mathit{CosTime}(q,V_{0})=0.787\), \(\mathit{CosTime}(q,V_{1})=0.67\), then \(V_{0}\) should be selected due to the shared attributes' own larger weights, and they are more suitable to describe \(q\)'s short-term interests. For spatial attributes, we adopt Euclidean distance to measure the spatial similarity of nodes. Given the nodes' locations according to Formula (4) and (5), we define their spatial similarity as  
\[\mathit{GSim}(u,v)=\frac{1}{1+\mathit{dist}(u,v)} \tag{7}\]  
where \(\mathit{dist}(u,v)\) is the Euclidean distance between \(u\) and \(v\). Obviously, the greater the distance, the lower the similarity. To comprehensively evaluate various attributes, we employ parameter \(\alpha\) to balance text attributes and spatial attributes. Then, the similarity of nodes is  
\[\mathit{TScore}(u,v)=\alpha\mathit{CosTime}(u,v)+(1-\alpha)\mathit{GSim}(u,v) \tag{8}\]  
Note that \(\mathit{CosTime}(u,v)\in[0,1]\), \(\mathit{GSim}(u,v)\in[0,1]\), so \(\mathit{TScore}(u,v)\in[0,1]\). In this paper, we assume that the greater the \(\mathit{TScore}(u,v)\), the higher the similarity. Based on the attribute similarity of nodes, we define the score of the graph as follows. **Definition 2**.