Research Article
An Adaptive Network Model to Simulate Consensus Formation Driven by Social Identity Recognition
Algorithm 1
Simulated social identity algorithm.
| Input: Network: , Node Status: {ωi}, Number of Iteration Times: itmax; Similarity Threshold: θ | | Output: Network: , Node Status: {ωi} | (1) | While t < itmax | (2) | For each node u in : | (3) | Obtain the neighbor nodes set T | (4) | For each node in T: | (5) | Calculate the similarity between node u and node : ; | (6) | If : | (7) | su ⟵ node ; | (8) | Else: | (9) | hu ⟵ node ; | (10) | End For | (11) | If ‖su‖ ≥ ‖hu‖: | (12) | Do Collective Adaptive Mechanism | (13) | For each ⟵ Σakn/‖su‖, n ∈ su; ∈ ωn | (14) | For each ⟵ aku + μ [ak − ] | (15) | Else: | (16) | Do Structural Update Mechanism | (17) | Random Select node n ∈ hu by Roulette | (18) | Rewiring link l (u, n) ⟶ l (u, l) | (19) | End If | (20) | End For | (21) | t++ | (22) | End While |
|