Utility-based preferential attachment model is an evolving network model in which preference is based on utility within second degree of separation.
The utility of node
For convenience, we use coef_k1 (
Coded in Python3.
You can initialize Utility-based preferential attachment model by next code:
from utility_model import UM
G = UM(m=1, coef_k1=1, coef_k2=0, seed=5) # BA model
m (int): Number of edges added at each step
coef_k1 (int): Utility coefficient for direct connection
coef_k2 (int): Utility coefficient for indirect connection (only positive numbers are considered. Otherwise the target pool will almost disappear.)
seed (int): Number of seed nodes (ring network)
You can add new nodes by next code:
G.add_nodes(N=100000)
N (int): Number of nodes added to the network
See example.py for a detailed example.
The model code is based on the work of Max Falkenberg. https://github.com/MaxFalkenberg/k2model