Available algorithms

Available advanced algorithms

If you require procedures designed to solve specific graph problems, there is a number of advanced algorithms available in Memgraph.

Some algorithms are built in, and others are available in the MAGE graph library.

Deep path traversal algorithms

AlgorithmsLangDescription
Depth-first searchC++An algorithm for traversing through a graph starting based on nodes' depth (distance from the source node).
Breadth-first searchC++An algorithm for traversing through a graph starting based on nodes' breadth (distance from the source node).
Weighted shortest pathC++The weighted shortest path problem is the problem of finding a path between two nodes in a graph such that the sum of the weights of relationships connecting nodes, or the sum of the weight of some node property on the path, is minimized.
All shortest pathsC++Finding all shortest paths is an expansion of the weighted shortest paths problem. The goal of finding the shortest path is obtaining any minimum sum of weights on the path from one node to the other.

Traditional graph algorithms

AlgorithmsLangDescription
algoC++The algo module provides users with a powerful set of graph algorithms, enabling users to perform complex graph-based operations and computations, such as graph traversal, edge detection, and more.
betweenness_centralityC++The betweenness centrality of a node is defined as the sum of the of all-pairs shortest paths that run through the node, divided by the number of all-pairs shortest paths in the graph. The algorithm has O(nm) time complexity.
biconnected_componentsC++Algorithm for calculating maximal biconnected subgraph. A biconnected subgraph is a subgraph with a property that if any vertex were to be removed, the graph will remain connected.
bipartite_matchingC++Algorithm for calculating maximum bipartite matching, where matching is a set of nodes chosen in such a way that no two edges share an endpoint.
bridgesC++A bridge is an edge, which when deleted, increases the number of connected components. The goal of this algorithm is to detect edges that are bridges in a graph.
community_detectionC++The Louvain method for community detection is a greedy method for finding communities with maximum modularity in a graph. Runs in O(nlogn) time.
cyclesC++Algorithm for detecting cycles on graphs.
degree_centralityC++The basic measurement of centrality that refers to the number of edges adjacent to a node.
distance_calculatorC++Module for finding the geographical distance between two points defined with 'lng' and 'lat' coordinates.
graph_coloringPythonAlgorithm for assigning labels to the graph elements subject to certain constraints. In this form, it is a way of coloring the graph vertices such that no two adjacent vertices are of the same color.
katz_centralityC++Katz centrality is a centrality measurement that outputs a node's influence based on the number of shortest paths and their weighted length.
kmeans_clusteringPythonAn algorithm for clustering given data.
max_flowPythonAn algorithm for finding a flow through a graph such that it is the maximum possible flow.
node_similarityC++A module that contains similarity measures for calculating the similarity between two nodes.
pagerankC++Algorithm that yields the influence measurement based on the recursive information about the connected nodes influence.
pathC++A module for working with intricate connections in graph-like structures. It provides functions and procedures to navigate and analyze paths, helping users uncover insights from complex data relationships.
set_coverPythonAn algorithm for finding the minimum cost subcollection of sets that covers all elements of a universe.
tspPythonAn algorithm for finding the shortest possible route that visits each vertex exactly once.
union_findPythonA module with an algorithm that enables the user to check whether the given nodes belong to the same connected component.
vrpPythonAlgorithm for finding the shortest route possible between the central depot and places to be visited. The algorithm can be solved with multiple vehicles that represent a visiting fleet.
weakly_connected_componentsC++A module that finds weakly connected components in a graph.

Streaming graph algorithms

AlgorithmsLangDescription
betweenness_centrality_onlineC++A dynamic algorithm that updates exact betweenness centrality scores of nodes in evolving graphs. Suitable for graph streaming applications.
community_detection_onlineC++A dynamic community detection algorithm suitable for large-scale graphs based upon label propagation. Runs in O(m) time and has O(mn) space complexity.
katz_centrality_onlineC++Online implementation of the Katz centrality. Outputs the approximate result for Katz centrality while maintaining the order of rankings.
node2vec_onlinePythonAn algorithm for calculating node embeddings as new edges arrive.
pagerank_onlineC++A dynamic algorithm made for calculating PageRank in a graph streaming scenario.

Graph ML algorithms

AlgorithmsLangDescription
link_prediction with GNNPythonModule for predicting links in the graph by using graph neural networks.
node_classification with GNNPythonGraph neural network-based node classification module
node2vecPythonAn algorithm for calculating node embeddings on static graph.
temporal_graph_networksPythonA graph neural network (GNN) algorithm that can learn to predict new edges and node labels from the graph structure and available node and edge features.

Utility algorithms

AlgorithmsLangDescription
conditional_executionC++Define conditions not expressible in Cypher and and use them to control query execution.
collectionsC++The collections module is a collection manipulation module that offers functions to work with lists in Cypher queries, allowing operations like filtering, sorting, and modification for efficient data handling.
createC++The create module is a set of powerful tools that provide additional capabilities for creating nodes and relationships in the Memgraph graph database.
dateC++The date module provides various utilities to handle date and time operations within the Cypher query language.
export_utilPythonA module for exporting the graph database in different formats (JSON).
graph_analyzerPythonThis Graph Analyzer query module offers insights about the stored graph or a subgraph.
graph_utilC++A module with common graph algorithms and graph manipulation utilities
import_utilPythonA module for importing data from different formats (JSON).
json_utilPythonA module for loading JSON from a local file or remote address.
labelC++The label module provides an array of utilities for working with labels.
llm_utilPythonA module that contains procedures describing graphs in a format best suited for large language models (LLMs).
mapC++The map module offers a versatile toolkit for manipulating collections of key-value pairs, enabling advanced data operations within a graph database context
mergeC++A module which provides the capabilities of the MERGE Cypher command, merging or creating nodes and relationships as per specified conditions. It ensures precision and coherence in managing interconnected data structure.
metaC++Provides information about graph nodes and relationships.
meta_utilPythonA module that contains procedures describing graphs on a meta-level.
migratePythonA module that can access data from a MySQL, SQL Server or Oracle database.
neighborsC++The neighbors module allows users to interact with and query nodes that have direct relationships to a specified node.
nodeC++A module that provides a comprehensive toolkit for managing graph nodes, enabling creation, deletion, updating, merging, and more.
nodesC++A module that provides a comprehensive toolkit for managing multiple graph nodes, enabling linking, updating, type deduction and more.
periodicC++A module containing procedures for periodically running difficult and/or memory/time consuming queries.
refactorC++The refactor module provides utilities for changing nodes and relationships.
rust_example (opens in a new tab)RustExample of a basic module with input parameters forwarding, made in Rust.
temporalPythonA module that provides functions to handle temporal (time-related) operations and offers extended capabilities compared to the date module.
textC++The text module offers a toolkit for manipulating strings.
util_moduleC++A module which offers a range of functions for tasks such as validation and creating cryptographic hash values. This module serves as a practical resource for streamlining a variety of tasks related to database operations.
uuid_generatorC++A module that generates a new universally unique identifier (UUID).
xml_modulePythonA module which enhances graph database capabilities by providing support for loading and parsing XML data.

Integrations

AlgorithmsLangDescription
cugraphCUDACollection of NVIDIA GPU-powered algorithms integrated in Memgraph. Includes centrality measures, link analysis and graph clusterings.
elasticsearchPythonA module used for synchronizing Memgraph and Elasticsearch.
igraphPythonA module that provides igraph integration with Memgraph and implements many igraph algorithms.
nxalgPythonA module that provides NetworkX integration with Memgraph and implements many NetworkX algorithms.