Cycle Detection in Simulations
Skip ahead when the state repeats.
When Steps Repeat
Some simulations ask for the state after a huge number of steps, like a trillion. Stepping one at a time would never finish in time. ⏳
States Are Finite
If the number of possible states is limited, the simulation must eventually revisit one. From there it repeats forever in a cycle.
All lessons in this course
- Model State and Step Forward
- Grid Walks and Direction Vectors
- Cycle Detection in Simulations
- Tame the Tricky Edge Cases