This paper proposes an efficient method to derive the optimal routing path from the end-user to the specific server with time constraints. Although this paper is based on "backtracking," no other literature has been reported using the same methodology for this problem. The results of this study show that it is very efficient by comparing with the best known algorithm. The optimal routing path from the end-user to the specific server with various time constraints can be efficiently derived by the proposed method. This method enables the possibility of providing optimal dynamic routing service and hopes to solve the timeliness problem in cloud computing environment. Some numerical examples are demonstrated to explain this method.