> ## Documentation Index
> Fetch the complete documentation index at: https://new.docs.falkordb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Algorithms

> Explore FalkorDB's high-performance graph algorithms including pathfinding (BFS, shortest path), centrality measures (PageRank, betweenness), and community detection (WCC, CDLP).

FalkorDB offers a suite of graph algorithms optimized for high-performance graph analytics.\
These algorithms are accessible via the `CALL algo.<name>()` interface and are built for speed and scalability using matrix-based computation.

This overview summarizes the available algorithms and links to their individual documentation.

## Table of Contents

* [Pathfinding Algorithms](#pathfinding-algorithms)
* [Centrality Measures](#centrality-measures)
* [Community Detection](#community-detection)
* [Network Flow Algorithms](#network-flow-algorithms)

***

## Pathfinding Algorithms

* **[BFS](/algorithms/bfs)**\
  Performs a breadth-first search starting from a source node and optionally stopping at target nodes or maximum depth.

* **[SPpath](/algorithms/sppath)**\
  Computes the shortest paths between a source and one or more destination nodes.

* **[SSpath](/algorithms/sspath)**\
  Enumerates all paths from a single source node to other nodes, based on constraints like edge filters and depth.

* **[MSF](/algorithms/msf)**\
  Computes the Minimum Spanning Forest of a graph, finding the minimum spanning tree for each connected component.

For path expressions like `shortestPath()` used directly in Cypher queries, refer to the [Cypher Path Functions section](/cypher/functions#path-functions).

## Centrality Measures

* **[PageRank](/algorithms/pagerank)**\
  Computes the PageRank score of each node in the graph, representing its influence based on the structure of incoming links.

* **[Betweenness Centrality](/algorithms/betweenness-centrality)**\
  Calculates the number of shortest paths that pass through each node, indicating its importance as a connector in the graph.

* **[Harmonic Centrality](/algorithms/harmonic-centrality)**\
  Measures node importance using the sum of inverse shortest-path distances to all reachable nodes, making it robust on disconnected graphs.

## Community Detection

* **[WCC (Weakly Connected Components)](/algorithms/wcc)**\
  Finds weakly connected components in a graph, where each node is reachable from others ignoring edge directions.

* **[CDLP (Community Detection Label Propagation)](/algorithms/cdlp)**
  Detects communities in a network, by propagating labels through the graph structure.

## Network Flow Algorithms

* **[MaxFlow](/algorithms/maxflow)**
  Computes the maximum amount of flow that can be routed through a directed, weighted graph from one or more **source** nodes to one or more **sink** (target) nodes.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="How do I call a graph algorithm in FalkorDB?">
    All algorithms are invoked using the `CALL algo.<name>()` syntax within a Cypher query. Each algorithm returns results via `YIELD` clauses. See individual algorithm pages for specific syntax.
  </Accordion>

  <Accordion title="Are FalkorDB algorithms optimized for large graphs?">
    Yes. FalkorDB algorithms use **matrix-based computation** for high performance and scalability, leveraging sparse matrix representations internally.
  </Accordion>

  <Accordion title="What is the difference between algo.SPpaths and algo.SSpaths?">
    **algo.SPpaths** finds shortest paths between a single source and a single target node. **algo.SSpaths** finds shortest paths from a single source to *all* reachable nodes. Use SPpaths for point-to-point queries and SSpaths for broader exploration.
  </Accordion>

  <Accordion title="Can I filter which nodes and edges are included in an algorithm?">
    Yes. Most algorithms accept optional `nodeLabels` and `relationshipTypes` parameters that let you restrict computation to specific subsets of the graph.
  </Accordion>

  <Accordion title="Which algorithm should I use for community detection?">
    Use **WCC** to find disconnected components (groups of nodes connected by any path). Use **CDLP** (Label Propagation) to detect densely connected communities within a connected graph. See [WCC](/algorithms/wcc) and [CDLP](/algorithms/cdlp) for details.
  </Accordion>
</AccordionGroup>
