The Invariant Principle is applicable to algorithms (games, transformations). Some task is repeatedly performed. What stays the same? What remains invariant? Here is a saying easy to remember:
If there is repetition, look for what does not change!
In algorithms there is a starting state S and a sequence of legal steps (moves, transformations).
One looks for answers to the following questions:
1. Can a given end state be reached?
2. Find all reachable end states.
3. Is there convergence to an end state?
4. Find all periods with or without tails, if any.