This study establishes an evaluation and optimization framework for the public transit network based on social network analysis and a greedy algorithm, aiming to explore a quantitative approach to improving access to urban parks through public transit optimization. Social network analysis and the ArcGIS platform are used to build a public transit network model within Nanjing Old City and analyze its overall network structure characteristics. The study also focuses on a method to improve the convenience of reaching regional and city-level parks by public transit by increasing access and connecting points accordingly. A greedy algorithm is introduced to generate an optimized solution for improving public transit accessibility to regional and city-level parks, consequently enhancing their utilization. The major findings include: (1) The greedy algorithm effectively enhances the performance of the public transit network, but its benefits gradually diminish as more stations are added. (2) Strategically adding stations enhances the performance of most public transit access points, creating efficient pathways for other stations to directly reach these access points and enter regional and city-level parks. (3) The optimized public transit network model offers guidance for the planning and layout of regional and city-level parks. The site selection for new parks should prioritize establishing connections with the “hubs” in the public transit network. The proposed optimization of the public transit network in this study is specific to a single type of urban park, but subsequent research could be conducted to extend the optimization of public transit accessibility around more urban public resources.