In order to achieve an automatic parking for a four-wheeled vehicle, it is necessary to consider back and forth motion before the final approach, as well as backward motion in the final approach. In this paper, a method to generate the path consisting of line segments, circular arcs, and clothoid arcs including the back and forth motion is presented. The method is derived by pay attention to a point that a middle goal selection makes an impact to a generated path which has shorter path length. By using the proposed method, the path is found easily for both reverse parking and parallel parking