Research Article

Hexagon-Based Generalized Voronoi Diagrams Generation for Path Planning of Intelligent Agents

Algorithm 3

Pseudocode for obtaining one-cell-wide hexagon-based GVD edges using the two thinning patterns in Figure 7.
pruningEdgeCell()
(1)for all s ∈ roughQueue do
(2)  if fitPatternOne(s) ∨ fitPatternTwo(s) then
(3)   continue
(4)  else
(5)   e ⟵ findEdge(s)
(6)   e.remove(s)
thinningPatternOne(s)
(7)for all n ∈ Adj6(s) do
(8)  if typen = = EDGE then
(9)   a, b ⟵ commonAdj(s, n)
(10)  if typea = = EMPTY ∧ typeb = = EMPTY then
(11)   return true
thinningPatternTwo (s)
(12)for all n ∈ Adj6(s) do
(13)  if typen = = EMPTY then
(14)   a, b ⟵ commonAdj(s, n)
(15)  if typea = = EDGE ∧
(16)   (typeb = = EDGE ∨ typeb = = OBST) then
(17)   return true