In order to solve the problem that system performances are impacted by increased train headway in the station area in an urban rail transit system, the existing algorithms for train headway in a CBTC (communication based train control) system were analyzed, and a headway optimization method was proposed based on the platform speed restriction and the speed-restriction-area parameter adjustment. With this method, an optimized train headway can be obtained by simulation of the relationship among platform speed restriction setting, train headway and travel speed. This method was simulated and tested on the CBTC simulation and performance analysis system developed by Southwest Jiaotong University. The process to optimize a train headway from 96 to 90 s in the test scenario was described. The result shows that the proposed method can optimize the headway in the critical area(s) of a CBTC system to improve the whole system performances.