In graph theory, eigenvector centrality (also called eigencentrality) is a measure of the influence of a node in a network. It assigns relative scores to all nodes in the network based on the concept that connections to high-scoring nodes contribute more to the score of the node in question than equal connections to low-scoring nodes.
Google’s PageRank and the Katz centrality are variants of the eigenvector centrality.
Using the adjacency matrix to find eigenvector centrality
For a given graph with vertices let be the adjacency matrix, i.e. if vertex is linked to vertex , and otherwise. The relative centrality score of vertex can be defined as:
where is a set of the neighbors of and is a constant. With a small rearrangement this can be rewritten in vector notation as the eigenvector equation
In general, there will be many different eigenvalues for which a non-zero eigenvector solution exists. However, the additional requirement that all the entries in the eigenvector be non-negative implies (by the Perron–Frobenius theorem) that only the greatest eigenvalue results in the desired centrality measure. The component of the related eigenvector then gives the relative centrality score of the vertex in the network. The eigenvector is only defined up to a common factor, so only the ratios of the centralities of the vertices are well defined. To define an absolute score one must normalise the eigen vector e.g. such that the sum over all vertices is 1 or the total number of vertices n. Power iteration is one of many eigenvalue algorithms that may be used to find this dominant eigenvector. Furthermore, this can be generalized so that the entries in A can be real numbers representing connection strengths, as in a stochastic matrix.
Following is the code for the calculation of the Eigen Vector Centrality of the graph and its various nodes.
The above function is invoked using the networkx library and once the library is installed, you can eventually use it and the following code has to be written in python for the implementation of the eigen vector centrality of a node.
The output of the above code is:
The above result is a dictionary depicting the value of eigen vector centrality of each node. The above is an extension of my article series on the centrality measures. Keep networking!!!
You can read more about the same at
- Percolation Centrality (Centrality Measure)
- Closeness Centrality (Centrality Measure)
- Find a Mother vertex in a Graph using Bit Masking
- Queries for count of even digit sum elements in given range using MO's Algorithm
- Find distance between two nodes in the given Binary tree for Q queries
- Query to count odd and even parity elements in subarray after XOR with K
- Count of the non-prime divisors of a given number
- Priority queue of pairs in C++ with ordering by first and second element
- How to build a simple music player app using Android Studio
- Extends vs Implements in Java
- Format specifiers in different Programming Languages
- new vs malloc() and free() vs delete in C++
- When to use each sorting algorithms
- Minimum Bottleneck Spanning Tree(MBST)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.