## 4 Problem Modeling and Solution
### Logical Topologies Construction  
If all paths between node pairs are installed in switches as flow entries, the number of entries in some switches may exceed their flow entry capacity. Existing multi-topology construction methods do not consider the limitations of switches' flow entry capacity. In this section, we propose a multi-topology construction method to maximize and balance the transmission capacity between every node pair, while considering both path rankings and the switch flow entry capacity. The method aims to incorporate as many paths as possible into the multi-topology to enhance the overall transmission capacity. Following the path contribution rankings, the algorithm prioritizes higher-ranked paths and alternates the path selection between node pairs, ensuring a balanced distribution of transmission capacity across the network. Using the ranking method above, we obtain the maximum transmission capacity and the selected paths' rankings for each node pair. Therefore, it is necessary to discard some paths during the multi-topology construction process, while also adhering to the ranking order of the paths. The construction problem can be modeled as follows:  
Objective Function: Maximize the number of the paths kept in switches:  
\[Maximize{\sum\limits_{i}x_{p_{i}}} \tag{9}\]  
where \(x_{p_{i}}\) is a binary variable. \(x_{p_{i}}=1\) if path \(p_{i}\) is selected, and \(x_{p_{i}}=0\) otherwise. Constraints:  
Flow Entry Capacity Constraints of the Switch: For each switch node, the number of the selected paths traversing it cannot exceed its capacity constraint. \[\sum\limits_{p_{i}\in PT_{n}}x_{p_{i}}\leq c_{n},\quad\forall n\in N \tag{10}\]  
Path Ranking Constraint: For each path with a ranking number of \(k\), it can only be considered after all paths with a ranking number lower than \(k\) have been checked. The following constraint is introduced:  
\[\forall x_{p_{i}}=1,\quad\quad p_{i}\in L_{k} \tag{11}\] \[x_{p_{j}}=0,p_{j}\in L_{1,\dots,k-1}:\sum\limits_{p_{m}\in PT_{n }}x_{p_{m}}-\sum\limits_{p_{k}\in L_{k}\cap PT_{n}}x_{p_{k^{\prime}}}<c_{n}, \forall n\in N_{p_{j}}\]  
where \(L_{k}\) is the set of all paths with a ranking number of \(k\), and \(N_{p_{j}}\) is the set of all switch nodes that path \(p_{j}\) traverses. To solve this problem, we propose Algorithm 2 as follows:```
1:Input:
2:nodes: List of Nodes(switches)
3: node_pairs: List of NodePairs
4:Output:
5: Multi-topology constructed according to the rank of paths
6:Functionconstruct_multi_topology(nodes, node_pairs):
7:fornode in nodes do
8: node_selected_paths \(\leftarrow\) []
9:endfor
10:topos \(\leftarrow\) []
11:for pair in node_pairs do
12:for path in pair.paths do
13:ifpath.rank not in topos then
14:topos[path.rank] \(\leftarrow\) []
15:endif
16:topos[path.rank].append(path)
17:endfor
18:endfor
19:for (rank, paths) in sorted(topos.items()) do
20:for path in paths do
21:can_select \(\leftarrow\) True
22:for node in path_nodes do
23:if node_path_limit \(<\) len(node.selected_paths) then
24:can_select \(\leftarrow\) False
25:break
26:endif
27:endfor
28:if can_select then
29:for node in path.nodes do
30:node_selected_paths.append(path.id)
31:endfor
32:else
33:topos[rank].remove(path)
34:endif
35:endfor
36:endfor
37:Return topos
```

**Algorithm 2** Construct multi-topology

In this algorithm, paths with lower ranking numbers are prioritized for each node pair. Paths with the same ranking number are kept in the same logical topology. In the relevant switches, paths to different destinations with the same ranking number are placed in the tables with the same table ID. When each path is added, the algorithm ensures that all switches traversed by this path satisfy the flow entry capacity constraints. The time complexity of the algorithm is \(O\big{(}R\times N^{2}\big{)}\), where \(R\) represents the maximum number of ranks, and \(N\) represents the number of nodes.