Energy efficiency management, in addition to the balance between energy supply and demand, requires thorough policy and elaborate decision-making by governments to adopt appropriate strategies to achieve the targeted goals. Combined heat and power systems featuring a decentralized and independent generation model of both electricity and heat, which procures efficient utilization of wasted energy, prevention of losses in distribution and transmission grid. Furthermore, the deployment of such a scheme results in reducing fuel consumption as well as the emission of environmental pollutants, increasing competitiveness, and liquidity in electricity markets. Optimal scheduling of small-scale combined heat and power systems in response to the consumption pattern and the electrical and heat demand of a typical customer as well as the type of interactions and interoperability with the aggregators and the market is an innovative paradigm to improve the efficiency of distributed generation resources. Due to the physical correlation between these two types of energy, the effective implementation of such schemes entails meticulous configuration and arrangement, precise modeling, and even rigorous simulation. Hence, to get a convincing and superb performance, particular attention must be paid to the model. This paper delves into the impacts of energy exchange between CHP and the upstream grid and the way to optimize it subject to satisfaction of the optimal capacity constraints. In this regard, the linear modeling method is employed and the optimization problem is solved by Grasshopper Optimization Algorithm (GOA) using MATLAB software. The Islamic Azad University of Najafabad (IAUN) complex is considered as the case study in this paper. The results imply that a significant part of the energy generated in the combined heat and power unit can be sold to the grid, this will play a vital role in reducing the cost of electricity supply.