Invariant Variational Problems and Invariant Flows