Skip to main content
. 2020 Oct 24;20(21):6060. doi: 10.3390/s20216060
Algorithm 1. Node growing algorithm
Input: C-space, Ti, Nocci, NBi, NPi
Output: leaf nodes for each root node
Initialization: iterationnum = 1; Nodeparent is empty.
for each obstacle Ti in T={Ti|i=1,2,,nt} do
if Ti attaches with the boundary of C-space do
  separate occupied nodes Nocci into NBi and NPi
  while nodes in NPi are not searched totally do
   if iterationnum=1 do
    root nodes Noderoot are nodes in NBi, and each root node has one index as a root index
    Nodeparent=Noderoot
    The root index for a node in Nodeparent is its original root index
   end if
   for each node gp in Nodeparent do
    searching one-ring neighboring nodes Nodechild from NPi in all possible directions
    gp.append(Nodechild)
   end for
   Nodeparent_temp={}
   for each node gp in Nodeparent do
    for each child node gn in gp do
     if gn is searched before then
      stop searching in this direction
     else if gn is searched by two or more parent nodes then
      label gn by root indexes of its all parent nodes
     else if gn is not searched before then
      label gn by the root index of its parent node
      Nodeparent_temp.append(gn)
     end if
    end for
   end for
   iterationnum+=1
   Nodeparent=Nodeparent_temp
  end while
end if
end for