1. Equivalent junction points
In the direction graph, if the junction U to Node V has an edge, then you are called a parent node of V, V is the child node of U, obviously in the graph node can have more than one parent node with multiple child nodes. When the node U is exactly the same as the child and father of Node V, it is called U and V as the equivalent nodal point.
2. RPC Methods
The core idea of this method is to sort the nodes according to their neighbor nodes, and if the two nodes are the equivalent nodes, two node will be adjacent in the sorted result.
2.1 Sort
First, according to the parent node to sort, if the two nodes of the same parent node must continue to judge the child node, if the child node is the same, then two nodes equal.
Make junction u the parent node fu = {f1,f1 ...}, the child node Cu = {c1,c2 ...}, the parent node of node V FV = {F1 ', F2 ' ...}, the child node CV = {C1 ', C2 ' ...}, where each node's child and father are in order from small to large.
Parent node Comparison:
The Fui represents the I parent node of the node U, and the same FVI represents the first child of Node V, and Cui and CVI represent the first child node of node U and V, respectively. Order i = 0,
(1) If I is greater than the number of parent nodes of the node U and V, then U = V, the comparison ends;
(2) If I is greater than the number of parent nodes of node u, then u <v, the comparison ends;
(3) If I is greater than the number of parent nodes of Node V, then v> u, the comparison ends;
(4) If Fui > Fvi, then u > v;
(5) If Fui < Fvi, then u < V;
(6) If Fui = Fvi, then i++, return (1).
The child node comparison is similar to the parent node.
2.2 Finding equivalence classes
Order 2.1 to sort the result R = {A, B, C, D, e ...}, so that RI is the first node in R. Order i = 0,
(1) If I > | v| –1, where V is the node in the graph, the end of the run;
(2) If Ri and Ri+1 's father and child node are exactly the same, then the node Ri is equivalent to ri+1, whereas RI and ri+1 are unequal. Return (1) Continue execution.
Reference: K-up query processing based on graph compression (Journal of Software 2014)
Equivalent junction points