An algorithm optimizing train running profile with Bellman's Dynamic Programming (DP) is investigated in this paper. Optimal running trajectory of a train which minimizes amount of total energy consumption has been produced under fixed origin and destination, stipulated running time and various track profile. Many previous works on this area adopt the numerical techniques of calculus of variations, Pontryagin's maximum principle, and so on. But these methods often meet some difficulties accounting for complicated actual train running preconditions, e.g. complicated functions which describe electrical motive/brake torque, local constraints of the state variable as speed limitations, non-linear running resistance and variable grade profiles. Basic numerical DP algorithm can cope with such comlicated conditions and give the globally optimal solution. But this method consumes too large computation time for practical uses. We have made the improvements for shorter calculation time of whole optimization process and reducing the numerical error. The confined state space and irregular lattice play most important role for them. Dynamic meshing and effective utilization of system memory also realize shorter computation time. The effectiveness of the proposed method is demonstrated using various complicated running conditions.