This study proposes a simultaneous optimization model that considers flow assignment and vehicle capacity for the problem of transit network design to determine the route structure and frequencies simultaneously. The problem is focused on reducing the total travel time and the number of transfers. A heuristic algorithm is developed to solve this problem. In the proposed algorithm, the initial routes are generated according to a changing demand matrix, which can reflect the real-time demand with transfers and ensure that the direction of route generation maximizes the percentage of direct service. A regulating method for a sequence of stops is used during route generation to guarantee the shortest trip time for a formed route. Vehicles are allocated to each route according to the flow share. The concept of vehicle difference is introduced to evaluate the distinction between actual allocated vehicles and required vehicles for each route. The optimization process of frequencies based on vehicle difference can ensure that the solution meets the constraints. Two scale networks are used to illustrate the performances of the proposed method. Results show that route structure and frequencies can be optimized simultaneously through the proposed method. Different scenarios are created to test the algorithm properties via various parameter values. The test result indicates that the upper bound is a key parameter to balance the proportion of direct service and average in-vehicle travel time (AIVTT), and the increased number of planning routes can improve the proportion of direct service.