|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.util.GraphMetrics
public class GraphMetrics
Nested Class Summary | |
---|---|
class |
GraphMetrics.AdjacencyMatrix
This is a wrapper class for the COLT DoubleMatrix2D object such that NetKit does not require the colt library in its classpath. |
Field Summary | |
---|---|
Graph |
graph
|
protected static java.util.logging.Logger |
logger
|
java.lang.String |
nodeType
|
int |
numEdges
|
int |
numNodes
|
Constructor Summary | |
---|---|
GraphMetrics(Graph g)
Compute metrics over all nodes in the graph |
|
GraphMetrics(Graph g,
java.lang.String nodeType)
Compute certain metrics only over nodes of the given node type |
Method Summary | |
---|---|
boolean |
calcCentralityActive()
|
double |
calcCentralityProgress()
|
boolean |
calcClusterActive()
|
double |
calcClusterProgress()
|
boolean |
calcComponentActive()
|
double |
calcComponentProgress()
|
void |
calculateCentralityStat()
This calculates the all-pairs closest distances |
void |
calculateClusterStat()
|
void |
calculateComponentStat()
|
void |
calculateDegreeStat()
|
static double[] |
calculateEdgeBasedAssortativityCoeff(Classification known)
|
static double[] |
calculateEdgeBasedAssortativityCoeff(Classification known,
EdgeType et)
|
double[] |
calculateEdgeBasedAssortativityCoeff(java.lang.String nodeType,
AttributeCategorical attribute)
|
double[] |
calculateEdgeBasedAssortativityCoeff(java.lang.String nodeType,
AttributeCategorical attribute,
EdgeType et)
|
void |
calculateEdgeStat()
|
static double[] |
calculateNodeBasedAssortativityCoeff(Classification known)
|
static double[] |
calculateNodeBasedAssortativityCoeff(Classification known,
EdgeType et)
|
double[] |
calculateNodeBasedAssortativityCoeff(java.lang.String nodeType,
AttributeCategorical attribute)
|
double[] |
calculateNodeBasedAssortativityCoeff(java.lang.String nodeType,
AttributeCategorical attribute,
EdgeType et)
|
static double |
computeAssortativityFromMatrix(double[][] matrix)
Utility method which can be used by any sub-class |
GraphMetrics.AdjacencyMatrix |
getAdjacencyMatrix(boolean unweighted)
Get the (possibly unweighted) adjacency matrix of this graph in the COLT sparseMatrix2D format. |
double |
getAlphaCentralityAlpha()
|
double |
getAlphaCentralityDelta()
|
ApproximateCentralities |
getApproximateCentralities()
|
double |
getBetweennessCentrality(Node n)
Get the betweenness centrality for the given node. |
double |
getCharacteristicPathLength()
|
double |
getClosenessCentrality(Node n)
Get the closeness centrality for the given node. |
ModularityClusterer.Cluster |
getCluster(int idx)
|
int |
getCluster(Node node)
|
ModularityClusterer |
getClusterer()
|
int |
getComponent(Node node)
|
int |
getComponentSize(int componentNum)
|
HistogramDiscrete |
getDegreeDistribution()
Return the histogram of (unweighted) edge degrees for nodes in the graph. |
double |
getDist(Node src,
Node dst)
|
double |
getEfficiency()
Not implemented yet. |
double |
getGlobalClusterCoeff()
|
double |
getGraphCentrality()
Get the graph centrality. |
double |
getGraphCentrality(Node n)
Get the graph centrality for a specific node. |
double |
getGraphDensity()
Return the density of the graph as defined by: |E|/(|N|*(|N)-1)), where |E| is the number of edges and |N| is the number of nodes in the graph. |
double |
getInformationCentrality(Node n)
Not implemented yet. |
double |
getLocalClusterCoeff()
|
int |
getMaxComponentIdx()
|
int |
getMaxComponentSize()
|
double |
getMaxDegree()
|
double |
getMaxDist()
|
double |
getMaxEdgeWeight()
|
double |
getMaxWeightedDegree()
|
double |
getMeanDegree()
|
double |
getMeanDist()
|
double |
getMeanEdgeWeight()
|
double |
getMeanWeightedDegree()
|
double |
getMinDegree()
|
double |
getMinEdgeWeight()
|
double |
getMinWeightedDegree()
|
int |
getNodeIndex(Node n)
|
int |
getNumClusters()
|
int |
getNumComponents()
|
double |
getNumEdges()
|
double |
getNumNodes()
|
int |
getNumPath2()
|
int |
getNumSingletons()
|
int |
getNumtriangles()
|
double |
getPagerankAlpha()
|
double |
getPagerankDelta()
|
double |
getTotalEdgeWeights()
|
double |
getWeightedBetweennessCentrality(Node n)
Get the betweenness centrality for the given node. |
double |
getWeightedCharacteristicPathLength()
|
double |
getWeightedClosenessCentrality(Node n)
Get the closeness centrality for the given node. |
double |
getWeightedDist(Node src,
Node dst)
|
double |
getWeightedGraphCentrality()
Get the graph centrality. |
double |
getWeightedGraphCentrality(Node n)
Get the graph centrality for a specific node. |
double |
getWeightedInformationCentrality(Node n)
Not implemented yet. |
double |
getWeightedMaxDist()
|
double |
getWeightedMeanDist()
|
void |
setAlphaCentralityAlpha(double alpha)
set the alpha used when computing approximate alpha centrality |
void |
setAlphaCentralityDelta(double delta)
set the delta used when computing approximate alpha centrality |
void |
setPagerankAlpha(double alpha)
set the alpha used when computing approximate pagerank centrality |
void |
setPagerankDelta(double delta)
set the delta used when computing approximate pagerank centrality |
void |
stopCalcCentralityStat()
|
void |
stopCalcClusterStat()
|
void |
stopCalcComponentStat()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.logging.Logger logger
public final Graph graph
public final java.lang.String nodeType
public final int numNodes
public final int numEdges
Constructor Detail |
---|
public GraphMetrics(Graph g)
g
- public GraphMetrics(Graph g, java.lang.String nodeType)
g
- nodeType
- Method Detail |
---|
public ModularityClusterer getClusterer()
public int getCluster(Node node)
node
- The node whose cluster index is sought after
public int getNumClusters()
public ModularityClusterer.Cluster getCluster(int idx)
public double calcClusterProgress()
public boolean calcClusterActive()
public void stopCalcClusterStat()
public void calculateClusterStat()
public double getLocalClusterCoeff()
public double getGlobalClusterCoeff()
public int getNumtriangles()
public int getNumPath2()
public void calculateEdgeStat()
public double getMinEdgeWeight()
public double getMaxEdgeWeight()
public double getMeanEdgeWeight()
public double getTotalEdgeWeights()
public double getNumEdges()
public double getNumNodes()
public void calculateDegreeStat()
public GraphMetrics.AdjacencyMatrix getAdjacencyMatrix(boolean unweighted)
public HistogramDiscrete getDegreeDistribution()
public double getMinDegree()
public double getMaxDegree()
public double getMeanDegree()
public double getMinWeightedDegree()
public double getMaxWeightedDegree()
public double getMeanWeightedDegree()
public double calcComponentProgress()
public boolean calcComponentActive()
public void stopCalcComponentStat()
public void calculateComponentStat()
public int getComponent(Node node)
node
- The node whose component index is sought after
public int getNumComponents()
public int getNumSingletons()
public int getMaxComponentSize()
public int getComponentSize(int componentNum)
componentNum
- The component whose size to get
public int getMaxComponentIdx()
public int getNodeIndex(Node n)
public double calcCentralityProgress()
public boolean calcCentralityActive()
public void stopCalcCentralityStat()
public void calculateCentralityStat()
public double getDist(Node src, Node dst)
public double getWeightedDist(Node src, Node dst)
public double getMeanDist()
public double getWeightedMeanDist()
public double getMaxDist()
public double getWeightedMaxDist()
public static double computeAssortativityFromMatrix(double[][] matrix)
matrix
- The assortativity matrix
public static double[] calculateEdgeBasedAssortativityCoeff(Classification known)
public static double[] calculateNodeBasedAssortativityCoeff(Classification known)
public static double[] calculateNodeBasedAssortativityCoeff(Classification known, EdgeType et)
public static double[] calculateEdgeBasedAssortativityCoeff(Classification known, EdgeType et)
public double[] calculateEdgeBasedAssortativityCoeff(java.lang.String nodeType, AttributeCategorical attribute)
public double[] calculateNodeBasedAssortativityCoeff(java.lang.String nodeType, AttributeCategorical attribute)
public double[] calculateEdgeBasedAssortativityCoeff(java.lang.String nodeType, AttributeCategorical attribute, EdgeType et)
public double[] calculateNodeBasedAssortativityCoeff(java.lang.String nodeType, AttributeCategorical attribute, EdgeType et)
public double getEfficiency()
public double getGraphDensity()
public double getClosenessCentrality(Node n)
public double getWeightedClosenessCentrality(Node n)
public double getInformationCentrality(Node n)
public double getWeightedInformationCentrality(Node n)
public double getBetweennessCentrality(Node n)
public double getWeightedBetweennessCentrality(Node n)
public double getGraphCentrality()
public double getWeightedGraphCentrality()
public double getGraphCentrality(Node n)
public double getWeightedGraphCentrality(Node n)
public double getCharacteristicPathLength()
public double getWeightedCharacteristicPathLength()
public double getAlphaCentralityAlpha()
public void setAlphaCentralityAlpha(double alpha)
public double getAlphaCentralityDelta()
public void setAlphaCentralityDelta(double delta)
public double getPagerankAlpha()
public void setPagerankAlpha(double alpha)
public double getPagerankDelta()
public void setPagerankDelta(double delta)
public ApproximateCentralities getApproximateCentralities()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |