Abstract

We present a performance comparison of tree data structures for N-body simulation. The tree data structures examined are the balanced binary tree and the Barnes–Hut (BH) tree. Previous work has compared the performance of BH trees with that of nearest-neighbor trees and the fast multipole method, but the relative merits of BH and binary trees have not been compared systematically. In carrying out this work, a very general computational tool which permits controlled comparison of different tree algorithms was developed. The test problems of interest involve both long-range physics (e.g., gravity) and short-range physics (e.g., smoothed particle hydrodynamics). Our findings show that the Barnes–Hut tree outperforms the binary tree in both cases. However, we present a modified binary tree which is competitive with the Barnes–Hut tree for long-range physics and superior for short-range physics. Thus, if the local search time is a significant portion of the computational effort, a binary tree could offer performance advantages. This result is of particular interest since short-range searches are common in many areas of computational physics, as well as areas outside the scope of N-body simulation such as computational geometry. The possible reasons for this are outlined and suggestions for future algorithm evaluations are given.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call