Solution (source code)

= Solution

For a triangle, $p_{C_3}=x(x-1)(x-2)=(x-1)^3-(x-1)$. For $n\ge4$, deleting an edge leaves a path with polynomial $x(x-1)^{n-1}$, and contracting it leaves $C_{n-1}$. Deletion-contraction and induction give
$$
p_{C_n}=x(x-1)^{n-1}-\{(x-1)^{n-1}+(-1)^{n-1}(x-1)\}
=\boxed{(x-1)^n+(-1)^n(x-1)}.
$$
The path formula chooses its first color freely and each succeeding color in $x-1$ ways.