Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7685987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:22:38+00:00 2026-05-31T19:22:38+00:00

I have been playing with this one for a few days now, and keep

  • 0

I have been playing with this one for a few days now, and keep running into performance walls.

The data:

  • 10s to hundreds of thousands of 3D points
  • Points are positive/negative ints and fall on a 3D grid with no overlap
  • Will rarely add new points
  • Will usually be gapless but gaps are possible

The structure:

  • Must be able to efficiently find the nearest neighbours along each axis (“closest point to the left”) and only that axis.
  • Rarely handles inserts or deletes after construction (but must handle them)
  • Does not need to handle overlapping points

I have found a possible solution in http://docs.scipy.org/doc/scipy/reference/spatial.html, however the K-d tree seems to be extremely wasteful for this type of data (suitable more for clusters of arbitrary points) and tuned for finding points within a radius. The primary use case for this data is often finding (and following) the nearest neighbour point along each.

Example Data (x, y, z):

[(4, 3, 0), (4, 4, 0), (5, 3, 0), (3, 3, 0), (4, 3, 1), ...]

Possibly my google-fu is failing me and an optimal structure exists already (preferably in Python), but I have not been able to find one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:22:39+00:00Added an answer on May 31, 2026 at 7:22 pm

    How about constructing 3 KD-trees for x,y,z axes respectively ?
    You need some kind of tree structure anyway IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay. Now I give up. I have been playing with this for hours. I
I have been playing around with NSURLConnection. Now I'm trying to grab some data
I have been playing around with in app purchases for a few days, everything
I have been playing with setting up different relationships for a few hours now
Ive been playing with ORM caching in the past few days and one thing
I am working on this site: beta.us.lt And I have been playing with firebug
I've been playing around with this for a couple of hours and have come
I have been playing with my own version of this, using 'if', and all
I have been playing around with a few ways to batch insert a list
I've been playing around with C++11 for the past few days, and I came

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.