How We Designed and Implemented Graph Projection Feature
Blog post from Memgraph
Memgraph has introduced a new graph projection feature that allows users to perform algorithms on specific subgraphs, addressing a growing demand for running queries on graph subsets. This feature is implemented through the project() function, which creates subgraphs by storing vertices and edges defined in a query's MATCH clause. The team navigated challenges in extending C API functions to handle projected graphs, ultimately opting for a solution leveraging C++17's std::variant for efficient data management and dynamic polymorphism. This innovation enables advanced graph analyses, such as PageRank and centrality metrics, on subgraphs without additional adjustments and supports machine learning applications using the Memgraph MAGE library. Despite initial complications in managing data types and structures, the feature promises enhanced performance and flexibility for users, fostering a broader scope of graph analysis and machine learning possibilities within Memgraph.