This is similar to Google's PageRank and eigenvector centrality.
Measuring Katz centrality
Katz centrality calculates the relative influence of a node in a network by measuring the number of nearest neighbors (nodes of the first degree), as well as all other nodes in the network that connect to the node in question through these immediate neighbors. However, connections to distant neighbors are penalized with an attenuation factor . Each path or connection between a pair of nodes is assigned a weight defined by and the distance between nodes as ,
For example, in the picture on the right, assume that John's centrality is measured and that The weight assigned to each link that connects John to his immediate neighbors Jane and Bob is Since Jose connects to John indirectly through Bob, the weight assigned to this connection (two links) will be , Likewise, the weight assigned to the connection between Agneta and John via Aziz and Jane will be and the weight assigned to Agneta and John's connection via Diego, Jose and Bob will be ,
Let A & # 8212 ; adjacency matrix of the considered network. the elements from A are variables that take the value 1 if node i is associated with node j and 0 otherwise. Degrees A indicate the presence (or absence) of links between two nodes through intermediaries. For example, in the matrix if the element , this indicates that node 2 and node 12 are connected through several neighbors of the first and second degree of node 2. If denotes the Katz centrality of node i, then mathematically:
Note that the above definition uses the fact that the element at the adjacency matrices elevated to power (ie ) reflects the total The degree of communication between nodes and , The value of the attenuation coefficient should be chosen so that it is less than the reciprocal of the absolute value of the largest eigenvalue of the adjacency matrix A. In this case, the following expression can be used to calculate Katz centrality:
Here is is an identity matrix, is a unit vector of size n (n — number of nodes), consisting of units. indicates transposed matrix A and ( indicates matrix term inversion ().
Below is the code to calculate the centrality of the Katz graph and its various nodes.
The above function is called using the networkx library and after installing it you can end up using it and the following code must be written in python to implement katz node centralization.
Output of the above code:
The above result is a dictionary showing the value of the center of the cutter of each node. The above is a continuation of my series on centralization measures. Keep chatting !!!