## 3 The Cooperative Beam Association and Power Allocation Scheme
### Matching Game-Based Beam Association  
The matching game is a promising approach to manage communication resources. For the UD-LSC system, each LBC can be served by multiple LEO satellites, and meanwhile, each LEO satellite can form \(L\) downlink beams to provide communication services. Then, a many-to-many matching game can be modeled.  
**Definition 1**.: _Given two disjoint sets, \(\mathcal{S}=\{1,2,\cdots,K\}\) of LEO satellites, and \(\mathcal{LB}=\{1,2,\cdots,M\}\) of LBCs, a many-to-many matching \(\Theta\) is a mapping from the set \(\mathcal{S}\cup\mathcal{LB}\cup\{0\}\) into the set of all subsets of \(\mathcal{S}\cup\mathcal{LB}\cup\{0\}\) such that for every \(k\in\mathcal{S}\) and \(m\in\mathcal{LB}\), (1): \(\Theta(k)\subseteq\mathcal{LB}\) and \(\Theta(m)\subseteq\mathcal{S}\); (2): \(|\Theta(k)|\leq L\) and \(|\Theta(m)|\leq K\); (3): \(k\in\Theta(m)\Leftrightarrow m\in\Theta(k)\)._  
For LEO satellites and LBCs, we define the preferences as the sum communication satisfaction, as shown in (8).  
\[PF_{m}(k)=PF_{k}(m)=\sum_{m=1}^{M}\Gamma_{m} \tag{8}\]  
With different beam association results, the sum communication satisfaction \(\sum_{m=1}^{M}\Gamma_{m}\), i.e., \(PF_{m}(k)\) and \(PF_{k}(m)\), dynamically changes. Different from the traditional preferences introduced in [14] whose preference list is unchanged, the preference of LEO satellites for different LBCs and the preference of LEO satellites for different LBCs are influenced by each other so that \(\Theta\) is a matching model with externalities [15]. Different from the traditional Gale-Shapley algorithm, swap matching is considered that every two objects are able to exchange their matches.  
**Definition 2**.: _Given a matching \(\Theta\) with \(m_{p}\in\Theta(k_{i})\), \(m_{q}\in\Theta(k_{j})\), and \(m_{p}\
otin\Theta(k_{j})\), \(m_{q}\
otin\Theta(k_{i})\), a swap matching \(\Theta_{jq}^{ip}\) is defined by the function \(m_{q}\in\Theta_{jq}^{ip}(k_{i})\), \(m_{p}\in\Theta_{jq}^{ip}(k_{j})\) and \(m_{q}\
otin\Theta_{jq}^{ip}(k_{j})\), \(m_{p}\in\Theta_{jq}^{ip}(k_{i})\)._  
**Definition 3**.: _Given a matching \(\Theta\) and a pair \((k_{i},k_{j})\) with \(k_{i}\) and \(k_{j}\) matched in \(\Theta\), if there exist \(m_{p}\in\Theta(k_{i})\) and \(m_{q}\in\Theta(k_{j})\) such that: (1): \(\forall t\in\{k_{i},k_{j},m_{p},m_{q}\},PF_{t}(\Theta_{jq}^{ip}(t))\geq PF_{t} (\Theta(t))\); (2):\(\exists t\in\{k_{i},k_{j},m_{p},m_{q}\},PF_{t}(\Theta_{jq}^{ip}(t))>PF_{t} (\Theta(t))\), then \((k_{i},k_{j})\) is a swap-blocking pair in \(\Theta\)._  
The concept of swap matching and a swap-blocking pair is defined above. It can be seen that swap matching is such a matching that two objects exchange their matches while keeping all other objects' matching states unchanged. By searching and swapping the blocked pairs, we can find a stable matching. The many-to-many matching game-based scheme to solve the multiple LEO satellites and LBCs association can be summarized as Algorithm 1.  
**Step 1: Initialization.**  
(a) Initialize the power allocation matrix \(\mathbf{P}\) with proportion based on traffic requirements of each LBC.  
(b) Initialize the beam association matrix \(\mathbf{V}\) in which LEO satellites and ground LBCs are randomly matched with each other subject to \(|\Theta(k)|\leq L\) and \(|\Theta(m)|\leq K\).  
**Step 2: Swap matching.**  
For each matched LEO satellite \(k_{j}\) in \(\Theta\), it keeps searching \(\mathcal{S}\backslash\{k_{j}\}\) for a swap-blocking pair \((k_{i},k_{j})\) along with \(m_{p}\in\Theta(k_{i})\) and \(m_{q}\in\Theta(k_{j})\),  
(i) If there exist such a swap-blocking pair, \(k_{i}\) exchanges its match \(m_{p}\) with \(k_{j}\) for \(m_{q}\), then set \(\Theta=\Theta_{jq}^{ip}\).  
(ii) Else, \(k_{i}\) keeps its matches.  
**until** no swap-blocking pair exists, and a stable match is formed.