China consumes significant amount of natural gas in winter. The integrated community energy utilization system (ICEUS) cannot stabilize the output of electricity and heat if there is a shortage of natural gas. The operation cost of the system still needs improvement. An energy supply structure using garbage power as the core of ICEUS was established in the study. The optimal dispatching model of ICEUS was established using the regulating characteristic of the community load. The sine-cosine algorithm (SCA) based on nonlinear factors and segmented weight was presented to solve the optimal dispatching model of ICEUS. From the simulation results, compared with particle swarm optimization algorithm (PSO), SCA, exponential sine-cosine algorithm (ESCA), and parabolic sine-cosine algorithm (PSCA), the daily operation cost of ICEUS was reduced by the improved SCA by 4.4%, 2.9%, 2.6% and 4.1%, respectively, in winter. The same was true in summer. The daily system operating cost was effectively reduced by the algorithm proposed in the study. The cost benefits of the optimized ICEUS operation was realized. © 2022, Tech Science Press. All rights reserved.