This research will focus on shortening the total trip time for passengers with the operation of rapid trains and is included in the improvement of the train diagram. In order to achieve this, the combination of the stations where rapid trains stop or pass to local ones, need to be properly set. However, a best solution is not calculated in real computation time using a round robin method because there are complex relationships between the OD (origin and destination), combination of stations and operational effects of the trains. This paper will describe a solution to the problem using a genetic algorithm (GA). The paper determines that the operation of the trains at a station can be classified in four conditions: rapid trains stop or pass and rapid trains pass, or do not pass, to local trains.