Rocha–Thatte algorithm is a distributed algorithm in graph theory for detecting cycles on large-scale directed graphs based on the bulk synchronous message passing abstraction.This algorithm for detecting cycles by message passing is suitable to be implemented in distributed graphprocessing systems, and it is also suitable for implementations in systems for disk-based computations, such as the GraphChi, where the computation is mainly based on secondary memory.Disk-based computations are necessary when we have a single computer for processing large-scalegraphs, and the computation exceeds the primary memory capacity.
The Rocha–Thatte algorithm is a general algorithm for detecting cycles in a directed graph
G
In each pass, each active vertex of
G
v
(v)
v
v
v
v
For a sequence
(v1,v2,\ldots,vk)
v
v=v1
v
v=vi
i\in{2,3,\ldots,k}
v
(v=vi,vi+1,\ldots,vk,vk+1=v)
k-i+1
(v1,v2,\ldots,vk,vk+1=v1)
vi,i=1
k
min\{v1,\ldots,vk\}
The figure below presents an example of the execution of the algorithm. In iteration
i=3
(2,3,4)
The total number of iterations of the algorithm is the number of vertices in the longestpath in the graph, plus a few more steps for deactivating the final vertices. During the analysis ofthe total number of iterations, we ignore the few extra iterations needed for deactivating the finalvertices and detecting the end of the computation, since it is
O(1)
Simulations show that the Rocha-Thatte algorithm has a smaller communication overhead than a distributed version of depth-first search, regarding both the number of messages and the total number of bits sent. Specifically, the distributed version of DFS may require up to one order of magnitude more messages exchanged than the Rocha-Thatte algorithm.