Constrained Invariant Motions for Networked Multi-Agent Systems