public class ClosenessCentrality extends AbstractCentrality
AbstractCentrality.NormalizationMode
Modifier and Type | Field and Description |
---|---|
private APSP |
apsp |
protected boolean |
computeAPSP
Flag indicating if APSP should be computed in this algorithm.
|
static String |
DEFAULT_ATTRIBUTE_KEY |
protected boolean |
useDangalchevMethod
Flag indicating if computation should use Dangalchev method rather than
the classical method.
|
centralityAttribute, data, graph, normalize
Constructor and Description |
---|
ClosenessCentrality()
Default construtor.
|
ClosenessCentrality(String attribute)
Construtor allowing to configure centrality attribute.
|
ClosenessCentrality(String attribute,
AbstractCentrality.NormalizationMode normalize)
Constructor allowing to configure attribute and normalize flag.
|
ClosenessCentrality(String centralityAttribute,
AbstractCentrality.NormalizationMode normalize,
boolean computeAPSP,
boolean useDangalchevMethod)
Fully configurable construtor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeCentrality()
Define the computation of centrality values.
|
void |
init(Graph graph)
Initialization of the algorithm.
|
compute, copyValuesTo, copyValuesTo, getCentralityAttribute, getNormalizationMode, setCentralityAttribute, setNormalizationMode
public static final String DEFAULT_ATTRIBUTE_KEY
protected boolean computeAPSP
APSP.APSPInfo
object in
nodes attribute APSP.APSPInfo.ATTRIBUTE_NAME
.protected boolean useDangalchevMethod
public ClosenessCentrality()
public ClosenessCentrality(String attribute)
attribute
- attribute where centrality will be storedpublic ClosenessCentrality(String attribute, AbstractCentrality.NormalizationMode normalize)
attribute
- attribute where centrality will be storednormalize
- defines the normalization modepublic ClosenessCentrality(String centralityAttribute, AbstractCentrality.NormalizationMode normalize, boolean computeAPSP, boolean useDangalchevMethod)
centralityAttribute
- attribute where centrality will be storednormalize
- defines the normalization modecomputeAPSP
- if true, apsp will be computed in this algorithmuseDangalchevMethod
- if true, Dangelchev method will be used in this algorithmpublic void init(Graph graph)
Algorithm
Algorithm.compute()
method to initialize or reset the algorithm according
to the new given graph.init
in interface Algorithm
init
in class AbstractCentrality
graph
- The graph this algorithm is using.protected void computeCentrality()
AbstractCentrality
AbstractCentrality.data
using node index.computeCentrality
in class AbstractCentrality
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses