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.algorithms.shortestpath.Distance;
17 import edu.uci.ics.jung.graph.Hypergraph;
20 * Assigns scores to each vertex according to the sum of its distances to all other vertices.
22 public class BarycenterScorer<V,E> extends DistanceCentralityScorer<V, E>
25 * Creates an instance with the specified graph and distance metric.
26 * @param graph the input graph
27 * @param distance the distance metric to use
29 public BarycenterScorer(Hypergraph<V,E> graph, Distance<V> distance)
31 super(graph, distance, false);
35 * Creates an instance with the specified graph and edge weights.
36 * Will generate a <code>Distance</code> metric internally based on the edge weights.
37 * @param graph the input graph
38 * @param edge_weights the edge weights to use to calculate vertex/vertex distances
40 public BarycenterScorer(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weights)
42 super(graph, edge_weights, false);
46 * Creates an instance with the specified graph.
47 * Will generate a <code>Distance</code> metric internally assuming that the
48 * graph is unweighted.
49 * @param graph the input graph
51 public BarycenterScorer(Hypergraph<V,E> graph)