Maximal bandwidth problems: a new algorithm based on properties of periodicity of the system