Revisiting random insertion for packing molecules in a box

16 January 2025, Version 2
This content is a preprint and has not undergone peer review at the time of posting.

Abstract

We present a simple yet efficient random (brute-force) algorithm for constructing solvated molecular systems. By placing solvent molecules at random positions and orientations within a simulation box, we circumvent the complexities typically associated with more sophisticated packing algorithms. The main computational cost lies in detecting and preventing steric overlaps between newly placed molecules and those already inserted. To address this, we employ a k-d tree—a data structure that partitions three-dimensional space—to query potential overlaps in near-logarithmic time with respect to system size. When combined with a dynamic batch insertion strategy, this method reduces the frequency of tree rebuilding and achieves nearly linear scaling for large systems, thereby avoiding the high overhead commonly incurred by naive O(N) distance checks.

Keywords

Packing
Initial Configuration

Comments

Comments are not moderated before they are posted, but they can be removed by the site moderators if they are found to be in contravention of our Commenting Policy [opens in a new tab] - please read this policy before you post. Comments should be used for scholarly discussion of the content in question. You can find more information about how to use the commenting feature here [opens in a new tab] .
This site is protected by reCAPTCHA and the Google Privacy Policy [opens in a new tab] and Terms of Service [opens in a new tab] apply.