Database Reference
In-Depth Information
SparseDoubleMatrix2D matrix =
new SparseDoubleMatrix2D(users.length, users.length);
for(int i = 0; i < users.length; i++){
for(int j = 0; j < users.length; j++){
matrix.setQuick(i, j, graph.containsEdge(new RetweetEdge
(users[i], users[j]))?1:0);
}
}
/ * Step 2: Find the principle eigenvector.
* For more information on eigen-decomposition please see
* \url{http://mathworld.wolfram.com/EigenDecomposition.html}
* /
EigenvalueDecomposition eig = new EigenvalueDecomposition(
matrix);
DoubleMatrix2D eigenVals = eig.getD();
eigenVectors = eig.getV();
dominantEigenvectorIdx = 0;
for(int i = 1; i < eigenVals.columns(); i++){
if(eigenVals.getQuick(dominantEigenvectorIdx,
dominantEigenvectorIdx) <
eigenVals.getQuick(i, i)){
dominantEigenvectorIdx = i;
}
}
}
...
}
Source: Chapter4/util/EigenVectorScorer.java
4.1.3.2
Eigenvector Centrality: Who Is the Most Influential?
With Degree Centrality the key question was “how many people retweeted this
node?” Eigenvector Centrality builds upon this to ask “how important are these
retweeters?” Figure 4.3 shows the same network as before, this time with nodes
scaled by Eigenvector Centrality. We see that Bob, largely ignored by Degree
Centrality, is the most important node through the lens of Eigenvector Centrality.
This is because Alice, a high-degree node, gets information from Bob. An example
of this calculation is shown in Listing 4.2 .
4.1.3.3
Betweenness Centrality: Who Controls the Flow of Information?
Here we view importance from another perspective: the user's ability to control the
flow of information. When information travels through a network, it takes the most
convenient path possible. The most convenient path in a network is the shortest path .
Betweenness centrality measures the number of shortest paths in which the user is
in the sequence of nodes in the path.
 
Search WWH ::




Custom Search