unlinks the worst-performing neighbor $k$ before rewiring a new partner: $$k = arg \min_{j \in O_i}v_i^j.$$ After certain rounds, each agent stops rewiring and converges to an optimal neighborhood.

$v_i^j = calculateExpectedReward(j)$; $y_i = \min_{j \in O_i} v_i^j$; $k = \arg \min_{j \in O_i} v_i^j$; $y_i^{sec} = \min_{j \in O_i\backslash \{k\}} v_i^j$; $\Lambda_i^w = calculateK\_SightIndex(w,K,y_i,y_i^{sec})$; $\Lambda_{max} = \max_{w \in \bar O_i} \Lambda_i^w$; $\tau = \arg \max_{w \in \bar O_i} \Lambda_i^w$; $UnlinkNeighbour(k)$; $RewiringTarget(\tau)$;

\[code:Algorithm 1\]

Next we analyze the computational complexity of our proposed algorithm. In Algorithm 2, for each rewiring phase, agent $i$ computes the interaction baselines of current neighborhood $O_i$ (Line 1-6) and the $\Lambda$ value (Line 6-9) for each potential peer in $\bar O_i$ to find the optimal action (Line 10-15). This leads to a computational complexity of $O(n)$ and the value of $n$ is for the size of reachable peers $\{O_i \cup \bar O_i\}$. Solving the Bellman equation (Eq.5) is equivalent with calculating the optimal rewiring action for all feasible states which are proportional to the size of potential peers. Thus the total computational complexity of solving our sequential decision-making problem is $O(n^2)$. Note that the computational complexity $O(n^2)$ can be quite low even when the population 