## 3 Dynamic Link Establishment of Mega-Constellations
### Greedy Algorithm for Dynamic Link Establishment  
In the realm of dynamic link problems, ensuring stable and enduring connections is paramount for satellite communication systems. Traditional greedy algorithms [12] tend to exhibit local optimization, often resulting in inadequate connection durations and, at times, failure to meet communication demands. Greedy algorithms iteratively select satellite combinations based solely on their immediate connection durations, neglecting opportunities for global optimization. We use \(\alpha(t)\) as the matrix for finding the optimal links for each satellite, employing the greedy algorithm approach to search for the optimal link configuration. In Figure 7, the greedy algorithm is applied to optimize the link durations for each satellite within an orbital cycle. The blue curve illustrates the maximum link duration. Following computation, the greedy algorithm yields an average maximum link duration of 450.74 s (approximately 7.51 min), with an average link duration of 23.96 s. However, the average minimum link duration is merely 3.0852 s, posing potential challenges in establishing stable connections. The localized optimization strategy often leads to inadequate connection durations, as depicted in the variations in the satellite topology over the orbital period shown in Figure 8.  
Figure 7: Satellite link durations optimized using the greedy algorithm. The average number of topological transformations per satellite is approximately 132, and the average stable time for each satellite can be determined using Equation (8), as follows:  
\[\text{Average stable connection time per satellite}=\frac{\text{Total time (orbital period)}}{\text{Number of switches}} \tag{8}\]  
According to the orange line in Figure 8, the average satellite stabilization time is 43.86 s, derived through qualitative calculations for comparison with the mean link duration discussed earlier. Notably, the mean link duration is shorter than the average satellite stabilization time, indicating that most of the satellites exhibit shorter link persistence times. Consequently, the satellite matching obtained via the greedy algorithm tends to result in shorter average durations of unconnected dynamic links, suggesting poorer overall link connectivity on average. Following this, a cross-sectional analysis was conducted by simulating the number of satellites with unconnected dynamic links per time slot using the greedy algorithm, as depicted in Figure 9. Throughout a satellite's orbit period, a substantial number of satellites remain unconnected at any given moment. With a total constellation size of 1584 satellites, the simulation results reveal that the number of satellites in unconnected dynamic links determined by the greedy algorithm ranges from a maximum of 1416 to a minimum of 88, indicating an excessive number of satellites remaining unconnected. Figure 8: The greedy algorithm for calculating the number of topological changes and average stability time. Figure 9: Number of satellites with unconnected dynamic links per time slot using the greedy algorithm. Subsequently, a longitudinal comparison was conducted focusing on simulating the duration within each satellite's orbital period during which dynamic links remain unconnected, with only permanent fixed links being engaged. Figure 10 demonstrates that the average total unconnected time for satellites calculated using the greedy algorithm is 55.05 min. It should be noted that the orbital period for each satellite is merely approximately 95 min. Comparison between Figures 9 and 10 reveals that the greedy algorithm often produces satellite dynamic link configurations that are suboptimal. Satellites frequently rely on fixed links instead of establishing dynamic links, which undermines our goal of enhancing the link flexibility and reducing the latency. This issue stems from earlier connection selections that limit subsequent satellites from finding compatible partners for connections.