2 * Created on Jul 12, 2007
4 * Copyright (c) 2007, the JUNG Project and the Regents of the University
8 * This software is open-source under the BSD license; see either
10 * http://jung.sourceforge.net/license.txt for a description.
12 package edu.uci.ics.jung.algorithms.scoring;
14 import org.apache.commons.collections15.Transformer;
16 import edu.uci.ics.jung.graph.Hypergraph;
19 * Calculates eigenvector centrality for each vertex in the graph.
20 * The 'eigenvector centrality' for a vertex is defined as the fraction of
21 * time that a random walk(er) will spend at that vertex over an infinite
23 * Assumes that the graph is strongly connected.
25 public class EigenvectorCentrality<V,E> extends PageRank<V,E>
28 * Creates an instance with the specified graph and edge weights.
29 * The outgoing edge weights for each edge must sum to 1.
30 * (See <code>UniformDegreeWeight</code> for one way to handle this for
32 * @param graph the graph for which the centrality is to be calculated
33 * @param edge_weights the edge weights
35 public EigenvectorCentrality(Hypergraph<V,E> graph,
36 Transformer<E, ? extends Number> edge_weights)
38 super(graph, edge_weights, 0);
39 acceptDisconnectedGraph(false);
43 * Creates an instance with the specified graph and default edge weights.
44 * (Default edge weights: <code>UniformDegreeWeight</code>.)
45 * @param graph the graph for which the centrality is to be calculated.
47 public EigenvectorCentrality(Hypergraph<V,E> graph)
50 acceptDisconnectedGraph(false);