Skip to main content

graph_analyzer

docs-source

Abstract#

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. Here is a list of analytics that it 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
TraitValue
Module typemodule
ImplementationPython
Graph directionundirected
Edge weightsunweighted
Parallelismsequential

Procedures#

analyze(analyses)#

Input:#

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

Output:#

  • name: str ➡ The name of the analytics
  • value: str ➡ 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[str](NULL) ➡ List of analytics names to be fetched. If provided with NULL, the whole set of analytics will be included.

Output:#

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

Usage:#

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

Example#