This paper gives a detailed analysis of the existing city shortest path algorithm[1], aiming at the high time complexity and can not represent the real situation of the problem of the existing city shortest path selection algorithm, and bases on the idea of Dijkstra algorithm, puts forwarda fast algorithm of optimal path of the city. This algorithm can be considered to simulate the real situation may in the road grade, the degree of congestion, traffic light quantity and other factors, at the same time can be optimized in the time complexity of the algorithm, to achieve the shortest path fast search. The experimental results show that this method can simulate the real situation in as far as possible under the condition, reduces the time complexity of the algorithm, and get feasible result.