Research Article

Reinforcement Learning-Based Routing Algorithm in Satellite-Terrestrial Integrated Networks

Algorithm 1

Path checking algorithm (PCA).
Input: start_node, end_node, graph.
Output: the flag which indicates whether there is a valid path from start_node to end_node.
1.Initialize flag = 0, path ={}.
2.Get the neighbours of start_node based on the network structure graph, neighbours_list.
3.Let path = path∪{start_node}.
4.while neighbours_list:
5. Pop a node from neighbours _list, node.
6. if node not in path:
7.  if node == end_node:
8.   path = path ∪{node}.
9.   flag =1.
10.  end if
11.  else:
12.    Get the neighbours of node, node_neighbours.
13.    Add the node_neighbours to the list neighbours_list .
14.    path = path ∪{node}.
15.  end else
16. end if
17.end while