In this paper we propose a trajectory planning approach for autonomous vehicles on structured road maps. It is using the well-known A* optimal path planning algorithm. We generate a safe optimal trajectory through a three-dimensional graph, considering the two-dimensional position and time. (1) The graph is generated dynamically with flexible distances between nodes, based on the vehicles velocity and a structured road map. (2) Furthermore the position of dynamic obstacles is predicted over time along the road lanes. The proposed Flexible Unit A* (FU-A*) algorithm was tested for real-time applications with execution times less than 50 ms. The feasibility and reliability of FU-A* is validated by implementing on simulated autonomous car of Freie university "MadeInGermany" using the roadmap of Tempelhof, Berlin.