## 2 Multipath Routing Algorithm for Inter-Satellite Links Based on Load Balancing
### Multipath Routing Algorithm for Inter-Satellite Network  
All of the neighbor nodes of the head node are sequentially added to the queue based on the adjacency matrix data of the nodes in the intersatellite network. Calculate the shortest paths between each neighbor node and record front nodes of the source node while traversing the neighbor nodes. The head node of the team will be dequeued when all the neighbor nodes have been traversed. Until the queue is empty, keep creating new queue head nodes sequentially. Finally, we can obtain the shortest paths and front node information between the source node to all nodes in the whole network.  
_HeadAddr_ is the address of the head node of the team, _AdjAddr_ is the address of the neighbor node, and the variable _Enqueue_ records whether the node in the network has joined the team. The variable _Dequeue_ records whether the node in the network has been dequeued, and if it is true, it indicates that the node has been dequeued. _Queue_ is used to store the queue of neighbor nodes. _HopCount[i]_ is used to count the shortest hops from the node i to the source node. _FrontPoint[i]_ is used to store the front node of the destination node while _FrontCount_ store the total number of front nodes of the node.  
Figure 2 is the algorithm flow chart, and the technical process is realized as follows:  
Figure 2: Flow chart of multipath algorithm.  
**Step 1:** When the algorithm is started, first put the source node into the queue as the head node and then initialize the number of hops away from the source node _HopCount[HeadAddr]_ as 0, traverse all the neighbor nodes which are represented by _AdjMatr[i][j]_ = 1, and set the network address of one hop neighbor nodes as _AdjAddr;_  
**Step 2:** If the _Enqueue_ of the _AdjAddr_ is _False_, then _HopCount[AdjAddr]_ of the shortest hops between the neighbor node and the source node equal _HopCount[HeadAddr]_ add 1. Secondly, put the head node of the queue traversed this time as the front node into the front node container _FrontPoint[i] = HeadAddr_, i = 0, 1,... n, and add 1 to the front node counter _FrontCount_. Finally, put the neighbor node into the queue and mark the _Enqueue_ of the neighbor node as true;  
**Step 3:** If the _Enqueue_ of the neighbor node is _True_, which means that the neighbor node is also a neighbor node of other nodes and has been enqueued, then compare whether the shortest hop count of this cycle is the minimum value or not. If the shortest hops calculated by this loop are the smallest, indicating that this link is the optimal path, then update the shortest distance of the neighbor node to the shortest distance calculated this time, and update the front node to the current head node, keep the _Frontcount_ unchanged; otherwise, the path obtained in this cycle is not optimal, and jump out of this cycle directly;  
**Step 4:** If the _Dequeue_ of the neighbor node is _True_, it means that the neighbor node has been dequeued. In order to avoid double counting, no information will be recorded for the dequeued nodes until all neighbor nodes have been traversed, and setting the _Dequeue_ of the head node at the team is _True_.  
At this point, the first round of traversal process of the head node of the queue has ended, the current first node of the team will be dequeued, and the next new head node of the team will be generated from the queue in turn. The above operations will be repeated until the number of nodes in the queue is empty, in the end the shortest paths from the source node to all other nodes and the front nodes of all other nodes have been obtained.