This paper presents an algorithm for recursive data processing in directed graphs. The proposed algorithm applies graph reduction in order to determine both starting points and a correct ordering of recursive operations, provided the directed graph is a-cyclic. Therefore it is essential that the algorithm is also able to detect cycles efficiently. The algorithm arose from the implementation of recursive, semantic query specifications and is implemented in a DBMS prototype. Experiments confirmed that the theoretically estimated time complexity is O(dN), where N is the number of arcs and d is the depth of the graph (d ≤ N). The worst-case performance is O(N2 ), also for cycle detection.
J. H. ter Bekke, J. A. Bakker