Optimal Representation of Large-Scale Graph Data Based on Grid Clustering and K2-Tree
Algorithm 3
Node direct neighbor query.
Input: n is the number of the vertex of the graph, boundary_list is the boundary value of the cluster, and cluster_ list is the actual position of each cluster in the adjacency matrix.
Output: direct neighbor set List for node n;
(1)
m := boundary_list.size()/2;
(2)
List := empty set;
(3)
for (i = 1 to m)
(4)
if (boundary_ list[2 i] <= m&&boundary_ list[2 i + 1] >= m) then
Find the T vector and L vector corresponding to the cluster satisfying the boundary condition, and add the queried neighbors to the List;
(5)
end if
(6)
end for
(7)
Find the T vector and the L vector of the M0. If there is a neighbor of the node, add the queried neighbor to the List.