Collective Influence Algorithm Implementation

14 views (last 30 days)
Hello everyone,
I need help to implement an algorithm for the collective influence model [CI=(Ki - 1) * sum(Kj -1)]. This model computes the Collective Influence values of each node on a network. It is given by the product of the degrees of node i less 1 and the sum of the degrees of the next nearest neighbours of node i less 1 as specified by distance d. ‘d’ can be from 2-hop, 3-hop or more hops from node i.
The idea is to determine the nodes with the most influence on a network that are capable of collapsing or totally fragmenting the network when they are removed. After the first iteration, the CI value is calculated and sorted in descending order. The node with the highest CI value is removed and the calculation is repeated and CI sorted again to determine the node with the next highest CI value. The cycle continues until the network is completely fragmented with the least number of largest components.
So far, I have tried to implement this model using Matlab inbuilt syntaxes. But I have some challenges in accessing and computing the degree of the next nearest neighbours of node i. See the code below:
load('simp10net.mat')
G=graph(A);
gg=size(A,1);
for i=1:gg
Neb=neighbors(G,i);
degNodi=degree(G,i);
end
My challenge with the above code is to access and compute the degree values of node i’s 2-hop or more hop neighbours.
Q: Which line of code can I use to access the 2-hop or 3-hop or more hop neighbours of node i and at the same time compute their degree?
I also tried another code but I have not been able to get the result I need.
load('simp10net.mat')
networkA=A;
N=size(networkA,1);
mmm=0;
for i=1:N
neb1=length(kmin_neighbors(networkA,i,1));
neb2=kmin_neighbors(networkA,i,2);
collInf(i)=((neb1 - 1)* mmm);
end
In the above code, I was able to access the 2-hop neighbours of node i but I don’t know the line of code to calculate the degree values. Which line of code can help me do this?
Q: How can I retain the identities/tags of each node since after removing the node with the highest CI value at each iteration, the network is less a node and the numbering changes?
Any help or advice on how to make this code more efficient will be so much appreciated.
Thanks
simp10net.jpg

Answers (0)

Categories

Find more on Networks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!