Chromatic polynomial of a unicyclic graph (source code)

= Chromatic polynomial of a unicyclic graph
{title2=$p_G(x)=(x-1)^n+(-1)^\ell(x-1)^{n-\ell+1}$}

If a <unicyclic graph> has $n$ <vertices> and its unique <graph cycle> has length $\ell$, each of its $n-\ell$ off-<graph cycle> <vertices> contributes a factor $x-1$ after its <parent in a rooted tree> is coloured. Thus $p_G(x)=(x-1)^{n-\ell}p_{C_\ell}(x)$. Substituting the <chromatic polynomial of a cycle> yields the displayed formula, equivalently by repeated application of the <chromatic polynomial after attaching a leaf>.