Switching the base station (BS) with low traffic into sleep mode is considered as one of the most promising technologies for energy saving in the cellular networks. In this paper, we focus on the switching method considering the quality of service (QoS) as well as energy saving of the whole network. The network topology is modeled as a weighted affinity graph to describe the possible associations of user equipment (UEs) and the BSs in the network. Then the maximization problem of the network performance valued by the QoS and energy saving is formulated. Based on that, a dynamic energy saving (DES) algorithm is proposed. After optimized by DES, the network is reconfigured by switching certain BSs into sleep mode. Simulation results under different traffic conditions demonstrate that the proposed DES algorithm can significantly reduce energy consumption and improve the energy efficiency.