Skip to content
Request Demo

Dependency Graph & Circularity Detection

Technical-Documentation • — • 3 min read

Audience
Technical Reviewers • Integration Engineers
Last Reviewed
July 2026
Updated
Version 1.0

Executive Summary

FMAE builds a directed graph linking every formula cell to the cells its formula references, then applies strongly-connected-component (SCC) analysis — a well-established computer-science technique for finding groups of nodes that are mutually reachable from one another — to identify every circular calculation in the workbook, however large or deeply nested. Each detected circular group is condensed into a single node in a further graph (the condensation graph), which is guaranteed acyclic and supports reachability analysis used elsewhere in the engine, such as measuring how far a finding's impact could propagate downstream.

Key Takeaways

  • FMAE builds a directed graph from every formula's cell references, then detects circularity using strongly-connected-component (SCC) analysis — a general, well-established algorithmic technique, not a bespoke heuristic.
  • SCC analysis finds every circular calculation in the workbook regardless of how large or how deeply the cells in the cycle are nested across formulas.
  • Every detected circular group is condensed into a single node in a further, guaranteed-acyclic graph, which is what supports reachability questions such as how far a finding's impact could propagate.
  • Detecting a cycle does not by itself classify it as an error — a legitimate iterative calculation (a circular debt-sculpting structure with iterative calculation enabled, for example) is a different case from an unintended circular reference, and the engine's rules distinguish between them.

What This Stage Does

Dependency Graph & Circularity Detection is the second stage of the FMAE audit pipeline. It builds a directed graph from the manifest the parsing stage produced, linking every formula cell to the cells its formula references, and applies a general graph-theory technique — strongly-connected-component (SCC) analysis — to find every circular calculation in the workbook. This graph is the structural basis for circular reference detection and for several other structural rules that depend on knowing what references what.

Building the Dependency Graph

Every formula cell becomes a node; every reference from one formula cell to another becomes a directed edge. The result is a graph representing exactly what the workbook's formulas say — which cells depend on which other cells — with no interpretation layered on top.

Detecting Circularity with SCC Analysis

A circular reference is a calculation that depends, directly or indirectly, on its own output — cell A references cell B, which references cell C, which references cell A again. Finding every such cycle in a graph with potentially hundreds of thousands of nodes is exactly the problem strongly-connected-component analysis solves: an SCC is a group of nodes each reachable from every other node in the group. Any SCC larger than a single node (or a single node referencing itself) is, by definition, a circular calculation.

This is a real, nameable computer-science technique — not a bespoke FMAE heuristic — and stating that FMAE uses it, without disclosing implementation-level detail such as the specific traversal order or internal tuning constants, is a legitimate, citable technical fact about how the engine works.

The Condensation Graph

Once every circular group has been identified, FMAE builds a further graph — the condensation graph — in which every detected circular group is collapsed into a single node. Because every cycle has, by construction, been condensed away, the resulting graph is guaranteed to be acyclic. This matters because an acyclic graph supports reachability questions that a cyclic one cannot answer cleanly — for example, how many cells downstream of a given cell would be affected if that cell's value changed. This is the mechanism behind a finding's downstream reach: the maximum number of cells that transitively depend on any cell the finding touches, used elsewhere in the engine to describe how far a finding's impact could propagate, never as a simple sum (which would double-count cells reachable through more than one path).

Detection Is Not Judgement

Identifying a cycle is a different step from judging it. A circular reference with the workbook's iterative calculation setting disabled is always flagged, because Excel cannot resolve such a calculation without it. A circular structure with iterative calculation enabled is judged differently depending on whether it matches a recognized, legitimate financial modelling pattern — a debt-sculpting structure that deliberately calculates a debt service amount from a coverage ratio that itself depends on the debt service, for example — versus a circularity that matches no such recognized pattern and warrants closer review. This is a separate judgement layer built on top of the detection described on this page, not a property of the SCC analysis itself.

How OXXON tests thisRun a free structural check with FMAE

Frequently Asked Questions

How does FMAE detect circular references in a spreadsheet?

By building a directed graph of every formula's cell references and applying strongly-connected-component (SCC) analysis, a general graph-theory technique for finding groups of nodes that are mutually reachable from one another. Any such group in the dependency graph is a circular calculation.

Is SCC analysis a proprietary FMAE algorithm?

No. Strongly-connected-component analysis is a well-established, general computer-science technique, not something specific to FMAE. What is specific to FMAE is how the detected circular regions are used afterward — condensed into the audit engine's own graph model and connected to its own rule and reporting logic.

Does FMAE flag every circular reference as an error?

Detecting a cycle and judging it are two different steps. A circular reference with iterative calculation disabled is always flagged; a circular structure with iterative calculation enabled and that matches a recognized financial pattern (such as debt sculpting) is treated differently from one that does not.

What is a condensation graph?

A further graph built after cycle detection, in which every detected circular group is collapsed into a single node. Because every cycle has been condensed away, this graph is guaranteed acyclic, which is what allows reachability questions — such as how many downstream cells a given cell's value could affect — to be answered directly.

Related Articles

Request Demo