|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.gm.GraphMetricBase<V,E>
bcds.phison.gm.BrandesBC<V,E>
public class BrandesBC<V,E>
Computes the betweenness centrality
of nodes and links in a directed graph. This is a wrapper on
BetweennessCentrality
but only the Brandes' version is
exposed. Also, this class is stricter in checking that the
parameters passed to BetweennessCentrality make sense.
Example of use:
... // With default parameters: GraphMetric<V, E> m = new BrandesBC<V, E>(g, null); // or with specific parameters: GraphMetric<V, E> m = new BrandesBC<V, E>(g, new Environ("BrandesBC.normalized", true, "BrandesBC.use_ecmp", false)); Map<V, Double> nbc = m.getNodeMetric(); ...
Constructor Summary | |
---|---|
BrandesBC()
Default constructor. |
|
BrandesBC(SimGraph<V,E> g,
Environ env)
Creates a new instance and calls setup to complete the initialization. |
Method Summary | |
---|---|
java.lang.String |
getDescription()
Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc. |
java.util.Map<E,java.lang.Double> |
getEdgeMetric()
Returns the edge betweenness centrality of each node. |
java.lang.Object[] |
getEnvParams()
Returns the environment parameters used by this class. |
java.lang.String |
getLabel()
Returns "Betweenness centrality". |
java.util.Map<V,java.lang.Double> |
getNodeMetric()
Returns the node betweenness centrality of each node. |
boolean |
isApplicableTo(MetricTarget m)
Returns true if m is
MetricTarget .NODE or EDGE. |
void |
run()
Computes the betweenness centrality. |
void |
setup(SimGraph<V,E> g,
Environ env)
Reinitializes this instance. |
Methods inherited from class bcds.phison.gm.GraphMetricBase |
---|
dump, getEnviron, getGraph, getGraphMetric, getGraphMetricStdev, getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bcds.phison.gm.GraphMetric |
---|
dump, getGraphMetric, getGraphMetricStdev |
Methods inherited from interface bcds.phison.WithEnvParams |
---|
getEnviron, getName |
Constructor Detail |
---|
public BrandesBC()
public BrandesBC(SimGraph<V,E> g, Environ env)
Method Detail |
---|
public boolean isApplicableTo(MetricTarget m)
m
is
MetricTarget
.NODE or EDGE.
isApplicableTo
in interface GraphMetric<V,E>
isApplicableTo
in class GraphMetricBase<V,E>
public void setup(SimGraph<V,E> g, Environ env)
getEnvParams()
).
setup
in interface GraphMetric<V,E>
setup
in class GraphMetricBase<V,E>
java.lang.IllegalArgumentException
- if environment parameters appear
in unsupported combinations.
java.lang.RuntimeException
- if "weighted" is true and
the key "cost_map" does not exist, points to
null
or its value is not a Map of Numbers.public void run()
run
in interface GraphMetric<V,E>
run
in class GraphMetricBase<V,E>
java.lang.UnsupportedOperationException
- if the computation target
cannot be determined (either nodes or links).public java.util.Map<V,java.lang.Double> getNodeMetric()
getNodeMetric
in interface GraphMetric<V,E>
getNodeMetric
in class GraphMetricBase<V,E>
public java.util.Map<E,java.lang.Double> getEdgeMetric()
getEdgeMetric
in interface GraphMetric<V,E>
getEdgeMetric
in class GraphMetricBase<V,E>
public java.lang.String getLabel()
getLabel
in interface GraphMetric<V,E>
public java.lang.String getDescription()
GraphMetric
getDescription
in interface GraphMetric<V,E>
public java.lang.Object[] getEnvParams()
normalized
(default: true): normalize the
the centrality values.
weighted
(default: false): use
edge costs during the computation of shortest paths. If
false, the cost is hop. If true, the
parameter cost_map is required.
use_ecmp
(default: true): enables the
discovery of equal cost multiple paths.
include_end_points
(default: false): whether to
exclude the end points of a path when assesing
the node importance. Only applicable to node betweenness
centrality (it is ignored if the target is edge betweenness).
It is incompatible with use_ecmp=true.
cost_map
(default: null): a non-null
map suitable for use as link cost map with
TED
.
GraphMetric.target
as a hint.
See GraphMetric.run()
.
getEnvParams
in interface WithEnvParams
getEnvParams
in class GraphMetricBase<V,E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |