## 3 Mechanism and Algorithm  
### Description of Stable Trading Matching  
* Definition 1: Description of satisfaction with a match  
In the two-sided trading matching problem, information about the order of preferences is the common method for the buyer and seller to express their satisfaction with the matching partner. The seller tends to focus on the buyers' offer price, time of payment, and credibility and then specifies its order of preferences for buyers. The buyer tends to focus on the information about the product quality, prices, and delivery dates that is provided by the sellers and then makes its seller preference order known. It should be noted that, under certain circumstances, both the buyers and sellers are interested in all of the participants on the other side of the market and accordingly provide an order of preferences for all of the participants; this is referred to as complete preferences. However, the buyers and sellers are sometimes only interested in certain participants on the other side of the market and only provide an order of preferences for the parties that they are interested in; this is referred to as incomplete preferences. Coal mining companies and power generation companies all have an order of preferences for each participant on the other side of the market. We denote the vector of coal mining company \(S_{i}\)'s order of preference for power generation company \(d_{j}\) as \(X_{ij}=\{x_{i1},\,x_{i2},\,\ldots,\,x_{ij}\}\) and use \(x_{ij}\) to indicate that coal mining company \(S_{i}\)'s preference for power generation company \(d_{j}\) ranks \(x_{ij}\)th. We denote the vector of power generation company \(d_{i}\)'s order of preference for power generation company \(S_{i}\) as \(Y_{ij}=\{y_{1j},\,y_{2j},\,\ldots,\,y_{ij}\}\) and use \(y_{ij}\) to indicate that power generation company \(d_{i}\)'s preference for coal mining company \(S_{i}\) ranks \(y_{ij}\)th. * Definition 2: Pairwise stability between coal mining and power generation companies  
The goal of trading matching between the coal mining and power generation companies that was set in this paper is to reach stable matching between the two sides. We define pairwise stable matching as follows: for coal mining company \(S_{i}\) and power generation company \(d_{j}\), if, under matching scheme \(\mu\), the following conditions are met: the matching achieves a trading amount \(u(i,j)=0\); the order of preferences \(x_{ij}>x_{im}\), \(m\in\mu(S_{i})\); and the order of preferences \(y_{ij}>y_{nj}\), \(n\in\mu(d_{j})\), then matching \(\mu\) is pairwise unstable; otherwise matching \(\mu\) is pairwise stable. In the above conditions, \(u(i,j)=0\) indicates that, under matching \(\mu\), coal mining company \(S_{i}\) and power generation company \(d_{j}\) reach a zero trading amount in their dealings. This can be expressed through a verbal description: on the trading platform of the China (Taiyuan) Coal Exchange Center, coal mining companies and power generation companies are unwilling to sign medium- or long-term sales contracts; based on their own demand and supply situations as well as their expectations for the market, the participants on the two sides of the market cannot reach an agreement on the sales amounts. The orders of preferences are the basis on which both the coal mining and power generation companies find their matching partner and the participants on either side of the market have strict, transitive preferences for the participants on the other side.