Multidimensional graph metrics with Neo4j and Cypher
The goal of this Gist is to demonstrate the graph metrics collected in our paper Towards the characterization of realistic models: evaluation of multidisciplinary graph metrics.
Dataset
As an example, we use a simple railway network consisting of two Routes, three Segments, a Switch and three Sensors.
A possible graph representation of the example as a graph is this:
This short video demonstrates how the railway network is transformed to a graph.
The following query creates the graph (the query is automatically executed when loading the page).
In the following, we present the formal definitions of the metrics and evaluate them on the example graph using Cypher queries. For the details of the notation, see the paper.
Multidimensional metrics
Metrics interpreted on nodes
Multiplex participation coefficient
\( \mathit{MPC}(v) = \frac{|D|}{|D| - 1} \left[ 1 - \sum\limits_{d\in D}^{}{\left(\frac{\mathit{Degree}(v,d)}{\mathit{Degree}(v,D)}\right)^2} \right] \)Dimensional clustering coefficients
DC1 variant
DC2 variant
Metrics interpreted on dimension pairs
The node activity binary vector for each node v is defined as:
Using this vector, the pairwise multiplexity metric is:
Is this page helpful?