A polynomial approach to the solution of the invariant polynomials assignment problem for periodic systems