This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Efficient algorithm based on non-backtracking matrix for community detection in signed networks

Zhaoyue Zhong2, Xiangrong Wang34, Cunquan Qu12, Guanghui Wang12 Corresponding author: [email protected] (C.Qu) 1Data Science Institute, Shandong Univeristy, China 2School of Mathematics, Shandong University, China 3Institute of Future Networks, Southern University of Science and Technology, Shenzhen, China 4Research Center of Networks and Communications, Peng Cheng Laboratory, Shenzhen, China
Abstract

Community detection or clustering is a crucial task for understanding the structure of complex systems. In some networks, nodes are permitted to be linked by either ”positive” or ”negative” edges; such networks are called signed networks. Discovering communities in signed networks is more challenging than that in unsigned networks. In this study, we innovatively develop a non-backtracking matrix of signed networks, theoretically derive a detectability threshold for this matrix, and demonstrate the feasibility of using the matrix for community detection. We further improve the developed matrix by considering the balanced paths in the network (referred to as a balanced non-backtracking matrix). Simulation results demonstrate that the algorithm based on the balanced non-backtracking matrix significantly outperforms those based on the adjacency matrix and the signed non-backtracking matrix. The proposed (improved) matrix shows great potential for detecting communities with or without overlap.

Index Terms:
Community detection, signed networks, non-backtracking matrix, spectral analysis, detectability threshold.

I Introduction

Communities, also known as clusters or modules, are groups of nodes that may share common attributes or have similar properties in a graph. Community detection involves division of similar nodes or nodes with many (positive, large weighted) connections into a group, thereby providing a possible approach for controlling the network. Since nodes with many (positive) connected edges often have similar properties, in terms of graphs, community detection is also a process of finding cut edges. If a few edges are removed, the network can be divided into several parts, and then, the division of these parts is, to a certain extend, equivalent to community partition.

Community detection is widely applied in fields such as biology, computer science, engineering, economics, political science, and sociology [1]. For example, protein-protein interaction networks are a research hotspot in biology and bioinformatics [2]. The interaction between proteins is the basis of every process in the cell. Each interaction is observed experimentally and marked as a connection. Proteins with the same or similar functions are grouped into one module and are expected to participate in the same process. This is a classical application that conceptualizes the actual scenario as an unsigned network. A social network is also a typical example of a network with a community structure. In general research, a connection in as social network is regarded as being positive, e.g., followers, likes, and message forwarding. However, social networks often contain many negative connections. For example, some websites such as epinions.com and slashdot.com permit users to identify friends and enemies [3]. The signed network introduced in the present study represents such a scenario, i.e., opposite opinions on the same topic [3] and blackout and reporting among users.

In the 1940s [4], Heider introduced the concept of signed networks and proposed the well-known structural balance theory, which states ”the friends of my friends, as well as the enemies of my enemies, are my friends”(see in Fig. 1). This theory, which is one of the most popular social science theories has recently been receiving increasing attention. A related research topic is to design algorithms for computing the structural balance of large-scale datasets [5, 6, 7]. Another research topic is the study of the impact of structural balance on some concrete applications, such as recommender systems [8] and dynamic processes [9].

\includegraphics

[width = 0.9]triangles.eps

Figure 1: Triangles in signed networks. T1T_{1} and T2T_{2} are balanced and relatively stable. T3T_{3} and T4T_{4} are unbalanced and hence likely to break apart.

In social networks, user communities provide valuable services for websites, such as friend recommendations for users. Clustering of web pages can be used to rank them and provide more relevant search results [1]. Furthermore, the use of community detection in social media can clearly explain the observed phenomena and provide benchmarks for social mechanisms [10].

The following are some of the categories into which existing method for community detection can typically be classified: (1) conventional algorithms such as graph partitioning [11], hierarchical clustering [12], partition clustering [13], and spectral clustering [14]; (2) modular-based methods [15]; (3) dynamic algorithms [16, 17]; and (4) methods based on statistical inference [18]. Most of these algorithms are for unsigned networks. However, community detection in signed networks is a more challenging task, because of the distinct roles of the negative inter-community and intra-community links. In general, negative inter-community links segregate the connected communities whereas negative the inter-community links blur the community structure.

In this study, we mainly consider the spectrum method for detecting the community structure. For community detection in unsigned networks, the adjacency matrix [19], Laplacian matrix [20], non-backtracking matrix [21], and other structure-related matrices have been used, whereas for community detection in signed networks, the adjacency matrix has been explored [22].

The remainder of this paper is organized as follows. First, in Sec.II, we define the necessary notations and propose the definition of the non-backtracking matrix. We take full advantage of the structural balance theory to propose the signed non-backtracking (SNBT) matrix of signed networks. In Sec.III, we derive a theoretical detection threshold μc>c\mu_{c}>\sqrt{c} (where μc\mu_{c} is a community-correlated eigenvalue and cc is the average degree of the network) and theoretically demonstrate the feasibility of using the SNBT matrix for community detection above the detectability threshold. In Sec.IV, we introduce an improved version of the SNBT matrix, termed the balanced non-backtracking (BNBT) matrix, and propose an efficient community detection algorithm based on the BNBT matrix. In Sec.V, we present numerical simulations performed for demonstrating the effectiveness of the SNBT matrix vis-à-vis the adjacency matrix in community detection. Through experiments on signed stochastic block networks and real-world networks, we show that BNBT matrix-based approach has the best performance among the three approaches based on these three matrices. Finally, in Sec.VI, we conclude the paper.

II Non-backtracking matrix for signed networks

II-A Signed stochastic block model

Signed networks consist of interacting individuals with both positive and negative relationships. Each individual in the network corresponds to a node in the graph. The connection between a pair of individuals is regarded as the edge between the corresponding node pair. Positive and negative relationships are represented as positive and negative edges in the network. For simplicity, the weights of positive and negative edges are defined as 11 and 1-1, respectively.

First, we describe the signed stochastic block model [21, 22, 23]. Given an undirected network with nn nodes (where nn is assumed to be an even number), we divide the node set into two groups, 𝒜\mathcal{A} and \mathcal{B}, where each group has n/2n/2 nodes. Nodes in group 𝒜\mathcal{A} are indexed from 11 to n/2n/2 and those in group \mathcal{B} are indexed from n/2+1n/2+1 to nn.

A signed network can be represented by an adjacency matrix AA in which the entries take on values of {1,1,0}\left\{1,-1,0\right\}, where 0 signifies the absence of an edge, and 11 and 1-1 signify a positive relationship and negative relationship, respectively. The adjacency matrix is symmetric because the network is undirected. The following are some of the parameters for any pair of nodes (i,j)(i,j). The probability of formation of an edge between any given in-group (out-group) node pair is dind_{in} (doutd_{out}). The expected edge density of the entire network is d=din+doutd=d_{in}+d_{out}. Given the presence of an edge between in-group members, pin+p_{in}^{+} denotes the conditional probability that it will be positive. Analogously, pout+p_{out}^{+}, pinp_{in}^{-}, and poutp_{out}^{-} denote the conditional probabilities of a positive edge between out-group members, a negative edge between in-group members, and a negative edge between out-group members, respectively. Thus, the conditional probabilities satisfy pin++pin=1p_{in}^{+}+p_{in}^{-}=1 and pout++pout=1p_{out}^{+}+p_{out}^{-}=1.

Generally speaking, when we say that a network has a community structure, at least one of the following conditions holds:

  1. 1.

    The number of positive intra-community links is greater than the number of negative links, i.e., pin+>pout+p_{in}^{+}>p_{out}^{+} and pin<poutp_{in}^{-}<p_{out}^{-}.

  2. 2.

    The density of intra-community links is higher than that of inter-community relationships, i.e., din>doutd_{in}>d_{out}.

Under the first condition, the community structure is termed relationship-sensitive and is denoted as r-community. Under the second condition, the community structure is termed link-density-sensitive and denoted as d-community.

II-B Definition of non-backtracking matrix

One of the main contributions of this work is to define non-backtracking matrices for signed networks, which have great potential for community detection. Though a non-backtracking matrix of unsigned networks is well defined–which is presented herein for completeness–a proper definition of a non-backtracking matrix is far from trivial, as demonstrated in following sections.

Prior to providing a formal definition of a non-backtracking matrix of signed networks, we first present the definition of a non-backtracking matrix of unsigned or general networks. The non-backtracking matrix H~\widetilde{H}, often termed the HashimotoHashimoto matrix in mathematics, is defined as follows:

H~(uv),(wx)=A~(u,v)A~(w,x)𝟏(v=w)𝟏(ux),\widetilde{H}_{(u\rightarrow v),(w\rightarrow x)}=\widetilde{A}_{(u,v)}\widetilde{A}_{(w,x)}\mathbf{1}(v=w)\mathbf{1}(u\neq x), (1)

where A~\widetilde{A} is the adjacency matrix of the unsigned network and e=(u,v)e=(u,v) and f=(w,x)f=(w,x) are two directed edges. It should be noted that if the network is undirected, we treat each undirected edge as two directed edges. Hence, the matrix H~\widetilde{H} has the dimensions 2m×2m2m\times 2m, where mm is the number of edges in the network.

The non-backtracking matrix H~2m×2m\widetilde{H}_{2m\times 2m} can, in fact, be expressed as

H~(uv),(wx)={1ifv=wandux,0otherwise.\widetilde{H}_{(u\rightarrow v),(w\rightarrow x)}=\begin{cases}1&\text{if}\ v=w\ \text{and}\ u\not=x,\\ 0&\text{otherwise}.\end{cases} (2)

Similar to the matrix H~\widetilde{H} defined in Eq.(1), the SNBT matrix of signed networks, denoted as HH, can be directly derived as follows:

H(uv),(wx)=A(u,v)A(w,x)𝟏(v=w)𝟏(ux).H_{(u\rightarrow v),(w\rightarrow x)}=A_{(u,v)}A_{(w,x)}\mathbf{1}(v=w)\mathbf{1}(u\neq x). (3)

This matrix can be expressed as

H(uv),(wx)={1ifv=w,uxandσ(uv)=σ(wx),1ifv=w,uxandσ(uv)σ(wx),0otherwise,H_{(u\rightarrow v),(w\rightarrow x)}=\begin{cases}1&\text{if}\ v=w,u\not=x\ \text{and}\\ &\sigma(u\rightarrow v)=\sigma(w\rightarrow x),\\ -1&\text{if}\ v=w,u\not=x\ \text{and}\\ &\sigma(u\rightarrow v)\not=\sigma(w\rightarrow x),\\ 0&\text{otherwise},\end{cases} (4)

where σ(uv)\sigma\left(u\rightarrow v\right) denotes the sign of a directed edge uvu\rightarrow v, which takes a value of either 11 or 1-1. The significance of the defined non-backtracking matrix HH is that true information will be transferred between two edge pairs with identical signs and false information will be transferred between two edge pairs with different signs, and this behavior accurately follows the structural balance theory (a triple with either one or three negative signs is unstable).

On the basis of the information flowing along the directed edges in the network, HH can also be deduced via linearized belief propagation (LBP). This is explained in greater detail in Appendix A.

In other words, we define the non-backtracking matrix from two different perspectives, theoretically deduce its role in community detection, and confirm the feasibility of its application to a basic stochastic block model via the linearization of the updating equation of the BP algorithm around a fixed point.

III Theoretical analysis

III-A Analytical derivation of community detection threshold and detection vector

To demonstrate the applicability of the SBNT matrix to community detection, we derive the community detection threshold and a detection vector for an arbitrary signed network. By generalization on the basis of observations in unsigned networks [21, 24, 25, 26], we define goutg^{out} and ging^{in} as nn-dimensional vectors:

guout=v𝒩(u)guvσ(uv),g^{out}_{u}=\sum_{v\in\mathcal{N}(u)}g_{u\rightarrow v}\cdot\sigma(u\rightarrow v),
guin=v𝒩(u)gvuσ(vu),g^{in}_{u}=\sum_{v\in\mathcal{N}(u)}g_{v\rightarrow u}\cdot\sigma(v\rightarrow u),

where 𝒩(u)\mathcal{N}(u) denotes the neighbor set of node uu and vector gg is a given vector with 2m dimensions. Unlike in the case of unsigned network, we not only sum over incoming and outgoing edges but also consider the sign of the edges.

By applying HH to gg, we get

(Hg)uout=v𝒩(u)gvoutguin,(Hg)_{u}^{out}=\sum_{v\in\mathcal{N}(u)}g_{v}^{out}-g_{u}^{in},
(Hg)uin=(ku1)v𝒩(u)gvout,(Hg)_{u}^{in}=(k_{u}-1)\sum_{v\in\mathcal{N}(u)}g_{v}^{out},

where kuk_{u} denotes the degree of node uu (which is independent of the sign of the edges). Rewriting the above two equations in matrix form gives

((Hg)in(Hg)out)=H(gingout),\begin{pmatrix}(Hg)^{in}\\ (Hg)^{out}\end{pmatrix}=H^{\prime}\begin{pmatrix}g^{in}\\ g^{out}\end{pmatrix},
H=(0DIIA~),H^{\prime}=\begin{pmatrix}0&D-I\\ -I&\widetilde{A}\end{pmatrix}, (5)

where II is the identity matrix, DD is the diagonal matrix of vertex degrees, and A~\widetilde{A} is the adjacency matrix of the underlying unsigned structure corresponding to the signed network.

Suppose that Hg=μgHg=\mu g; then, we have

μ(gingout)=H(gingout).\mu\begin{pmatrix}g^{in}\\ g^{out}\end{pmatrix}=H^{\prime}\cdot\begin{pmatrix}g^{in}\\ g^{out}\end{pmatrix}.

If ging^{in} and goutg^{out} are nonzero, then (gingout)\begin{pmatrix}g^{in}\\ g^{out}\end{pmatrix} is an eigenvector of HH^{\prime} with the same eigenvalue μ\mu. Hence,

μgout=A~goutgin=[A~μ1(DI)]gout.\mu g^{out}=\widetilde{A}\cdot g^{out}-g^{in}=[\widetilde{A}-\mu^{-1}(D-I)]g^{out}.

Therefore, μ\mu is a root of the quadratic eigenvalue equation

det|μ2IμA~+(DI)|=0.det\left|\mu^{2}I-\mu\widetilde{A}+(D-I)\right|=0. (6)

The complexity of calculating the eigenvalues of HH^{\prime} will be much lower than that of the original non-backtracking matrix HH. Eq.(6) is well known in the theory of graph zeta functions [26]. It accounts for 2n2n of the eigenvalues of HH, and the remaining 2m2n2m-2n eigenvalues are ±1\pm 1.

In fact, we directly and simply prove that the spectrum of HH is the same as that of H~\widetilde{H}, where the network for the latter matrix is considered as an unsigned network. HH can also be derived via multiplication of all the elements of some rows and their corresponding columns in H~\widetilde{H} by 1-1, that is,

det|λIH|=(1)2|ϵ|det|λIH~|=det|λIH~|,det\left|\lambda I-H\right|=(-1)^{2\left|\epsilon_{-}\right|}\cdot det\left|\lambda I-\widetilde{H}\right|=det\left|\lambda I-\widetilde{H}\right|, (7)

where |ϵ|\left|\epsilon_{-}\right| is the number of negative edges in the network.

Therefore, the bulk of the spectrum BB is also confined to the radius disk c\sqrt{c} in signed networks. It should be noted that c=dnc=d\cdot n is the average degree of the network. We can similarly and correspondingly define cinc_{in} and coutc_{out}.

Further, we obtain the first and second eigenvalues of HH as

{μ1cμ2μc=cincout2=dindout2n.\begin{cases}\mu_{1}\approx c\\ \mu_{2}\approx\mu_{c}=\dfrac{c_{in}-c_{out}}{2}=\dfrac{d_{in}-d_{out}}{2}n\end{cases}. (8)

In the unsigned network, the second eigenvector of the non-backtracking matrix is a community-correlated eigenvector. If the second eigenvalue of H~\widetilde{H} is separated from the bulk of the spectrum, then the eigenvector corresponding to the second eigenvalue can be used in the community detection (via labeling of the vertices according to the sign of the sum of all incoming edges at each vertex) [27]. Similar conclusions for signed networks are verified subsequently in the paper.

Next, we first attempt to construct a vector gg that is correlated to the communities and is an approximate eigenvector with eigenvalue μc\mu_{c}. We assume that c=O(1)c=O(1), and therefore the graph is sparse and locally tree-like. For any positive integer rr and any directed edge (u,v)(u,v), we define the following:

guv(r)=μcr(w,x):d(uv,wx)=rσxσuv,g_{u\rightarrow v}^{(r)}=\mu_{c}^{-r}\cdot\sum_{(w,x):d(u\rightarrow v,w\rightarrow x)=r}\sigma_{x}\cdot\sigma_{u\rightarrow v},

where σx=±1\sigma_{x}=\pm 1 denotes the community of xx, σuv=±1\sigma_{u\rightarrow v}=\pm 1 denotes the sign of edge (u,v)(u,v), and d(uv,wx)d(u\rightarrow v,w\rightarrow x) denotes the number of steps required to go from uvu\rightarrow v to wxw\rightarrow x in the graph of directed edges, as shown in Fig. 2.

\includegraphics

[width=0.6]cal_distance.eps

Figure 2: Illustration of calculation of d(uv,wx)d(u\rightarrow v,w\rightarrow x). A transverse of two edges y1z1y_{1}\rightarrow z_{1} and z1wz_{1}\rightarrow w needs to be considered to go from edge xy1x\rightarrow y_{1} to edge z1wz_{1}\rightarrow w. Thus, d(xy1,z1w)=2d(x\rightarrow y_{1},z_{1}\rightarrow w)=2.

Application of HH to g(r)g^{(r)} gives

(Hg(r))uv=μcr(w,x):d(uv,wx)=r+1σxσuv,(Hg^{(r)})_{u\rightarrow v}=\mu_{c}^{-r}\cdot\sum_{(w,x):d(u\rightarrow v,w\rightarrow x)=r+1}\sigma_{x}\cdot\sigma_{u\rightarrow v},

which can be simplified as

(Hg(r))uv=μcguv(r+1)(Hg^{(r)})_{u\rightarrow v}=\mu_{c}\cdot g_{u\rightarrow v}^{(r+1)}

We can write guv(r)guv(r+1)g_{u\rightarrow v}^{(r)}-g_{u\rightarrow v}^{(r+1)} as

μcrσuv(w,x):d(uv,wx)=r(σxμc1yN(x)wσy).\mu_{c}^{-r}\cdot\sigma_{u\rightarrow v}\cdot\sum_{(w,x):d(u\rightarrow v,w\rightarrow x)=r}(\sigma_{x}-\mu_{c}^{-1}\sum_{y\in N(x)\setminus w}\sigma_{y}).

Now, there are (an expected) crc^{r} terms in this sum, each of which is conditioned on σx\sigma_{x} values and has an expected value of zero and a constant variance. Hence,

E[(guv(r)guv(r+1))2]=O(crμc2r).E[(g_{u\rightarrow v}^{(r)}-g_{u\rightarrow v}^{(r+1)})^{2}]=O(c^{r}\mu_{c}^{-2r}).

By summing over all the edges, we obtain

E[(g(r)g(r+1))2]=O(crμc2r|E|).E[(g^{(r)}-g^{(r+1)})^{2}]=O(c^{r}\mu_{c}^{-2r}\left|E\right|).

Therefore, when the community-correlated eigenvalue (the second eigenvalue) satisfies

μc>c,\mu_{c}>\sqrt{c}, (9)

it can be naturally considered that when this eigenvalue is separated from the bulk spectrum, the error is small and it approaches zero for large rr. Further, from the conclusion for unsigned networks [28, 29], it can be inferred that, under the condition that the threshold is met and nn\rightarrow\infty, for every uvu\rightarrow v,

<guv(r),σuσuv>0.<g_{u\rightarrow v}^{(r)},\sigma_{u}\cdot\sigma_{u\rightarrow v}>\neq 0.

Thus, we can draw the following conclusion:

|Hg(r)μcg(r)|=o(1).\left|Hg^{(r)}-\mu_{c}g^{(r)}\right|=o(1).

Therefore, g(r)g^{(r)} is indeed an approximate eigenvector of HH having an eigenvalue of μc\mu_{c}, which may be used to detect the community structure of signed networks. Further, Eq.(9) expresses the detection threshold finally derived in this study, which shows agreement with the threshold for unsigned networks.

III-B Threshold for the case of more than two communities

The above-presented analysis is for stochastic block models with two communities (q=2q=2). In fact, according to the above-described derivation process, the SNBT matrix can also be well applied to a model with more than two communities (q>2q>2). Its detectable threshold should be similar to the conclusion for the unsigned network; that is, the community-correlated eigenvalue satisfies Eq.(9), i.e., μc>c\mu_{c}>\sqrt{c}.

In this case, the second eigenvalue is given as

μ2cincoutq=dindoutqn.\mu_{2}\approx\dfrac{c_{in}-c_{out}}{q}=\dfrac{d_{in}-d_{out}}{q}n.

We can take the first kk eigenvectors and use the k-means algorithm to determine the group labels of the nodes. However, the threshold value for detection of the network structure using the adjacency matrix when the number of communities is greater than two is yet unknown; therefore, we refrain from performing a more detailed comparative evaluation here.

IV Algorithm for community detection

IV-A Improved non-backtracking matrix for community detection in signed networks

From the above analysis, we know that the SNBT matrix is density sensitive rather than sign sensitive. Even in the case where the negative edges of inter-community connections and the positive edges of intra-community connections constitute the majority of the edges in the connections, the final results are not ideal as long as the density of connected edges within and between groups exceeds the above-derived threshold value. This insensitivity of the SNBT matrix to edge signs is essentially contrary to our original goal of exploring the community structure of signed networks

In fact, from the below-described threshold of the adjacency matrix, we can see that this matrix is only sign-sensitive and that is, too, does not meet our requirements for community detection. The ideal matrix should have good performance in terms of both aspects; that is, it should be both sign-sensitive and density-sensitive.

We considered both the structural balance theory and the BP theory in the construction of the non-backtracking matrix. Why does this sign insensitivity occur? We find from the discussion in Sec.IIIA that the approximation of the second eigenvector is actually related only to the kk-order neighbors of node xx, which is simply equal to the total number of communities the node belongs to and whether or not the path between two nodes is balanced, i.e., whether the internal relationship is friendly or hostile, is not considered.

Hence, we improve the matrix by making the following assumption. We assume that a large number of balanced or stable paths of a given length kk between two vertices uu and vv is expected if both the vertices belong to the same community. Then, the improved matrix, denoted by HbH^{b}, is defined as follows:

H(uv),(wx)b=𝟏(v=w)𝟏(ux)𝟏(AeAf=1).H^{b}_{(u\rightarrow v),(w\rightarrow x)}=\mathbf{1}(v=w)\mathbf{1}(u\neq x)\mathbf{1}(A_{e}\cdot A_{f}=1). (10)

This matrix can alternatively be expressed as

H(uv),(wx)b={1ifv=w,uxandσ(uv)=σ(wx),0otherwise.H^{b}_{(u\rightarrow v),(w\rightarrow x)}=\begin{cases}1&\text{if}\ v=w,u\not=x\ \text{and}\\ &\sigma(u\rightarrow v)=\sigma(w\rightarrow x),\\ 0&\text{otherwise}.\end{cases} (11)

Therefore, according to the BP algorithm, during the propagation process, only true information is transmitted to edges with same signs, and false information is transmitted to edges with different signs. For simplicity, we term this matrix the BNBT matrix. In fact, HbH^{b} is an approximation of HH, and the detection threshold for community detection is still unclear. However, the below-described experiments demonstrate that this improved matrix is ideal for community detection.

IV-B Community detection algorithms

In this section, we provide a detailed description of the community detection algorithm based on the BNBT matrix. We calculate the first q1q-1 eigenvectors of the adjacency matrix for performing clustering using the kk-means algorithm. Because the detection accuracy of BNBT matrix is not validated theoretically and the community-related eigenvectors of the BNBT matrix are also unclear, we perform clustering using all eigenvectors corresponding to the real eigenvalues. When applying the SNBT-matrix-based algorithm, we calculate the first min{q,r}\min\{q,r\}, where rr is the number of real eigenvalues.

{algorithm}

[htb] Framework for community detection in signed networks. {algorithmic}[1] \REQUIRE  
Adjacency matrix of network AA;
Number of communities qq;
\ENSURE  
\STATEThe BNBT matrix HbH^{b} is constructed according to Eq.(11); \STATEThe eigenvectors [ξ2,ξ3,,ξr][\xi_{2},\xi_{3},\dots,\xi_{r}] corresponding to the real eigenvalues, where rr is the number of real eigenvalues, are calculated; here, each (r1)(r-1)th-row vector represents a directed link; \STATEFor each node uu, weighted summation of all the vectors of its out-edges (u,v)(u,v), v𝒩(u)v\in\mathcal{N}(u) is performed to obtain its representative vector; \STATEThen, clustering is performed using the kk-means algorithm to obtain the group label g~\widetilde{g} of the nodes; \RETURNg~\widetilde{g}.

In the following section, we compare the community detection performances of the three matrices.

V Results

To evaluate the community detection performances of the SBNT matrix (HH) and BNBT matrix (HbH^{b}), we perform extensive simulations on signed networks. The accuracy of community detection is quantified by the concept of overlap [21], which is defined as the ratio of the number of correctly predicted nodes to the total number of nodes. Overlap can be expressed as

ovl=1nuδgu,g~u,ovl=\dfrac{1}{n}\sum_{u}\delta_{g_{u},\widetilde{g}_{u}},

where gug_{u} is the actual group label of vertex uu, and g~u\widetilde{g}_{u} is the label inferred by the algorithm. When gu=g~ug_{u}=\widetilde{g}_{u} for every node uu, we have ovl=1ovl=1 and the detection accuracy is 100%\%.

We break symmetry by maximizing the overall q!q! permutations of the groups, where qq is the number of groups into which the nodes are divided. The prediction is accurate when the overlap equals 11, and under this definition, the minimum value of the overlap can be taken as 1/q1/q. The overlap is normalized as

ovl=(1nuδgu,g~u1q)/(11q).ovl=(\dfrac{1}{n}\sum_{u}\delta_{g_{u},\widetilde{g}_{u}}-\dfrac{1}{q})/(1-\dfrac{1}{q}).

The overlap ranges from 0 to 1, where a value of 0 implies that the prediction is inaccurate because of random grouping. For visualization purposes, we still use the un-normalized overlap in the below-described numerical simulations.

V-A Comparison with adjacency-matrix-based detection

In unsigned networks, most of the eigenvalues of the adjacency matrix are within a threshold. The number of eigenvalues beyond the threshold equals the number of communities. The second eigenvector indicates the community structure[21].

\includegraphics

[width=0.9]thrsh_nonvsadj.eps

Figure 3: Detection threshold of non-backtracking matrix. pin+=poutp_{in}^{+}=p_{out}^{-} and n=100n=100. The red surface indicates the boundary that can be detected by the proposed (points in regions 1&\&2 can be detected), whereas the blue surface indicates the boundary that can be detected by the adjacency-matrix-based algorithm (points in regions 1&\&3 can be detected).

Similar results have been reported in [22], that is, the bulk of the spectrum of the adjacency matrix is also within a threshold for signed networks. Unlike in the case of the unsigned network, in the signed network, the leading eigenvector represents the community structure, and the number of eigenvalues beyond the threshold is no longer equal to the number of communities (it should be equal to the number of communities minus 1). Moreover, the authors of [22] were the first to consider the detectability transition in signed networks. They concluded that when there are only two communities, as long as the following conditions (Eq.66 in [22]) are met, the sign of the principal eigenvector can be used to detect communities using perturbation analysis and random matrix theory.

pout>12dindout(pin+12)+1doutdin+dout8din2(pin+12)22n.\begin{split}p_{out}^{-}>&\dfrac{1}{2}-\dfrac{d_{in}}{d_{out}}\left(p_{in}^{+}-\dfrac{1}{2}\right)\\ &+\dfrac{1}{d_{out}}\sqrt{\dfrac{d_{in}+d_{out}-8d_{in}^{2}\left(p_{in}^{+}-\dfrac{1}{2}\right)^{2}}{2n}}\end{split}. (12)

Considering the average degree cc of the signed network, we use the SNBT matrix as long as the following inequality is satisfied:

{12<pin+<12+12cc2+ndin2din>c+cn.\begin{cases}\dfrac{1}{2}<p_{in}^{+}<\dfrac{1}{2}+\dfrac{1}{2}\sqrt{\dfrac{c}{c^{2}+nd_{in}^{2}}}\\ d_{in}>\dfrac{c+\sqrt{c}}{n}\end{cases}. (13)
\includegraphics

[width = 0.9]compare_matrices.eps

Figure 4: Community detection performances of three different matrices. n=10000n=10000, c=10c=10, din+dout=1d_{in}+d_{out}=1, and pin+=poutp_{in}^{+}=p_{out}^{-}. dind_{in} and pin+p_{in}^{+} both vary from 0.50.5 to 11 with an interval of 0.050.05.

In some cases, we can obtain better results by applying the SNBT matrix than by applying the adjacency matrix. Here, we provide a simple but general example for comparing the two methods (see Fig. 3). In all the comparisons, we assume pin+=poutp_{in}^{+}=p_{out}^{-} for convenience. We only consider the case of pin+>0.5p_{in}^{+}>0.5 here, because when pin+<0.5p_{in}^{+}<0.5, the community structure can be represented by uNu_{N} (the last eigenvector of the adjacency matrix). However, given the dynamic evolution process of the network, only the driving role of the leading eigenvector of the initial network in the evolution of structural balance yields a dynamic manifestation of the detectability transition [22].

In fact, Fig. 3 is an abstract representation of the community related parameters in a real network. Region 4 represents the situation wherein din<doutd_{in}<d_{out}, pin+pinp_{in}^{+}\approx p_{in}^{-} and pout+poutp_{out}^{+}\approx p_{out}^{-}. In other words, the random blocks generated by the parameters in region 4 are not the two communities mentioned above. For the case that the parameters lie in region 2 (or region 3), we actually anticipate that the algorithm is not sign-sensitive (or density-sensitive), and in such a scenario, the BNBT matrix is effective.

It should be noted that because the theoretical detection threshold of the BNBT matrix is still unknown, we refrain from discussing it any further.

V-B Comprehensive comparison among three matrices in terms of community detection performance

\includegraphics

[width = 0.6]compare_varpin.eps

Figure 5: Comparison of three matrices with fixed dind_{in}. n=10000n=10000, c=10c=10, and din+=0.50,0.80,0.75d_{in}^{+}=0.50,0.80,0.75, and 0.700.70. pin+p_{in}^{+} varies from 0.50.5 to 11 with an interval of 0.050.05.

In the following, we provide examples to demonstrate the superior performance of the improved algorithm. The comparison results are shown in Fig. 4. The xx-axis and yy-axis represents the pin+p_{in}^{+} and dind_{in}, respectively. Both the zz-axis and the color represent the overlap. The experiments are performed on signed networks with a size of 10410^{4} and an average degree of 1010. We set pin+=poutp_{in}^{+}=p_{out}^{-} for convenience, which varies from 0.50.5 to 11 with an interval of 0.050.05. It is worth noting that the dind_{in} values in the figure are normalized, i.e., din+dout=1d_{in}+d_{out}=1, which also varies from 0.50.5 to 11 with an interval of 0.050.05.

\includegraphics

[width = 0.8]compare_vardin.eps

Figure 6: Comparison of three matrices with fixed pin+p_{in}^{+}. n=10000n=10000, c=10c=10, and pin+=0.50,0.60p_{in}^{+}=0.50,0.60, and 0.700.70. doutd_{o}ut varies from 0.50.5 to 11 with an interval of 0.050.05.

We can see that the performance of the SNBT matrix is sensitive only to the link density of inter- and intra- community connections, whereas the adjacency-matrix-based algorithm is more sensitive to the link signs. The BNBT-matrix-based algorithm has the advantages of both these matrices, and its performance depends on both the link density and the link signs. Moreover, the area of the undetectable field (in which the overlap is about 0.50.5) is smallest, which indicates that this matrix has the best performance.

Fig. 5 shows four concrete examples with din{0.5,0.70,0.75,0.80}d_{in}\in\{0.5,0.70,0.75,0.80\} and varying pin+p^{+}_{in} (in the range of [0.50.5, 11]). In fact, each line in this figure is a slice of the data in shown Fig. 4, which is obtained by considering the corresponding dind_{in} values. The black, red, and blue lines represent the results obtained using the adjacency matrix, the SNBT matrix, and the BNBT matrix, respectively. For each case (i.e., for each matrix), we perform 10 experiments and calculated the average value for joining the data points to form the black, blue, and red dashed lines. From all the graphs except for the first one, which is the case of din=0.5d_{in}=0.5, we can make the following observations. The overlap is close to 0.5 (which means that the nodes are labelled almost randomly) when the detection threshold of the adjacency matrix is not met, however, the algorithms based on the two non-backtracking matrices show good performances. As discussed above, the overlap does not change with an increase in pin+p_{in}^{+}. As pin+p_{in}^{+} increases, the adjacency matrix-based algorithm outperforms the SNBT-matrix-based algorithm. However, the BNBT-matrix-based algorithm outperforms the adjacency-matrix-based approach at all pin+p_{in}^{+} values. This entire analysis can lead to a satisfactory conclusion regarding the superiority of the BNBT-matrix-based algorithm. The first graph is the only exception; in this case, the density is of no use for dividing the community structure(din=dout=0.5d_{in}=d_{out}=0.5), and therefore, the SNBT-matrix-based algorithm is invalid and the performance of the BNBT-matrix-based algorithm is poorer than that of the sign-sensitive adjacency-matrix-based algorithm.

As shown in Fig. 6, we further evaluate the performances of the three approaches from another perspective; that is, we provide three concrete examples with pin+{0.50,0.60,0.70}p_{in}^{+}\in\{0.50,0.60,0.70\} and varying doutd_{out} (in the range of [0.5,1][0.5,1]). These data lines are slices obtained from the data in Fig. 4 from a different angle. The performance of adjacency-matrix-based approach is not completely independent of doutd_{out}. When pin+=0.7p_{in}^{+}=0.7, the overlap increases at a small doutd_{out}. However, after the threshold is met, the performance of this approach does not improve with decreasing doutd_{out}. It is further proved that the SNBT matrix HH is sign-insensitive. As was the case in the above-described analysis, density sensitivity is the only factor we need to consider when pin+=0.5p_{in}^{+}=0.5, and therefore, HH is superior; however, at other pin+p_{in}^{+} values, HbH^{b} is superior.

In addition, we know that detection of community structure may be difficult when the graph is sparse. For example, in an unsigned network, when cc is constant and nn is large, the network is decomposed for several reasons. Most importantly, the leading eigenvalues of AA are represented by maximum-degree vertices, and the corresponding eigenvectors are localized around these vertices [21, 30]. The non-backtracking matrix has better performance in the case of a sparse graph. We expect it to have superior performance even in the case of a signed network.

If the right side of the first inequality in Eq.(13) is regarded as a function of dind_{in}, we obtain a lower bound according to the monotonicity of the function as follows:

{12<pin+<12+1212cdin>c+cN.\begin{cases}\dfrac{1}{2}<p_{in}^{+}<\dfrac{1}{2}+\dfrac{1}{2}\sqrt{\dfrac{1}{2c}}\\ d_{in}>\dfrac{c+\sqrt{c}}{N}\end{cases}. (14)

Therefore, we theoretically prove that when the community detection using the non-backtracking matrix is feasible, the smaller the cc value, the better are the results obtained using the non-backtracking matrices than those obtained the adjacency matrix. It should be noted that what we refer to as better performance in the case of a sparse graph is relative. In fact, with an increase in the sparsity of the network, the detection accuracy will indeed decrease correspondingly. The observation is also confirmed by numerical simulations performed on stochastic block models with n=104n=10^{4}, pin+=0.7p^{+}_{in}=0.7, din=0.75d_{in}=0.75, and varying average degree cc (in the range of [10,60][10,60] with an interval of 55). As shown in Fig. 7, the performances of the two non-backtracking matrix-based algorithms under varying cc are more stable and robust than that of the adjacency-matrix-based algorithm.

\includegraphics

[width=0.6]overlap_c.eps

Figure 7: Performances of three matrices for graphs with different levels of sparsity. n=104pin+=0.7, and din=0.75n=10^{4}\text{, }p^{+}_{in}=0.7\text{, and }d_{in}=0.75 .

We are also interested in the performance of the newly proposed HbH^{b} in the above comparative analysis; however, these analyses are based only on numerical simulations, and the underlying theory remains to be studied. Nevertheless, we can draw a definitive conclusion that HbH^{b} is sensitive to both the edge sign and the connection density. In most cases, it has better performance than the other two matrices, AA and HH. These two matrices have their own limitations. Although they may be the best choice in some very special scenarios, generally speaking, the BNBT-matrix-based algorithm is the most reliable and effective approach.

V-C Experiments on real-world networks

TABLE I: Basic features of three real-world networks with ground-truth communities.
Network nn mm qq
Email-Eu-core[31, 32] 1,005 25,571 42
American College football[16] 115 613 12
Political blogs[33] 1,490 19,090 2
\includegraphics

[width =0.8]real_data_overlap.eps

Figure 8: Comparison of community detection performance of three matrices for real-world networks pin+p_{i}n^{+} varies from 0.50.5 to 11 with an interval of 0.050.05.

Finally, we select three real-world networks with ground-truth communities to compare the community detection performances of the three matrices. The basic features of the three networks are listed in Table I. However, since these networks are unsigned, we use the following method to assign a sign (positive or negative) to each link. First, we classify all the links into two categories: inter-community links and intra-community links. Then, we assign to each inter-community link a positive sign with a probability of pout+p^{+}_{out} and to each intra-community link a probability of pin+p_{in}^{+}. We set pout++pin+=1p^{+}_{out}+p^{+}_{in}=1, which means that the larger the pin+p^{+}_{in} value, the more significant is the community structure of the network.

In Fig. 8, we have illustrated the community detection accuracies of the three matrices under variation of pin+p^{+}_{in} from 0.50.5 to 11 with an interval of 0.050.05. As can be seen from this figure, the performance of the adjacency-matrix-based algorithm increases with increasing pin+p_{in}^{+}. This result reveals that this algorithm is sign-sensitive, which is in agreement with the earlier discussion. Similarly, the accuracy of the SNBT-matrix-based algorithm remains almost unchanged, because it is insensitive to pin+p_{in}^{+}. The BNBT-matrix-based algorithm shows the best performance and its accuracy also increases with increasing pin+p^{+}_{in}. In addition, even though the number of communities in the football network is 1212, the BNBT- and SNBT-matrix-based methods still perform well. This result implies that these matrices are applicable for community detection in a signed network when the number of communities is greater than two, which further confirms our observations.

VI Conclusion and discussion

In this study, we investigate efficient community detection in a signed network by demonstrating the feasibility of defining a non-backtracking matrix of signed networks. We provide the definition of an appropriate non-backtracking matrix from two different perspectives: the well known structural balance theory and belief propagation. We analytically determine the community detection ability of the proposed non-backtracking matrix and propose an even more efficient matrix, termed the balanced non-backtracking matrix HbH^{b}; the algorithm based on this matrix significantly outperforms that based on the adjacency matrix.

We anticipate the algorithm based on the proposed balance non-backtracking matrix to be sensitive and adaptable to both the edge sign and the connection density. Our algorithm (as also the previous algorithms) is completely effective in the case of the most standard community partition; however, we need to have a basic understanding of more complex networks and communities with different characteristics before we can select the most appropriate algorithm for them. From this viewpoint, the balanced non-backtracking matrix is the most universal matrix. An exception to this universality is that when the community in the actual network is not a relationship-dependent community or a density-dependent community, the above-discussed algorithms may not provide satisfactory results.

The proposed framework shows great potential for community detection with or without overlap and paves the way to understanding the collective behaviors of systems in which positive and negative relationships coexist.

Acknowledgment

Z-YZ, C-QQ, and G-HW were supported in part by National Natural Science Foundation of China under Grant 12001324, Grant 11631014, and Grant 11871311, in part by China Postdoctoral Science Foundation under Grant 2019TQ0188, Grand 2019M662315, in part by Shandong University multidisciplinary research and innovation team of young scholars under Grand 2020QNQT017. X-RW acknowledges the partial support of the project ”PCL Future Greater-Bay Area Network Facilities for Large-scale Experiments and Applications (LZC0019)”.

References

  • [1] S. Fortunato, “Community detection in graphs,” Physics reports, vol. 486, no. 3-5, pp. 75–174, 2010.
  • [2] P. F. Jonsson, T. Cavanna, D. Zicha, and P. A. Bates, “Cluster analysis of networks generated through homology: automatic identification of important protein communities involved in cancer metastasis,” BMC bioinformatics, vol. 7, no. 1, p. 2, 2006.
  • [3] P. Anchuri and M. Magdon-Ismail, “Communities and balance in signed networks: A spectral approach,” in 2012 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining.   IEEE, 2012, pp. 235–242.
  • [4] F. Heider, “Attitudes and cognitive organization,” The Journal of psychology, vol. 21, no. 1, pp. 107–112, 1946.
  • [5] G. Facchetti, G. Iacono, and C. Altafini, “Computing global structural balance in large-scale signed social networks,” Proceedings of the National Academy of Sciences, vol. 108, no. 52, pp. 20 953–20 958, 2011.
  • [6] S. A. Marvel, J. Kleinberg, R. D. Kleinberg, and S. H. Strogatz, “Continuous-time model of structural balance,” Proceedings of the National Academy of Sciences, vol. 108, no. 5, pp. 1771–1776, 2011.
  • [7] A. Kirkley, G. T. Cantwell, and M. Newman, “Balance in signed networks,” Physical Review E, vol. 99, no. 1, p. 012320, 2019.
  • [8] N. Monika, G. Lavanya, K. Vaishnavi, M. Kavya, and V. Kanaiya, “Structural balance theory based recommendation,” International Journal of Advanced Research in Computer Science, vol. 9, no. Special Issue 3, p. 45, 2018.
  • [9] C. Qu and H. Wang, “Impact of structural balance on self-avoiding pruning walk,” Physica A: Statistical Mechanics and its Applications, vol. 524, pp. 362–374, 2019.
  • [10] J. Leskovec, D. Huttenlocher, and J. Kleinberg, “Signed networks in social media,” in Proceedings of the SIGCHI conference on human factors in computing systems, 2010, pp. 1361–1370.
  • [11] B. W. Kernighan and S. Lin, “An efficient heuristic procedure for partitioning graphs,” The Bell system technical journal, vol. 49, no. 2, pp. 291–307, 1970.
  • [12] J. Friedman, T. Hastie, and R. Tibshirani, The elements of statistical learning.   Springer series in statistics New York, 2001.
  • [13] J. MacQueen et al., “Some methods for classification and analysis of multivariate observations,” in Proceedings of the fifth Berkeley symposium on mathematical statistics and probability.   Oakland, CA, USA, 1967, pp. 281–297.
  • [14] U. Von Luxburg, “A tutorial on spectral clustering,” Statistics and computing, vol. 17, no. 4, pp. 395–416, 2007.
  • [15] L. Yang, X. Cao, D. He, C. Wang, X. Wang, and W. Zhang, “Modularity based community detection with deep learning.” in IJCAI, vol. 16, 2016, pp. 2252–2258.
  • [16] M. Girvan and M. E. Newman, “Community structure in social and biological networks,” Proceedings of the national academy of sciences, vol. 99, no. 12, pp. 7821–7826, 2002.
  • [17] M. E. Newman and M. Girvan, “Finding and evaluating community structure in networks,” Physical review E, vol. 69, no. 2, p. 026113, 2004.
  • [18] D. J. MacKay and D. J. Mac Kay, Information theory, inference and learning algorithms.   Cambridge university press, 2003.
  • [19] S. Chauhan, M. Girvan, and E. Ott, “Spectral properties of networks with community structure,” Physical Review E, vol. 80, no. 5, p. 056114, 2009.
  • [20] A. Pothen, “Graph partitioning algorithms with applications to scientific computing,” in Parallel Numerical Algorithms.   Springer, 1997, pp. 323–368.
  • [21] F. Krzakala, C. Moore, E. Mossel, J. Neeman, A. Sly, L. Zdeborová, and P. Zhang, “Spectral redemption in clustering sparse networks,” Proceedings of the National Academy of Sciences, vol. 110, no. 52, pp. 20 935–20 940, 2013.
  • [22] M. Morrison and M. Gabbay, “Community detectability and structural balance dynamics in signed networks,” Physical Review E, vol. 102, no. 1, p. 012304, 2020.
  • [23] A. Decelle, F. Krzakala, C. Moore, and L. Zdeborová, “Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications,” Physical Review E, vol. 84, no. 6, p. 066106, 2011.
  • [24] P. Ren, R. C. Wilson, and E. R. Hancock, “Graph characterization via ihara coefficients,” IEEE Transactions on Neural Networks, vol. 22, no. 2, pp. 233–245, 2010.
  • [25] O. Angel, J. Friedman, and S. Hoory, “The non-backtracking spectrum of the universal cover of a graph,” Transactions of the American Mathematical Society, vol. 367, no. 6, pp. 4287–4318, 2015.
  • [26] M. Kotani and T. Sunada, “2.-zeta functions of finite graphs,” Journal of Mathematical Sciences-University of Tokyo, vol. 7, no. 1, pp. 7–26, 2000.
  • [27] S. Janson, E. Mossel et al., “Robust reconstruction on trees is determined by the second eigenvalue,” The Annals of Probability, vol. 32, no. 3B, pp. 2630–2649, 2004.
  • [28] E. Mossel, Y. Peres et al., “Information flow on trees,” The Annals of Applied Probability, vol. 13, no. 3, pp. 817–844, 2003.
  • [29] H. Kesten and B. P. Stigum, “Additional limit theorems for indecomposable multidimensional galton-watson processes,” The Annals of Mathematical Statistics, vol. 37, no. 6, pp. 1463–1481, 1966.
  • [30] M. Krivelevich and B. Sudakov, “The largest eigenvalue of sparse random graphs,” Combinatorics, Probability and Computing, vol. 12, no. 1, pp. 61–72, 2003.
  • [31] J. Leskovec, J. Kleinberg, and C. Faloutsos, “Graph evolution: Densification and shrinking diameters,” ACM transactions on Knowledge Discovery from Data (TKDD), vol. 1, no. 1, pp. 2–es, 2007.
  • [32] H. Yin, A. R. Benson, J. Leskovec, and D. F. Gleich, “Local higher-order graph clustering,” in Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2017, pp. 555–564.
  • [33] L. A. Adamic and N. Glance, “The political blogosphere and the 2004 us election: divided they blog,” in Proceedings of the 3rd international workshop on Link discovery, 2005, pp. 36–43.
  • [34] A. Coja-Oghlan, E. Mossel, and D. Vilenchik, “A spectral approach to analysing belief propagation for 3-colouring,” Combinatorics, Probability and Computing, vol. 18, no. 6, pp. 881–912, 2009.
  • [35] A. Mellor and A. Grusovin, “Graph comparison via the nonbacktracking spectrum,” Physical Review E, vol. 99, no. 5, p. 052309, 2019.

Appendix A Alternative definition of non-backtracking matrix based on linearized belief propagation

Belief propagation (BP) is a kind of acyclic message passing algorithm, which calculates the exact marginal distribution of each vertex in the network. Although BP is designed to work accurately on trees, it is usually applied to general graphs that are sparse and may contain loops [21, 24, 34].

This algorithm starts from the appropriate initial assignment and performs an iteration for some ”messages”. Specifically, for each edge (v,w)(v,w) in a graph G=(V,E)G=(V,E), the message ηvwa\eta_{v\rightarrow w}^{a} indicates the conditional probability that vv belongs to community aa when ww does not, and the message ηwva\eta_{w\rightarrow v}^{a} indicates the probability that ww belongs to community aa when vv does not. Usually, ηvwaηwva\eta_{v\rightarrow w}^{a}\neq\eta_{w\rightarrow v}^{a}. As is clear from this explanation, although the original graph is undirected, these messages are delivered to the directed edge, where each message has a value between 0 and 1. The message can be calculated iteratively on the basis of such information transfer.

The BP algorithm has good consistency with the actual group allocation because it approximates the Bayesian optimal reasoning of a block model. The application of the BP algorithm to spectral clustering is also a possible research direction [25, 35].

In this section, we prove that in signed networks, HH appears in the linearization equation derived from the updating equation of the BP algorithm. Because of the presence of the edge sign, we generalize the existing BP updating equation into the following form for u𝒩(v)u\in\mathcal{N}(v):

ηvw+ηvw:=eh×σ(uv)=σ(vw)(ηuv+cin+ηuvcout)σ(uv)=σ(vw)(ηuv+cout+ηuvcin)×σ(uv)σ(vw)((1ηuv+)cin+(1ηuv)cout)σ(uv)σ(vw)((1ηuv+)cout+(1ηuv)cin),\begin{split}&\dfrac{\eta_{v\rightarrow w}^{+}}{\eta_{v\rightarrow w}^{-}}:=e^{-h}\\ &\times\dfrac{\prod_{\sigma(u\rightarrow v)=\sigma(v\rightarrow w)}\left(\eta_{u\rightarrow v}^{+}c_{in}+\eta_{u\rightarrow v}^{-}c_{out}\right)}{\prod_{\sigma(u\rightarrow v)=\sigma(v\rightarrow w)}\left(\eta_{u\rightarrow v}^{+}c_{out}+\eta_{u\rightarrow v}^{-}c_{in}\right)}\\ &\times\dfrac{\prod_{\sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)}\left(\left(1-\eta_{u\rightarrow v}^{+}\right)c_{in}+\left(1-\eta_{u\rightarrow v}^{-}\right)c_{out}\right)}{\prod_{\sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)}\left(\left(1-\eta_{u\rightarrow v}^{+}\right)c_{out}+\left(1-\eta_{u\rightarrow v}^{-}\right)c_{in}\right)},\end{split} (15)

where ηvw±\eta_{v\rightarrow w}^{\pm} denotes the probability that vv belongs to a community when uu does not belong to the network and ±\pm denotes two separate communities. It should be noted that ehe^{-h} represents the information transmitted from non-edges (points not adjacent to v), where h=(cincout)(n+BPnBP)h=(c_{in}-c_{out})(n_{+}^{BP}-n_{-}^{BP}), and n±BPn_{\pm}^{BP} denotes to the ratio of the current number of points in two communities to the total number of nodes estimated by the BP algorithm.

It is noteworthy that when uvu\rightarrow v and vwv\rightarrow w have different signs, the information transmitted to vwv\rightarrow w is not ηuv±\eta_{u\rightarrow v}^{\pm} but (1ηuv±)\left(1-\eta_{u\rightarrow v}^{\pm}\right). This means that if these two edges have different signs, the false information will be transmitted to vwv\rightarrow w. Similarly, the trivial fixed point of the above updated equation is still ηvw=1/2\eta_{v\rightarrow w}=1/2; that is, the probability of each vertex being divided into two communities is equal.

Next, we consider the information update equation near the trivial fixed point. By taking ηuv±=1/2±δuv\eta_{u\rightarrow v}^{\pm}=1/2\pm\delta_{u\rightarrow v} and linearizing around this fixed point (for more details, see Appendix B), we obtain an updating rule of δ\delta:

δ:=(cincout)(cin+cout)HTδ.\delta:=\dfrac{\left(c_{in}-c_{out}\right)}{\left(c_{in}+c_{out}\right)}H^{T}\delta. (16)

That is, HH can also be obtained by the BP algorithm.

Appendix B Derivation process of updating equation of δ\delta

To simplify the updating equation of δ\delta, let us carefully consider Eq.(15)\left(\ref{updating}\right).

First, we notice that n+BP=nBPn_{+}^{BP}=n_{-}^{BP} holds near the trivial fixed point; that is, ehe^{-h} can be written as 11. Under the assumption of an unknown constant ZZ, we split Eq.(15)\left(\ref{updating}\right) into two equations:

ηvw+=ZuN(v)σ(uv)=σ(vw)(ηuv+cin+ηuvcout)×uN(v)σ(uv)σ(vw)[(1ηuv+)cin+(1ηuv)cout],\begin{split}\eta_{v\rightarrow w}^{+}=Z\cdot\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\left(\eta_{u\rightarrow v}^{+}c_{in}+\eta_{u\rightarrow v}^{-}c_{out}\right)\\ \times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\left[\left(1-\eta_{u\rightarrow v}^{+}\right)c_{in}+\left(1-\eta_{u\rightarrow v}^{-}\right)c_{out}\right],\end{split} (17)
ηvw=ZuN(v)σ(uv)=σ(vw)(ηuv+cout+ηuvcin)×uN(v)σ(uv)σ(vw)[(1ηuv+)cout+(1ηuv)cin].\begin{split}\eta_{v\rightarrow w}^{-}=Z\cdot\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\left(\eta_{u\rightarrow v}^{+}c_{out}+\eta_{u\rightarrow v}^{-}c_{in}\right)\\ \times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\left[\left(1-\eta_{u\rightarrow v}^{+}\right)c_{out}+\left(1-\eta_{u\rightarrow v}^{-}\right)c_{in}\right].\end{split} (18)

Rewriting Eq.(17)\left(\ref{eq1}\right) near the trivial fixed point ηuv±=1/2±δuv\eta_{u\rightarrow v}^{\pm}=1/2\pm\delta_{u\rightarrow v} gives

12+δuv=Z×uN(v)σ(uv)=σ(vw)[(12+δuv)cin+(12δuv)cout]×uN(v)σ(uv)σ(vw)[(12δuv)cin+(12+δuv)cout].\begin{split}&\frac{1}{2}+\delta_{u\rightarrow v}=Z\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\left[\left(\frac{1}{2}+\delta_{u\rightarrow v}\right)c_{in}+\left(\frac{1}{2}-\delta_{u\rightarrow v}\right)c_{out}\right]\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\left[\left(\frac{1}{2}-\delta_{u\rightarrow v}\right)c_{in}+\left(\frac{1}{2}+\delta_{u\rightarrow v}\right)c_{out}\right].\end{split} (19)

By merging similar items, we get

12+δuv=Z×uN(v)σ(uv)=σ(vw)[12(cin+cout)+δuv(cincout)]×uN(v)σ(uv)σ(vw)[12(cin+cout)δuv(cincout)].\begin{split}&\frac{1}{2}+\delta_{u\rightarrow v}=Z\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)+\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\right]\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)-\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\right].\end{split} (20)

Eq.(18)\left(\ref{eq2}\right) can be simplified to

12δuv=Z×uN(v)σ(uv)=σ(vw)[12(cin+cout)δuv(cincout)]×uN(v)σ(uv)σ(vw)[12(cin+cout)+δuv(cincout)].\begin{split}&\frac{1}{2}-\delta_{u\rightarrow v}=Z\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)-\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\right]\\ &\times\prod_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)+\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\right].\end{split} (21)

Linearization of Eq.(20)\left(\ref{eq3}\right) and Eq.(21)\left(\ref{eq4}\right) gives

12+δvwZ{[12(cin+cout)]|N(v)|+uN(v)σ(uv)=σ(vw)δuv(cincout)[12(cin+cout)]|N(v)1|uN(v)σ(uv)σ(vw)δuv(cincout)[12(cin+cout)]|N(v)1|},\begin{split}&\frac{1}{2}+\delta_{v\rightarrow w}\approx Z\cdot\Bigg{\{}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)\right|}\\ &+\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)-1\right|}\\ &-\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)-1\right|}\Bigg{\}},\end{split} (22)
12δvwZ{[12(cin+cout)]|N(v)|uN(v)σ(uv)=σ(vw)δuv(cincout)[12(cin+cout)]|N(v)1|+uN(v)σ(uv)σ(vw)δuv(cincout)[12(cin+cout)]|N(v)1|}.\begin{split}&\frac{1}{2}-\delta_{v\rightarrow w}\approx Z\cdot\Bigg{\{}\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)\right|}\\ &-\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)-1\right|}\\ &+\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\delta_{u\rightarrow v}\left(c_{in}-c_{out}\right)\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)-1\right|}\Bigg{\}}.\end{split} (23)

To eliminate the constant ZZ, we calculate the sum and difference of Eq.(22)\left(\ref{eq5}\right) and Eq.(23)\left(\ref{eq6}\right),

1=2Z[12(cin+cout)]|N(v)|,2δvw=2Z[12(cin+cout)]|N(v)1|×(cincout)×(uN(v)σ(uv)=σ(vw)uN(v)σ(uv)σ(vw))δuv.\begin{split}&1=2Z\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)\right|},\\ &2\delta_{v\rightarrow w}=2Z\left[\frac{1}{2}\left(c_{in}+c_{out}\right)\right]^{\left|N(v)-1\right|}\times\left(c_{in}-c_{out}\right)\\ &\times\left(\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}-\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\right)\delta_{u\rightarrow v}.\end{split} (24)

After eliminating the constant ZZ, we have

δvw=cincoutcin+cout×(uN(v)σ(uv)=σ(vw)uN(v)σ(uv)σ(vw))δuv.\begin{split}&\delta_{v\rightarrow w}=\frac{c_{in}-c_{out}}{c_{in}+c_{out}}\\ &\times\left(\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)=\sigma(v\rightarrow w)\end{subarray}}-\sum_{\begin{subarray}{c}u\in N(v)\\ \sigma(u\rightarrow v)\neq\sigma(v\rightarrow w)\end{subarray}}\right)\delta_{u\rightarrow v}.\end{split} (25)

Consequently, we obtain the updating rule of δ\delta in signed networks,

δ:=(cincout)(cin+cout)HTδ.\delta:=\dfrac{\left(c_{in}-c_{out}\right)}{\left(c_{in}+c_{out}\right)}H^{T}\delta. (26)
\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]zyzhong Zhaoyue Zhong received the B.S. degree from School of Mathematics, Shandong University, China in 2020. She is currently pursuing the M.S. degree in School of Mathematical Sciences, Fudan University, China. Her current research interests include complex networks and mathematical methods in neural networks.
\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]xwang Xiangrong Wang is currently a research assistant professor at Southern University of Science and Technology, Shenzhen, China. She received her Ph.D. degree from the Delft University of Technology, the Netherlands in 2016. Before joining Shenzhen, she was a postdoctoral researcher at the Delft University of Technology from 2017 to 2018. In 2017 and 2018, she was a visiting scholar at Zaragoza University, Zaragoza, Spain and ISI Foundation, Torino, Italy. Her research focuses on modeling and analysis of complex networks, nonlinear dynamics and graph spectral analysis.
\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]cqqu Cunquan Qu is currently working as a Post-doctor researcher at Data Science Institute, Shandong University, Jinan, China. He did a joint Ph.D. project in the Multimedia Computing Group at the Delft University of Technology for two years. He received his Ph.D. degree from Shandong University in 2019. His research focuses on analyzing network structure, modeling the dynamics process, graph neural networks.
\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]ghwang Guanghui Wang received a B.Sc. degree in Mathematics from Shandong University, Jinan, China, in 2001. He got the doctor’s degree from Paris SDU University and worked in Ecole Centrale Paris as a Post-doctor. Now he is a professor in School of Mathematics, Shandong University. His current interests include graph theory, combinatorics, complex networks and bioinformatics.