Eigenvector Centrality
Eigenvector centrality (also called eigencentrality or prestige score) is a measure of the influence of a vertex in a network. Relative scores are assigned to all vertices in the network based on the concept that connections to high-scoring vertices contribute more to the score of the vertex in question than equal connections to low-scoring vertices. A high eigenvector score means that a vertex is connected to many vertices who themselves have high scores.
For more information, see Eigenvector Centrality.
Specification
CREATE QUERY tg_eigenvector_cent(SET<STRING> v_type, SET<STRING> e_type, INT maxIter = 100, FLOAT convLimit = 0.000001, INT top_k = 100, BOOL print_accum = True, STRING result_attr = "", STRING file_path = "" )
Parameters
Name | Description | Data type |
---|---|---|
|
Vertex types to assign scores to. |
|
|
Edge types to traverse. |
|
|
Maximum number of iteration. |
|
|
The convergence limit. |
|
|
The number of vertices with the highest scores to return. |
|
|
If true, print results to JSON output. |
|
|
If not empty, save the score of each vertex to this attribute. |
|
|
If not empty, print results in CSV to this file. |
|
Example
Suppose we have the following graph:
Running the algorithm on the graph will show that Dan has the highest centrality score.
RUN QUERY tg_eigenvector_cent(["person"], ["friendship"])
{
"error": false,
"message": "",
"version": {
"schema": 2,
"edition": "enterprise",
"api": "v2"
},
"results": [{"top_scores": [
{
"score": 0.59598,
"Vertex_ID": "Dan"
},
{
"score": 0.50223,
"Vertex_ID": "Jenny"
},
{
"score": 0.44381,
"Vertex_ID": "Tom"
},
{
"score": 0.28786,
"Vertex_ID": "Nancy"
},
{
"score": 0.24085,
"Vertex_ID": "Kevin"
},
{
"score": 0.20296,
"Vertex_ID": "Amily"
},
{
"score": 0.11633,
"Vertex_ID": "Jack"
}
]}]
}