Database Reference
In-Depth Information
Bob
Olly
Hal
Carol
Frank
Gary
Ian
Alice
Ned
Daniel
James
Kristen
Elise
Lenore
Marie
Fig. 4.2 In-Degree Centrality. Alice, who has the most users retweeting her, has the highest In-
Degree Centrality
Listing 4.1
In-Degree Centrality calculation
...
//The graph representation in JUNG.
private Hypergraph<T, ?> graph;
...
/ **
* @return The In-Degree Centrality of the vertex.
* /
public Double getVertexScore(T node) {
return (double) graph.getInEdges(node).size();
}
}
Source: Chapter4/util/InDegreeScorer.java
Listing 4.2
Eigenvector Centrality calculation
...
public EigenVectorScorer(Hypergraph<UserNode,
RetweetEdge> graph){
users = new UserNode[graph.getVertexCount()];
graph.getVertices().toArray(users);
/ * Step 1: Create the adjacency matrix.
*
* An adjacency matrix is a matrix with N users and N
columns,
* where N is the number of nodes in the network.
* An entry in the matrix is 1 when node i is joined to node
j,
* and 0 otherwise.
* /
 
Search WWH ::




Custom Search