Research Article

Subgraph-Indexed Sequential Subdivision for Continuous Subgraph Matching on Dynamic Knowledge Graph

Algorithm 2

FG construction algorithm.
Input: a matching tree , a query graph and a data graph
Output: the flow graph
(1), ,
(2)FG;
(3)for and
(4)if NegCandVerify ( ) then. CS (), ,
(5)if PosCandVerify ( ) then. CS (), ,
(6)if PosCandVerify ( ) and is leaf then. State ()
(7)ReSet as unvisited, as visited;
(8)for and from to 0 do
(9) for and is visited do
(10)  for and do
(11)   if and then
(12)    .FS () .State () .FS ()
(13)    .State () .CS () .FS ()
(14) Mark as visited;
(15)Set as unvisited, as visited;
(16)for and from to do
(17) for and is visited do
(18)  for and do
(19)   if and then (, )
(20)   if and then (, ) ;
(21)  Mark as visited;
(22)return