In this paper, I utilize a new approach to gathering traffic data over a continuous-flow of traffic rather than at discrete locations in the vehicle-to-vehicle-to-infrastructure (V2V2I) Intelligent Transportation System Architecture, which is a hybrid of the vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) architectures. At present, many existing technologies such as loop detectors and video cameras, among other devices, could provide the primary means for gathering data, though it has now become possible using mobile and GPS technology to gather the speed and location of each vehicle in real-time over a continuous flow, which will allow more novel applications, such as incident identification and hazard alerts, to be developed. In addition, the paper brings forward an optimal path algorithm based on driving time according to the improved A*algorithm with dynamic speed pattern, which combines the gathering real-time traffic data that is the critical to determine the best path. It can be more accurate and more quickly to find the superior solution.