Introduction - If you have any usage issues, please Google them yourself
This is the algorithm of BFS(breadth first search) on CUDA, and its time complexity is down to O(diameter) which diameter means the longest distance between the root and the leaves.