Up: Component summary Component

GraphMetrics

Computes various graph metrics for a GraphML file. Undirected and directed graphs are supported. Basic metrics include graph diameter, average shortest path length and average degree. There are also several metrics that are computed for each vertex. These include clustering coefficient, degree centrality, closeness centrality, betweenness centrality and eigenvector centrality.

For an introduction to these metrics, see Mason, O. and Verwoerd, M., Graph Theory and Networks in Biology, 2006.

Version 1.0
Bundle tools
Categories Graph
Authors Kristian Ovaska (kristian.ovaska@helsinki.fi)
Issue tracker View/Report issues
Requires collections-generic-4.01.jar (jar) ; colt.jar (jar) ; csbl-javatools.jar (jar) ; jung-algorithms-2.0.jar (jar) ; jung-api-2.0.jar (jar) ; jung-graph-impl-2.0.jar (jar) ; jung-io-2.0.jar (jar)
Source files component.xml GraphMetricsComponent.java
Usage Example with default values

Inputs

Name Type Mandatory Description
graph GraphML Mandatory Graph of interest

Outputs

Name Type Description
graphMetrics CSV Metrics that are computed once for the whole graph. There is one row for each metric. Column names are Metric and Value. The following metrics are present: NumVertices, NumEdges, Diameter, MeanDegree, MeanShortestPath.
vertexMetrics CSV Metrics that are computed individually for each vertex. There is one row for each vertex. The following columns are present: Vertex (vertex ID), InDegree (in-degree of the vertex), OutDegree, ClusteringCoeff (clustering coefficient), DegreeCentrality, ClosenessCentrality, BetweennessCentrality, EigenvectorCentrality. For undirected graphs, InDegree is equal to OutDegree and gives the (unique) vertex degree. Also, for each centrality measure a rank column is present (e.g. DegreeCentralityRank) that shows the rank of the vertex in range 0 to 1 so that 0 is the vertex with lowest measure.

Parameters

Name Type Default Description
nameAttribute string "" If given, the Vertex column in vertexMetrics contains values taken from this vertex attribute. If empty, the ID of vertices are used.
normalize boolean true If true, normalize centrality measures (degree, closeness and betweenness) to range 0 to 1. If false, report raw centrality measures. Note that for DegreeCentrality, the raw value is the degree of the node. Eigenvector centrality is always in the range 0 to 1.

Test cases

Test case Parameters IN
graph
OUT
graphMetrics
OUT
vertexMetrics
case1 properties graph graphMetrics vertexMetrics

normalize=false

case2 properties graph graphMetrics vertexMetrics

nameAttribute=name

case3_directed properties graph graphMetrics vertexMetrics

normalize=false


Generated 2019-02-08 07:42:16 by Anduril 2.0.0