## 4 Problem Modeling and Solution
### Logical Topologies Construction
Based on the distances between nodes, the link delays were calculated and are presented in the figure (in milliseconds). This topology served as the physical topology, and logical topologies were constructed based on it. In this network, each node represents a switch, and each line represents a link. The network consists of 14 switches and 21 links. The blue node represents Switch S2, which is the source node. The content server is connected to it. The yellow nodes represent Switches S1, S3, S10, and S12, which serve as destination nodes. The mobile device accesses the network through these switches. There are two types of links: dashed lines represent links with a bandwidth of \(c1=12\) Mbps, while solid lines represent links with a bandwidth of \(c2=8\) Mbps. The mobile device initially connects to the network through Switch S3, which serves as the access switch. It is assumed that Switches S1, S10, and S12 cover the entire range of device movement. Regardless of the device's location, it can only access the network through one of these three switches. We generated varying numbers of data flows, each with a sending rate of 0.8 _Mbps_ and a packet size of 1000 bytes. Based on the multi-topologies constructed using the three methods, we employed a genetic algorithm [27] to create the \"topology selection table\" (Flow Table 0), allocating mobile data flows to specific topologies for path switching. The fitness of individuals in the genetic algorithm was evaluated based on the average packet delay:

\[\mathit{Fitness}=\overline{D}=\frac{\sum_{f=1}^{F}\sum_{t=1}^{T}X_{ft}h_{ft}}{ F} \tag{12}\]

where \(F\) represents the number of data flows, and \(X_{ft}\) is a Boolean variable such that if data flow \(f\) selects topology \(t\), then \(X_{ft}=1\); otherwise, \(X_{ft}=0\). The variable \(h_{ft}\) denotes the length of the path from the source node to the new destination node in topology \(t\) selected for data flow \(f\). An individual represents a data flow allocation plan, which can be described as an \(F\times T\) matrix, where each element \(X_{ft}\) indicates whether data flow \(f\) is assigned to topology \(t\). Since each data flow can only be assigned to one topology, each row in the matrix contains exactly one \"1\" and \(T-1\) \"0\" s. The crossover points are selected randomly, defined by a row of the matrix. Crossover involves swapping the upper and lower parts of the rows between two matrices. In practical terms, this means altering the topology selection of certain data flows. The mutation points are also selected randomly, defined by a row of the matrix. Mutation involves changing the position of the \"1\" within that row. In practical terms, this means altering the topology selection of a specific data flow. Introducing randomness in genetic algorithms helps increase population diversity. This prevents premature convergence to local optima. It also enhances the algorithm's global search ability, allowing it to explore more areas of the solution space. Ultimately, this improves the algorithm's ability to find better solutions. Each experiment was repeated three times, and the average results were recorded. The detailed experimental results are presented in the following section. ### Results and Discussions

In this section, we present the experimental results and provide a discussion and analysis of them. #### 5.3.1 Average Packet Delay

We captured the data packets sent by the content server and received by the mobile device at its new location. The average packet delay for each flow was calculated by measuring the time difference between the sending and receiving of packets within the flow. The overall average packet delay was then obtained by dividing the sum of these

Figure 2: The physical topology used in the experiment, consisting of 14 switches and their associated link delays. delays by the number of data flows.