Finding weakly connected components in Memgraph graph

Question:

Does Memgraph have and algorithm for finding weakly connected components in graphs? I couldn’t find it among Memgraph built-in algorithms or MAGE algorithms.

Asked By: Gaudeamus

||

Answers:

You can use weakly_connected_components query modules. Memgraph comes with NetworkX library. NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.

You can call it with the following command:

CALL weakly_connected_components.get()
YIELD node, component_id;

The complete documentation is available on the Memgraph website.

Answered By: KWriter