---
title: floyd_warshall
url: https://nexyron.tech/docs/cypher/procedures/algorithms/shortest-path-and-routing/floyd-warshall
description: Shortest path and routing procedures compute feasible routes under different cost and graph assumptions. They are useful for logistics, dependency chains, impact paths, and path ba
---

# floyd_warshall

## Generic Description

All-pairs shortest paths.

Simple example:

```cypher
CALL nexyron.floyd_warshall()
```

Shortest-path and routing procedures compute feasible routes under different cost and graph assumptions. They are useful for logistics, dependency chains, impact paths, and path-based explainability.

## Consumer-Level Explanation

Use `floyd_warshall` when all-pairs shortest paths is the graph-analysis or operational question you actually need to answer. Keep the call explicit because its `YIELD` columns, row grain, and required runtime state determine how the rest of the Cypher pipeline can safely compose it. Choose the routing algorithm based on weights, negative costs, DAG assumptions, heuristic availability, and whether you need one path, all-pairs distances, or multiple alternatives.

## Conceptual Explanation

`floyd_warshall` should be read as one named procedure contract in the broader Nexyron Cypher surface. The procedure call is not only a syntax hook: it defines what runtime state, projection, registry entry, or graph algorithm is being asked to operate, and it determines which output columns downstream `YIELD`, `WITH`, and `RETURN` stages can safely use.

## More Detailed Explanation

This differs from source-centric algorithms by materializing distances between every pair

In practical queries, start by deciding the row grain you want after the call: one row per node, one row per path, one row per registry object, one row per artifact, or one row per summary. Then keep that grain explicit with `YIELD` and named projections. That is the difference between a useful planner-facing example and a vague call that downstream tooling cannot safely compose. For contract-driven procedures, the executable examples on these pages intentionally inspect procedure metadata unless the required named artifacts are created in the same example.

## How It Differs From Nearby Algorithms

This differs from source-centric algorithms by materializing distances between every pair.

## Advanced Example

This example yields named columns from `floyd_warshall` and returns a bounded result shape that downstream planner tooling can compose without guessing column names or row grain.

```cypher
CALL nexyron.floyd_warshall() YIELD source, target, distance
RETURN source, target, distance
LIMIT 10
```

## Real Use Cases

-   small-graph full distance matrices
-   routing precomputation
-   exhaustive path cost inspection
-   compare algorithm output with domain labels or time windows before operationalizing it
-   feed graph-analytic scores into ranked reports, feature contracts, or investigation queues only after checking the modeling assumptions

## Real Limitations And Tradeoffs

-   too heavy for large graphs
-   algorithm output reflects the projected graph, not an abstract real-world network outside the data model
-   nearby algorithms can answer different questions even when their output columns look similar
