1. Introduction
Social networks commonly exhibit a mixture of affiliative, trusting, or cooperative interactions (positive relationships) alongside those characterized by conflict, disagreement, or competition (negative relationships) [
1]. Networks simultaneously containing positive and negative ties are known as signed networks and have been widely investigated across computer science, biology, economics, and political science [
2,
3,
4,
5,
6,
7].
Structural balance theory provides a foundational framework for understanding the evolution of signed networks [
8]. Originating from psychological theory, Heider [
9] proposed that a signed network is balanced when every triad contains either three positive ties or exactly one positive tie. Cartwright and Harary [
10] later formalized this concept using graph theory, demonstrating that a balanced network can be partitioned into two mutually antagonistic clusters or a single cohesive group. Davis [
11] subsequently introduced weak structural balance, allowing networks to split into more than two clusters by treating triads with three negative edges as balanced.
Over the past decades, numerous mathematical models have been developed to analyze structural balance and its detection [
12,
13,
14,
15,
16,
17]. These studies provide valuable insights for social science applications, including political polarization, alliance stability, and cooperation–conflict dynamics in organizations. Despite these advances, conventional structural balance models rely primarily on adjacency information and overlook node-level attributes, limiting their explanatory power in social computing. Empirical systems frequently exhibit attribute-driven behavioral heterogeneity. For example, in international relations, ideological similarity may shape cooperation beyond formal alliances; in organizational innovation diffusion, adoption often depends on node attributes such as capacity and risk tolerance; in epidemic networks, individual health behaviors strongly influence transmission outcomes. Ignoring such attributes leads to oversimplified models that fail to capture real-world complexity.
Du et al. [
18] extended structural balance to fully signed networks by assigning signs to both nodes and edges, while this provides a vital foundation, four key limitations persist in the existing studies. First, most models are restricted to binary attributes, failing to capture the multi-category nature of social groups. Second, they often assume strong balance, whereas empirical networks frequently exhibit weakly balanced, multi-factional structures [
17]. Third, the focus remains on balance detection rather than the dynamic transformation process. Finally, prior models rarely account for the asymmetry in transformation costs, where the social or cognitive effort required to modify a node attribute typically differs from that of an edge sign. Our study addresses these gaps by proposing a unified optimization framework that incorporates multi-category attributes, weak balance, and asymmetric costs.
While various memetic-algorithm-based methods have been proposed for structural balance optimization, they often encounter limitations when applied to fully signed networks. A common challenge is the tendency to be trapped in local optima due to the vast and complex search space of balance dynamics. To bridge this gap, this study develops an enhanced memetic algorithm that distinguishes itself in two key aspects. First, we introduce a synergistic optimization strategy that couples a global genetic search with a fine-grained local search operator, effectively mitigating premature convergence and ensuring the discovery of higher-quality solutions. Second, our method is specifically optimized for the dynamic transformation of balance, providing a more comprehensive and efficient framework than traditional methods.
The primary contribution of this study lies in addressing the dynamic transformation process within fully signed networks, a critical yet overlooked dimension in structural balance research. Unlike traditional approaches focusing exclusively on edge sign adjustments, our framework recognizes that in real-world social systems, individual attributes and interpersonal relationships are intrinsically coupled and co-evolve. By formulating this as a joint optimization problem, we capture the essence of genuine human behavior—where individuals may alter both their internal states (attributes) and external connections to alleviate structural tension.
This work extends structural balance theory from static categorization to a dynamic, multi-dimensional evolutionary process. From the perspective of Computational Social Science, this integrated approach provides a sophisticated methodology for analyzing complex social phenomena, such as opinion polarization and group segregation, where the interplay between “who people are” (nodes) and “how they interact” (edges) is fundamental. Thus, the novelty of this work resides in the synthesis of these components into a unified dynamic model that offers both theoretical depth and practical applicability to evolving social structures.
2. Structural Balance and Its Dynamic Transformation
Heider [
9] initially introduced the concept of structural balance using the triad as the fundamental unit, classifying triangles into four distinct types (
Figure 1). A network is considered balanced when all its triangles conform to types (a) or (b), adhering to the principles that “a friend of a friend is a friend” and “an enemy of an enemy is a friend.” However, this criterion is often considered overly restrictive for empirical systems. Davis [
11] subsequently expanded this notion to “weak structural balance,” wherein type (d) is also deemed balanced. This extension incorporates the logic that “menemies of enemies may remain enemies.”
Drawing on graph theory, Cartwright and Harary [
10] demonstrated that nodes in a strongly balanced signed network can be partitioned into two mutually antagonistic clusters. Such a network is balanced if all node pairs within the same cluster are linked by positive edges, while all inter-cluster pairs are connected by negative edges (
Figure 2). Essentially, Cartwright and Harary’s formulation formalized Heider’s original conception. A weaker condition permits the division of the network into multiple clusters to accommodate more complex social structures.
In social computing, Du et al. [
18] extended structural balance to “fully signed networks,” where both nodes and edges are assigned “+” or “−” signs. It should be noted that the interpretations of these signs differ: for nodes, “+” and “−” indicate binary attributes such as political party (blue or red), whereas for edges, they represent positive or negative relationships. A signed network can be represented as a graph
, where the set of nodes
is mapped to
, and the set of edges
is mapped to
.
The various tripartite relationships involving node attributes are shown in
Figure 3. Based on the mechanisms of homophily and xenophobia [
19], Du et al. [
18] postulated that positive edges should connect nodes sharing identical attributes, while negative edges should link nodes with dissimilar attributes; consequently, only triangles (a) and (d) are balanced.
A primary limitation of this framework is its restriction to binary node attributes. In real-world platforms like Twitter or Reddit, individual attributes are multi-faceted. For instance, political orientation is rarely a simple binary of “left” or “right,” but rather a spectrum including progressive, liberal, centrist, conservative, and libertarian views. Similarly, primary interests can span technology, sports, gaming, or research. Furthermore, the original framework only supports “strong structural balance,” which He et al. [
17] argued is too rigid to accurately model real systems. To fill this gap, the binary attribute representation must be extended to a multi-category schema, where the node set is redefined as
, with each integer representing a distinct attribute type. When extending this theory to the weak structural balance condition, the network can be globally partitioned into multiple clusters, as illustrated in
Figure 4. Within each cluster, nodes share identical attributes and are interconnected by positive edges. In contrast, nodes belonging to different clusters possess distinct attributes and are linked by negative edges.
The triangle theory of structural balance interprets social behaviors from a micro-level perspective. The transition from imbalance to balance represents an inherent trend in the evolution of human interactions [
20]. To mitigate conflicts arising from unbalanced relationships, each agent continuously adjusts its interpersonal connections until all its local triangles satisfy balanced conditions. Enhancing the efficiency of structural balance evolution can significantly improve group cohesion and facilitate knowledge dissemination. In real-world systems, however, modifying relationship attributes and node attributes incurs certain costs. For instance, in organizational settings, altering interpersonal relationships may require conflict mediation or trust-building activities, while changing node attributes, such as shifting a person’s stance in a debate, could involve persuasive communication or training. This paper focuses on achieving network balance with minimal cost under such constraints.
In practice, transforming structural balance can be achieved by multiple ways. As illustrated in
Figure 5 the upper panel depicts an initial unbalanced network. Three distinct pathways are presented to transform this network into the balanced one. Path
a involves modifying three edges: edges between nodes 4 and 6, 5 and 8, and 6 and 7. Path
b alters the attributes of two nodes, namely node 5 and node 6. Path
c adjusts both relational and nodal properties by changing edges between 5 and 6, 5 and 8, along with the attribute of node 6. When the costs associated with modifying node edge attributes differ, different appropriate strategies can be selected to optimize the efficiency of structural balance attainment.
To determine the minimal set of nodes or edges whose attributes need to be transformed during the dynamical evolution of signed networks, a suitable metric is required to evaluate whether the network has reached a balanced state. Various indices have been introduced to quantify structural balance, such as the ratio of balanced loops to all loops. However, these conventional approaches suffer from high computational complexity due to the enumeration of cycles. Alternatively, Facchetti et al. [
21] proposed an energy function that substantially reduces computational overhead. The energy function is defined as Equation (
1), where
denotes the sign of the edge between nodes
i and
j, and
indicate the cluster assignments.
In extending this energy function to fully signed networks, the cluster assignment variable
s was replaced by node attribute
n in the work of Du et al. [
18]. To adapt the function for weak structural balance, a modified version is introduced here, as formalized as Equation (
2). In this expression,
and
belonging to
indicate the attributes of nodes
i and
j. The term ⊕ indicates whether both nodes share the same attribute; specifically,
if nodes
i and
j share the same attribute, and
otherwise. The minimal value of this function corresponds to the number of imbalanced node pairs. An energy value of zero indicates a fully balanced signed network, while higher values reflect greater degrees of imbalance.
Building upon this foundation, we formulate the objective function as minimizing the cost required to achieve structural balance throughout the network. A tunable parameter
belonging to
is introduced to reflect the fact that modifying edge and node attributes may incur different costs and probabilities in real systems. By adjusting
, the relative impact of edge modifications versus node updates can be controlled, influencing both the total number and the type of elements altered. The optimization problem for the dynamical evolution toward structural balance is formally defined as
where
represents the cost of transforming edges, while
represents the cost of transforming nodes.
and
, respectively, denote the number of edges and nodes that are transformed,
E remains consistent with Equation (
2), and
is the punishment coefficient to ensure that the energy function reaches 0.
4. Experiments
This section evaluates the performance of the proposed algorithms on a series of computer-generated and four real-world networks. All experiments are conducted on a workstation equipped with a 32-core processor and 128 GB of memory, utilizing MATLAB 24.2.0.2773142 (R2024b) (MathWorks, Natick, MA, USA) for execution. The essential parameters configurations employed in the experimental study are summarized in
Table 1.
The essential parameters employed in this study are summarized in
Table 1, with their values grounded in preliminary sensitivity analyses and established heuristic principles. Specifically, a larger
or
enhances search precision but at the expense of computational overhead; thus, we adopted a value of 100, which provides a satisfactory balance between solution quality and time complexity [
16,
17,
18]. The
is set to 2 to moderate selection pressure, ensuring sufficient population diversity to avoid premature convergence to local optima [
28]. Furthermore, the crossover (
) and mutation (
) [
29] probabilities were tuned to synchronize global exploration and local exploitation. Crucially, the penalty coefficient
in Equation (
3) plays a pivotal role in regulating the trade-off between the total transformation cost and the attainment of structural balance. Within the objective function,
acts as a soft constraint that enforces the energy function
to converge to zero. Through a systematic series of pilot experiments, it was observed that
consistently steers the network toward a fully balanced state (representing a state of perfect structural stability) while preserving the algorithm’s efficacy in minimizing modification costs. Therefore,
is adopted as the standard threshold in this study to focus on the optimal dynamic transformation process.
4.1. Results for Computer-Generated Networks
The computer-generated networks in our study are constructed according to the benchmark networks introduced by Girvan and Newman [
27]. We begin with a perfectly balanced network comprising 128 nodes partitioned into four clusters (nodes 1–32, 33–64, 65–96, 97–128). In this structure, each node has an average degree of 16, with an equal distribution of 8 links to nodes within the same cluster and 8 to nodes in different clusters. The edge signs are assigned such that all intra-cluster connections are positive, while all inter-cluster connections are negative. Regarding node attributes, identical values are assigned to nodes belonging to the same cluster, whereas distinct values are assigned across different clusters. To simulate structural imbalance, a perturbation parameter
is introduced, which represents the fraction of edges that violate the ideal balanced state (i.e., negative edges within clusters or positive edges between clusters). By varying
, a series of networks with increasing imbalance are generated for testing.
Figure 8 illustrates the averaged outcomes from 20 independent runs across various settings of
and
. As shown in
Figure 8a, the objective function value increases with
, reflecting the escalating computational and structural costs required to restore balance in heavily perturbed networks. This trend demonstrates the sensitivity of the optimization process to structural perturbations. Concurrently, a larger
also leads to an elevation in the objective function. Since
represents the unit cost of modifying an edge, a higher value directly translates to a greater total expense for adjustments, thereby inflating the objective function. The number of transformed edges, presented in
Figure 8b, grows as
increases. However, this growth rate is attenuated with rising
, because the transformation process is partially supplanted by the transformation of node attributes—a cheaper alternative under high edge-adjustment costs. From
Figure 8c, we can find the number of transformed nodes exhibits a positive correlation with both
and
. These observations collectively confirm the adaptability of our method to different scenarios by tuning the parameter
.
To quantify the consistency between the initial attributes and the optimized results, we utilize the Normalized Mutual Information (
) index. For two attribute assignments
A and
B over
n nodes, a confusion matrix
is constructed, where the entry
denotes the number of nodes belonging to attribute
i in
A and attribute
j in
B.
between
A and
B is then calculated as follows:
where
and
represent the number of attribute kinds in
A and
B,
and
denote the sum of elements in the
row and
column of the confusion matrix
C. The value of
ranges from 0 to 1, with a higher value indicating a greater degree of consistency between the two assignments. The
results under different
and
settings are displayed in
Figure 8d. Our analysis reveals that
remains at 1 as
increases when
is small. In contrast, a declining trend in
is observed with rising
under larger
values. This pattern underscores our algorithm’s capability to effectively navigate the trade-off between structural modification and the incurred cost.
Subsequently, we investigate imbalance induced by node attributes. A parameter
is introduced to quantify the level of node-attributed imbalance, defined as the proportion of nodes within a cluster that possess divergent attributes. This disturbance is implemented through a random process, where each cluster has an identical probability
of containing nodes with heterogeneous attributes.
Figure 9 presents the averaged results for various
and
. Similar to the previous findings, the objective function increases with
. However, it exhibits an inverted U-shaped pattern in response to
. This non-monotonic behavior arises from a strategic shift. When
is smaller, the system preferentially modifies edges to attain structural balance, and a larger
causes a higher total cost. In contrast, larger
makes edge adjustments prohibitively expensive, causing the model to increasingly flip node attributes instead, which in turn reduces the total cost. Consequently, as shown in
Figure 9b, the number of transformed edges grows with
, but this growth is progressively suppressed as
increases. Consistent with this reasoning,
Figure 9c demonstrates that the number of transformed nodes rises with both
and
. The
result in
Figure 9d reveals a contrasting trend to
Figure 8d. Here,
remains around 1 for large
as
increases, whereas it declines for small
. This observation confirms that our algorithm is effective not only for resolving conflicts arising from relational imbalance but also for mitigating those caused by inconsistencies in node attributes.
Finally, we performed a comparative analysis between the proposed Memetic Algorithm (MA) and a standard Genetic Algorithm (GA). Convergence behavior was evaluated by tracking the energy function across iterations on networks with varying
.
Figure 10 illustrates that MA achieves a significantly accelerated convergence rate and reaches a final solution with markedly lower residual energy compared to the GA. This advantage underscores the efficacy of the synergistic coupling between global genetic exploration and local heuristic refinement in driving the network toward a globally balanced state.
4.2. Results for Real-World Networks
The proposed method is also evaluated on four real-world networks over 20 independent runs:
Slovene Parliamentary Party Network (SPP): A relational network of 10 political parties, established by parliamentary experts in 1994 [
30].
Illustrative Signed Network (ISN): A network with 28 nodes and 42 edges, originally presented by Yang et al. [
31].
Epidermal Growth Network (EGN): The network representing the Epidermal growth factor receptor pathway [
32], containing 330 nodes and 852 edges.
Macrophage Network (MN): A molecular interaction map for a macrophage [
33], comprising 678 nodes, 947 positive edges, and 478 negative edges.
All networks are connected. Due to the scarcity of publicly available datasets that integrate both edge signs and node attributes, we followed the methodology of Sun et al. [
34] and Du et al. [
18] by manually or randomly assigning attributes to nodes.
SPP is nearly balanced, partitionable into two opposing communities with only two intra-cluster negative edges causing imbalance.
ISN is perfectly balanced, divisible into two hostile clusters. For
SPP and
ISN, node attributes were assigned via two protocols: (1) random binary assignment, and (2) manual assignment based on domain knowledge. For the larger
EGN and
MN networks, a random 4-category attribute was assigned to each node, consistent with prior work [
17].
The results for different
values are summarized in
Table 2. Notably, the energy function consistently converges to zero across all parameter settings, confirming the algorithm’s effectiveness in achieving structural balance. As
increases, the objective function displays an inverted U-shaped pattern, while the number of transformed edges declines and the count of transformed nodes rises. This trend demonstrates the algorithm’s strategic adaptability: it shifts the optimization burden from edge modifications to node attribute changes as the relative cost of edge operations (
) becomes prohibitive.
In the proposed method, every solution is decoded into a specific transformation strategy. The resulting structural adjustments for the
SPP and
ISN networks are visualized in
Figure 11 and
Figure 12, respectively.
Figure 11a depicts the original
SPP network without assigned node attributes, while the upper part of
Figure 11b shows the network after the random assignment of attributes. The results indicate that at lower
values (
), the algorithm prioritizes flipping the signs of unbalanced edges over altering node attributes, forming two distinct communities. In contrast, a higher
value triggers a different paradigm: the attributes of four nodes are modified, accompanied by the conversion of two negative edges into positive ones. In the experiment with documented attributes (
Figure 11c), only the two unbalanced negative edges are reversed. This outcome aligns with Wang et al. [
12], confirming that our algorithm is backward-compatible with conventional signed networks that do not incorporate node attributes.
Figure 12a displays the original
ISN without assigned node attributes, while
Figure 12c shows the network after nodes are randomly assigned certain properties. Similar to the result observed in
Figure 11b, when
, the signs of unbalanced edges are flipped without modifying node attributes. In contrast, when
exceeds 0.5, attributes of 13 nodes are transformed, while no edge signs are altered. This occurs because
ISN is inherently relationally balanced when not considering node attributes. If node attributes are subjectively assigned based on prior knowledge, as illustrated in
Figure 12b, the resulting fully signed
ISN adheres to both edge and node balance principles [
17]. Under such conditions, structural balance is achieved without modifying any edges or nodes. By tuning the parameter
, the desired outcome can be precisely obtained.