|
||||||||||
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.ClusteringCoeff<V,E>
public class ClusteringCoeff<V,E>
Computes the (local) clustering coefficient of each node in
a graph. The clustering coefficient of a node v is:
- 0 if node_degree(v) == 0.
- 1 if node_degree(v) == 1.
- the fraction of v's neighbours that are also neighbours of
each other if node_degree(v) > 1.
It is required that each link is present in its two directions, that is, that the graph is "undirected" in practice.
The clustering coefficient of the whole graph is the average of the local coefficients.
Constructor Summary | |
---|---|
ClusteringCoeff()
Default constructor. |
|
ClusteringCoeff(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. |
double |
getGraphMetric()
Returns clustering coefficient of the graph. |
double |
getGraphMetricStdev()
Returns the standard deviation of the clustering coefficient. |
java.lang.String |
getLabel()
Returns "Clustering coefficient". |
java.util.Map<V,java.lang.Double> |
getNodeMetric()
Returns the map holding the clustering coefficient of each node. |
boolean |
isApplicableTo(MetricTarget m)
Returns true if m is MetricTarget .GRAPH
or NODE. |
void |
run()
Computes and stores internally the local clustering coefficient of each node. |
void |
setup(SimGraph<V,E> g,
Environ env)
Saves the parameters for future use. |
Methods inherited from class bcds.phison.gm.GraphMetricBase |
---|
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, 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, getEdgeMetric |
Methods inherited from interface bcds.phison.WithEnvParams |
---|
getEnviron, getEnvParams, getName |
Constructor Detail |
---|
public ClusteringCoeff()
public ClusteringCoeff(SimGraph<V,E> g, Environ env)
Method Detail |
---|
public boolean isApplicableTo(MetricTarget m)
m
is MetricTarget
.GRAPH
or NODE.
isApplicableTo
in interface GraphMetric<V,E>
isApplicableTo
in class GraphMetricBase<V,E>
public void setup(SimGraph<V,E> g, Environ env)
GraphMetricBase
g
must
not be null. If env
is null, a new empty environment
is created. Default values are incorporated by calling
getEnvParams and the types of already-present
values are adapted, if possible.
setup
in interface GraphMetric<V,E>
setup
in class GraphMetricBase<V,E>
public void run()
run
in interface GraphMetric<V,E>
run
in class GraphMetricBase<V,E>
java.lang.IllegalArgumentException
- if there is a link running only
in one direction.public double getGraphMetric()
getGraphMetric
in interface GraphMetric<V,E>
getGraphMetric
in class GraphMetricBase<V,E>
public double getGraphMetricStdev()
getGraphMetricStdev
in interface GraphMetric<V,E>
getGraphMetricStdev
in class GraphMetricBase<V,E>
public java.util.Map<V,java.lang.Double> getNodeMetric()
getNodeMetric
in interface GraphMetric<V,E>
getNodeMetric
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>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |