A New Approach for Semi-External Topological Sorting on Big Graphs
Tianpeng Gao, Jianzhong Li, Hengzhao Ma · IEEE Transactions on Knowledge and Data Engineering · 2023
This paper presents a new approach for semi-external topological sorting algorithm on big directed acyclic graph(DAG). Topological sorting aims to find an ordering of each node in DAG, which satisfies$u$precedes$v$in the ordering for each edge$(u,v)$in DAG. Topological sorting is an important subroutine for scheduling and other external graph algorithms. But, the internal topological sorting algorithm cannot handle big DAGs and the I/O complexity of total external topological sorting is too high for practical applications. Therefore, we pay attention to the semi-external topological sorting for big DAGs in this paper. We find that the existing semi-external topological sorting algorithm is mainly based on constructing a DFS-Tree in internal memory. However, this DFS-based algorithm is natively more difficult than topological sorting, because DFS-Tree determines a strict total order, while topological order is only a partial order. Therefore, a partial orderlevel orderis proposed in this paper. Based on thelevel order, we propose a new semi-external topological sorting algorithm. Next, two optimizations,NodeRemoveandEdgeRemove, are proposed to reduce the CPU and I/O cost. In addition, we also propose a batch algorithm. Finally, we perform experimental studies using real and synthetic datasets to confirm the efficiency of our approach. According to the experimental results, our algorithms are better than the previous DFS-based algorithms.