## 3 Materials & Methods
### Graph Modeling  
The section describes the graph modelling of the proposed model. Graph modelling depends on graph theory and consists of nodes and edges. Due to the focus on the three specific areas (users and the relationships between them, topics and their relationships to each other, and the orientation between users and interested topics for each user), the proposed system is represented as a heterogeneous graph [46]. This differs from a homogeneous graph where all vertices represent identical entity classes, and all the edges link them [47]. Generally, this heterogeneous network consists of a users' graph and a topics graph. In the user graph, nodes will be users in a social network and edges connect similar users and have a weight of similarity. On the other hand, topics graph nodes will be topics in social media network which users discuss around. Furthermore, edges in topics graph connect similar topics and possess a weight based on semantic similarity, as shown in Figure 4.  
```
1:Input:\(U=\{u_{1},u_{2},\ldots,u_{n}\}\), \(P_{u}=\{P_{O},P_{C},P_{E},P_{A},P_{N}\}\),
2:\(D_{u}=\left\{D_{(age)},D_{(gender)}\right\}\), \(Z_{u}=\{z_{1},z_{2},\ldots,z_{n}\}\)
3:Output: Similarity between Users
4:Begin
5: Compute Similarity of big five personality traits
6:\(P_{user_{1}}\leftarrow\{Ext(user_{1})\), \(Ope(user_{1})\), \(Arg(user_{1})\), \(Neu(user_{1})\), \(Con(user_{1})\}\)
7:\(P_{user_{2}}\leftarrow\{Ext(user_{2})\), \(Ope(user_{2})\), \(Arg(user_{2})\), \(Neu(user_{2})\), \(Con(user_{2})\}\)
8:\(Per\_sim\)\(=\)\(persons\_correlation(P_{user_{1}},P_{user_{2}})\)
9: Compute similarity based on demographic data
10:\(D_{user_{1}}\leftarrow\{Age(user_{1}),Gender(user_{1})\}\)
11:\(D_{user_{2}}\leftarrow\{Age(user_{2}),Gender(user_{2})\}\)
12:\(Dem_{sim}\leftarrow\)\(cosine(P_{user_{1}},P_{user_{1}})\)
13: Interested topics extracted from each user
14:\(Interesting\_Topics\leftarrow\{z_{1},z_{2},\ldots,z_{n}\}\)
15: Calculate similarity from topic vectors
16:\(Top\_sim\)\(cosine(Interesting\_Topics(user_{1})\), \(Interesting\_Topic(user_{2}))\)
17: Set weight
18:\(\alpha\gets Weight\_Value\)
19: Get Users similarity
20:\(Users_{sim}\leftarrow\alpha*pre_{sim}+\alpha*Dem\_sim+(1-\alpha)*Top\_sim\)
21:End
```  
**Algorithm 1** Get Similarity between Users  
Subsequently, the topics are closeted in the topics graph to study the interests of users with a clarity and certainty, as the interests of users can be concentrated in one cluster. This facilitates recommendations for this user in terms of topics from the clusters that are concentrated in the user interest topics, as shown in Figure 5.  
Figure 4: Users-Topic Heterogeneous Graph. Figure 5: The Proposed Clustering Idea. There are also a set of topics \(Z\) and a set of users \(U\), as illustrated in Figure 6. Moreover, the model is represented as a heterogeneous graph \(G\) that is constructed from the merger of three subgraphs, such that \(G=(G_{U},G_{UZ},G_{Z})\). In the first case (User to User), the vertices of \(G_{U}\): \(U\to U\) represent a set of users, whereas its edges represent user relationships (user similarity, which is primarily personality relationships, demographic similarities, and topics similarity). For the second case (Topic to Topic) \(G_{Z}\): \(Z\to Z\), the vertices represent a set of users, whereas its edges represent topics relationships (semantic similarity). Additionally, it establishes interest topics in clusters. For the third case (User to Topic) \(G_{UZ}\): \(U\to U_{Z}\), this is a directed graph in which each edge links user and topic when user u is interested in a topic \(z\). In other words, in the graph network, there are three types of links, as shown in Figure 7. The first type is based on collaborative and demographic filtering (User similarity), as presented in Figure 7a. The second type represents the users' interest in a specific topic, as shown in Figure 7b. The final type is based on the content filtering (Topics similarity), as depicted in Figure 7c. The generation users graph is described in detail in Algorithm 2.