Merge "Bug 2347: DOMConcurrentDataCommitCoordinator uses wrong phase name"
[controller.git] / third-party / net.sf.jung2 / src / main / java / edu / uci / ics / jung / algorithms / scoring / ClosenessCentrality.java
1 /*
2  * Created on Jul 12, 2007
3  *
4  * Copyright (c) 2007, the JUNG Project and the Regents of the University 
5  * of California
6  * All rights reserved.
7  *
8  * This software is open-source under the BSD license; see either
9  * "license.txt" or
10  * http://jung.sourceforge.net/license.txt for a description.
11  */
12 package edu.uci.ics.jung.algorithms.scoring;
13
14 import org.apache.commons.collections15.Transformer;
15
16 import edu.uci.ics.jung.algorithms.shortestpath.Distance;
17 import edu.uci.ics.jung.graph.Hypergraph;
18
19 /**
20  * Assigns scores to each vertex based on the mean distance to each other vertex.
21  * 
22  * @author Joshua O'Madadhain
23  */
24 public class ClosenessCentrality<V,E> extends DistanceCentralityScorer<V,E>
25 {
26
27     /**
28      * Creates an instance using the specified vertex/vertex distance metric.
29      * @param graph the input
30      * @param distance the vertex/vertex distance metric.
31      */
32     public ClosenessCentrality(Hypergraph<V,E> graph, Distance<V> distance)
33     {
34         super(graph, distance, true);
35     }
36
37     /**
38      * Creates an instance which measures distance using the specified edge weights.
39      * @param graph the input graph
40      * @param edge_weights the edge weights to be used to determine vertex/vertex distances
41      */
42     public ClosenessCentrality(Hypergraph<V,E> graph, Transformer<E, ? extends Number> edge_weights)
43     {
44         super(graph, edge_weights, true);
45     }
46
47     /**
48      * Creates an instance which measures distance on the graph without edge weights.
49      * @param graph
50      */
51     public ClosenessCentrality(Hypergraph<V,E> graph)
52     {
53         super(graph, true);
54     }
55 }