Search code examples
memgraphdb

What are all types of variable expansions supported by Memgraph?


I am currently using Memgraph as a graph databases in my learining project. I understand that variable expansions play a significant role in traversing graphs, especially when querying relationships between nodes.

Based on the capabilities of Memgraph, could someone specify the types of variable expansions that are supported?


Solution

  • Memgraph supports following types of variable expansions:

    1. Depth-first search (DFS): DFS is an algorithm that visits vertices in a graph as far as possible along each branch before backtracking.

    2. Breadth-first search (BFS): BFS operates by visiting all the vertices of the current level before moving to vertices of the next level. BFS in Memgraph is implemented through shortest path algorithms:

      • SingleSourceShortestPath: Finds the shortest path from a single source node to all other nodes in the graph.

      • STShortestPath: Computes the shortest path between a specific source node and a specific target node.

    3. WeightedShortestPath: This algorithm takes into account edge weights when calculating the shortest paths.

    4. AllShortestPath: Finds all shortest paths between all pairs of nodes in a graph.