To reduce the number of calculation of min of cost function, we use the method like dichotomy, divide the time into four equal parts.
Choose the min cost fun time point as winner, So we have these cases:
-
winner=0(first)
min located t_0 to t_1, in the next iteration find the min between t_0 to t_1, reset the t_min=t_0, t_max=t_1, and don’t have to calculate the cost fun at t_0 and t_1 again.
-
winner=4(last)
min located t_3 to t_4, in the next iteration find the min between t_3 to t_4, reset the t_min=t_3, t_max=t_4, and don’t have to calculate the cost fun at t_3 and t_4 again. -
winner=else
min located t_win-1 to t_ win+1, in the next iteration find the min between t_ win-1 to t_ win+1, reset the t_min=t_ win-1, t_max=t_ win+1, and don’t have to calculate the cost fun at t_ win-1 and t_ win+1 again.
So in the next iteration, we do the same find where the min locates and reset the searching aera again.
To calculate the cost function of trajectory