Area of a null-homotopic word (source code)

= Area of a null-homotopic word
{title2=$\operatorname{Area}(w)$}

For a word $w\in F(S)$ representing the identity in $\langle S\mid R\rangle$, its area is the least $N$ for which
$$
w=\prod_{i=1}^N u_i r_i^{\varepsilon_i}u_i^{-1}
$$
in $F(S)$, where $r_i\in R$ and $\varepsilon_i\in\{-1,1\}$.