## 3 Distributed Method
### Distributed Method
**: Update \(z_{i}^{p}\), \(z_{i}^{pq}\), \(z_{i}^{qp}\) and \(z_{i}^{q}\) (i.e., the estimated electrical and heat power outputs before considering inequality constraints) based on Equation (11b)
**(2c). **: Choose projection operations based on Equation (11c) to calculate \(x_{i}^{p}\), \(x_{i}^{pq}\), \(x_{i}^{qp}\) and \(x_{i}^{q}\) (i.e., the estimated electrical and heat power outputs after considering inequality constraints)
**(2d). **: Update \(y_{i}^{p}\), \(y_{i}^{pq}\), \(y_{i}^{qp}\) and \(y_{i}^{q}\) based on Equation (11d)
**(3). **: Else (i.e., in the odd-numbered iteration)  
**(3a). **: Update \(\lambda_{i}^{p}\), \(\lambda_{i}^{pq}\), \(\lambda_{i}^{qp}\) and \(\lambda_{i}^{q}\) based on Equation (12a)
**(3b). **: Update \(z_{i}^{p}\), \(z_{i}^{pq}\), \(z_{i}^{qp}\) and \(z_{i}^{q}\) based on Equation (12b)
**(3c). **: Choose projection operations based on Equation (12c) to calculate \(x_{i}^{p}\), \(x_{i}^{pq}\), \(x_{i}^{qp}\) and \(x_{i}^{q}\)
**(3d). **: Update \(y_{i}^{p}\), \(y_{i}^{pq}\), \(y_{i}^{qp}\) and \(y_{i}^{q}\) based on Equation (12d)
**(4). **: Let \(t=t+1\), turn to step 1. **Remark 3**: _The distributed fashion of our method is reflected in that each agent only requires its own information and neighbors' information to calculate the optimal solution. Specifically, each agent only needs to exchange the local information of \(\lambda_{i}^{p}\), \(\lambda_{i}^{pq}\), \(\lambda_{i}^{qp}\) and \(\lambda_{i}^{q}\) (and \(y_{i}^{p}\), \(y_{i}^{pq}\), \(y_{i}^{qp}\) and \(y_{i}^{q}\)) with its neighbors. Furthermore, the updating processes for all of variables are implemented through local calculation. On the contrary, centralized methods require a central controller and rely on a two-way communication network structure between the central controller and each agent. The central controller should collect all of the information of each agent to calculate the optimal solution, and then sent the optimal solution to each agent._  
**Remark 4**: _Existing methods to solve the CHPEDP are mainly based on the centralized fashion, such as [4; 7], etc. However, they have some obvious demerits as follows. (1) Since the centralized methods rely on a central controller, they are susceptible to single-point failures. To be specific, if the communication line between the central controller and any agent is failure, then the corresponding agent cannot keep working in the optimal operating point. Moreover, if the centralized controller is failure, then the whole system will lose control which may result in serious consequence, e.g., supply-demand unbalance. (2) When a new agent is connected to the system, the communication link between the new agent and the central controller must be established, which cannot be flexible for possible integration and expansions of devices. (3) Centralized methods cannot provide a satisfied plug-and-play function. On the contrary, the proposed distributed method is more reliable, robust, flexible and cost-effective and can address the plug-and-play feature in a better way. To be specific, since each agent can calculate its optimal operating point by using its own and neighbors information, a single (even several) link failures will not affect the optimal performance as long as the communication network maintains strong connection. Furthermore, when a new agent is required to be added into the system, the agent needs only establish the communication links with its neighbor agents, which simplifies the system maintenance and possible expansions. Moreover, the communication structure used in this paper with strong connection is a sparse communication structure, in which each agent only needs its local information and its neighbor's information to calculate the optimal solution. Thus, distributed method used in this paper is less expensive and more cost-effective. In addition, the distributed method provides desired plug-and-play feature for the future CHP system. It is very difficult for centralized method to meet this feature when the system becomes larger and larger.