Optimizing graph algorithms for improved cache performance

被引:39
作者
Park, JS
Penner, M
Prasanna, VK
机构
[1] Univ Calif Los Angeles, Dept Comp Sci, Los Angeles, CA 90095 USA
[2] Univ So Calif, Dept Elect Engn, Los Angeles, CA 90089 USA
基金
美国国家科学基金会;
关键词
cache-friendly algorithms; cache-oblivious algorithms; graph algorithms; shortest path; minimum spanning trees; graph matching; data layout optimizations; algorithm performance;
D O I
10.1109/TPDS.2004.44
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
In this paper, we develop algorithmic optimizations to improve the cache performance of four fundamental graph algorithms. We present a cache-oblivious implementation of the Floyd-Warshall Algorithm for the fundamental graph problem of all-pairs shortest paths by relaxing some dependencies in the iterative version. We show that this implementation achieves the lower bound on processor-memory traffic of Omega(N-3/rootC), where N and C are the problem size and cache size, respectively. Experimental results show that this cache-oblivious implementation shows more than six times the improvement in real execution time over that of the iterative implementation with the usual row major data layout, on three state-of-the-art architectures. Second, we address Dijkstra's algorithm for the single-source shortest paths problem and Prim's algorithm for minimum spanning tree problem. For these algorithms, we demonstrate up to two times the improvement in real execution time by using a simple cache-friendly graph representation, namely adjacency arrays. Finally, we address the matching algorithm for bipartite graphs. We show performance improvements of two to three times in real execution time by using the technique of making the algorithm initially work on subproblems to generate a suboptimal solution and, then, solving the whole problem using the suboptimal solution as a starting point. Experimental results are shown for the Pentium III, UltraSPARC III, Alpha 21264, and MIPS R12000 machines.
引用
收藏
页码:769 / 782
页数:14
相关论文
共 1 条
[1]  
FRIGO M, 1999, P 40 ANN S FDN COMP, P17