An iterative algorithm to determine the number of time steps in path generation methods. (29th January 2016)