Spreadsheet dependency graph (source code)

= Spreadsheet dependency graph
{title2=$G=(V,E)$}

The <directed graph> whose <vertices> are the <spreadsheet cells> and whose <directed edges> $u\to v$ mean that the <spreadsheet formula> in $v$ references $u$. Input <spreadsheet cells> have no prerequisites in this model. Retain both incoming references and outgoing consumers: <depth-first search> for evaluation follows incoming references backwards, whereas downstream invalidation follows outgoing consumers forwards. A <directed path> then expresses indirect dependence, and a <directed cycle> expresses a <spreadsheet circular reference>.