Skip to main content

graph_analyzer

The first thing someone should focus on when working with graphs is getting deep analytics of the current state. That is what this module is doing. By using the power of NetworkX, various different graph properties are extracted. This module has the ability to run on a subgraph if a subgraph of nodes is provided as input.

The list of analytics that the module uses:

  • nodes: Number of nodes
  • edges: Number of edges
  • bridges: Number of bridges
  • articulation_points: Number of articulation points
  • avg_degree: Average degree
  • sorted_nodes_degree: Sorted nodes degree
  • self_loops: Self loops
  • is_bipartite: Is bipartite
  • is_plannar: Is planar
  • is_biconnected: Is biconnected
  • is_weakly_connected: Is weakly connected
  • number_of_weakly_components: Number of weakly connected components
  • is_strongly_connected: Is strongly connected
  • strongly_components: Number of strongly connected components
  • is_dag: Is directed acyclic graph (DAG)
  • is_eulerian: Is eulerian
  • is_forest: Is forest
  • is_tree: Is tree

docs-source

TraitValue
Module typemodule
ImplementationPython
Graph directionundirected
Edge weightsunweighted
Parallelismsequential

Procedures​

info

If you want to execute this algorithm on graph projections, subgraphs or portions of the graph, be sure to check out the guide on How to run a MAGE module on subgraphs.

analyze(analyses)​

Input:​

  • analyses: List[string] (default=NULL) ➑ List of analytics names to be fetched. If provided with NULL, the whole set of analytics will be included.

Output:​

  • name: string ➑ The name of the analytics
  • value: string ➑ Analytics value, stored as a string

Usage:​

CALL graph_analyzer.analyze() YIELD *;

analyze_subgraph(vertices, edges, analyses)​

Input:​

  • vertices: List[Vertex] ➑ Subset of vertices within a graph.
  • edges: List[Edge] ➑ Subset of edges in a graph for which analytics will take place.
  • analyses: List[string] (default=NULL) ➑ List of analytics names to be fetched. If provided with NULL, theΒ whole set of analytics will be included.

Output:​

  • name: string ➑ The name of the analytics
  • value: string ➑ Analytics value, stored as a string

Usage:​

MATCH (n)-[e]-(m)
WITH COLLECT(n) AS nodes_subset, COLLECT(e) AS edges_subset
CALL graph_analyzer.analyze(nodes_subset, edges_subset) YIELD name, value
RETURN name, value;

Example​