/* * Created on Jul 12, 2007 * * Copyright (c) 2007, the JUNG Project and the Regents of the University * of California * All rights reserved. * * This software is open-source under the BSD license; see either * "license.txt" or * http://jung.sourceforge.net/license.txt for a description. */ package edu.uci.ics.jung.algorithms.scoring; import org.apache.commons.collections15.Transformer; import edu.uci.ics.jung.algorithms.shortestpath.Distance; import edu.uci.ics.jung.graph.Hypergraph; /** * Assigns scores to each vertex according to the sum of its distances to all other vertices. */ public class BarycenterScorer extends DistanceCentralityScorer { /** * Creates an instance with the specified graph and distance metric. * @param graph the input graph * @param distance the distance metric to use */ public BarycenterScorer(Hypergraph graph, Distance distance) { super(graph, distance, false); } /** * Creates an instance with the specified graph and edge weights. * Will generate a Distance metric internally based on the edge weights. * @param graph the input graph * @param edge_weights the edge weights to use to calculate vertex/vertex distances */ public BarycenterScorer(Hypergraph graph, Transformer edge_weights) { super(graph, edge_weights, false); } /** * Creates an instance with the specified graph. * Will generate a Distance metric internally assuming that the * graph is unweighted. * @param graph the input graph */ public BarycenterScorer(Hypergraph graph) { super(graph, false); } }