Skip to main content
. 2020 Nov 3;20(21):6270. doi: 10.3390/s20216270
Algorithm 5 Breadth-first search (BFS) exploration to decide the next target node
Require: node DB Node, the current node’ ID idcur, local map DB Map
Ensure:  the next target node nodenext
1: Nodeunexp_siblingfind_unexplored_siblings Node,idcur
2: if Nodeunexp_sibling then
3:     nodenextFind-Next-Node-In-TSP-SolutionNodeunexp_sibling,idcur
4: else if flagloop_closingnodeparent=FALSE then
5:     nodenextnodeparent
6: else if flagloop_closingnodecur=FALSE then
7:     Nodeunexp_childfind_unexplored_childNode,idcur
8:    nodenextFind-Next-Node-In-TSP-SolutionNodeunexp_child,idcur
9: else
10:     NodeunLC_siblingfind_unLoopClosed_siblingsNode,idcur
11:     if NodeunLC_sibling then
12:         nodenextFind-Next-Node-In-TSP-SolutionNodeunLC_sibling,idcur
13:     else
14:         NodeunLC_childfind_unLoopClosed_childNode,idcur
15:         if NodeunLC_child then
16:            nodenextFind-Next-Node-In-TSP-SolutionNodeunLC_child,idcur
17:         else
18:            Nodeunexpfind_unexploredNode
19:            if Nodeunexp then
20:                nodenextfind_nearestNodeunexp,idcur
21:            else
22:                nodenext0 ▹ The exploration has been completed.
23:            end if
24:         end if
25:     end if
26: end if