Urban taxi systems contribute to carbon emissions through inefficient cruising and prolonged idle times. This study develops a novel spatiotemporal framework integrating complex network analysis with Markov process modeling to optimize taxi operations for sustainable transportation. Using GNSS trajectory data from 7767 Shanghai taxis, we construct a city-wide taxi network and apply k-core decomposition to identify optimal operational strategies. Our analysis reveals that Shanghai’s taxi network exhibits a polycentric structure with a few high-value hubs, and demonstrates that drivers operating in high k-core (central network) regions achieve higher earnings while reducing idle time compared to peripheral areas. The framework provides data-driven, actionable insights for traditional cruising taxi operations, offering practical guidance for driver decision-making and supporting sustainable urban mobility planning with direct implications for reducing transportation-related carbon emissions in megacities worldwide.