Generalizing the divide-and-conquer algorithm from Wikipedia to the d dimensional case is pretty straight forward (changes in bold): 1. Sort points according to their x-coordinates. 2. Split the set of points into two equal-sized subsets by a **(d-1) dimensional, vertical hyper-plane** defined by x=xmid. 3. Solve the problem recursively in the **"left" and "right" half of the coordinate space, defined by x<=xmid and x>=xmid** . This yields the left-side and right-side minimum distances dLmin and dRmin, respectively. 4. Find the minimal distance dLRmin among the set of pairs of points in which one point lies on the "left" of the dividing **hyper-plane** and the second point lies to the "right". 5. The final answer is the minimum among dLmin, dRmin, and dLRmin. Note that the argument why step 4 can be accomplished in linear time is still true for d dimensions. One simply has to replace `6 * n` distance calculations by `2*3^(d-1)` distance calculations, because that is the maximum number of points which fit at maximum into a d-dimensional box of size `(dist, 2*dist, 2*dist, ..., 2*dist)`, when the shortest distance between the points is `dist` at minimum. Note further that for real world data it may be a good idea to switch between different coordinate axes from one recursive step to the next (but that applies already for the planar case).