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 6235363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:39:25+00:00 2026-05-24T10:39:25+00:00

Let’s say I’ve got 1 million arbitrarily shaped, arbitrarily oriented N-dimensional ellipsoids scattered randomly

  • 0

Let’s say I’ve got 1 million arbitrarily shaped, arbitrarily oriented N-dimensional ellipsoids scattered randomly through N-dimensional space. Given a sub set of ellipsoids, I want to “quickly” determine the set of all ellipsoids that the ellipsoids from the first set intersects.

There’s got to be an algorithm for this. What is it? What is it’s “O” complexity?

  • 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-24T10:39:25+00:00Added an answer on May 24, 2026 at 10:39 am

    The “O” complexity suffers from the curse of dimensionality if you’re allowing for N-dimensional data. (See this wikipedia article for more about that). I recommend borrowing from physics simulation and dividing this problem into a “broad phase” and a narrow phase:

    • The broad phase conservatively finds drastically smaller set of pairs of potentially overlapping ellipses.
    • The narrow phase trims the set of potentially overlapping pairs of ellipses to those pairs that actually do overlap.

    The narrow phase is a straightforward computational geometry problem of testing for intersection between arbitrary ellipses. For the broad phase you’ll want to use a spatial structure such as a spatial hash, spatial tree (R-tree, Kd-tree, X-tree, UB-tree, etc…), or ad-hoc structure given some special properties of the data you’re loading (such as an unbalanced tree or hash).

    The current popular method is a Kd-tree. There’s a lot of documentation and already coded versions of the Kd-tree that are readily configurable, so I recommend you look online. (Google is your friend on this one.) The advantage of using most tree structures is that if set you’re looking for intersections with is relatively compact you can search through the tree only once and find the intersections without having to perform multiple tree traversals. This will help with cache (be it from main memory or disk) access patterns. The same algorithm can handle disparate membered queries. It’s likely you’re doing work that would benefit greatly from the compact query set properties, however.

    A Kd-tree won’t fix your problems for all ellipsoids — for example, if you have an ellipsoid of dimension N whose primary axis is from (0, 0, 0, 0, …) through (1, 1, 1, 1, …) but with small or inconsequential secondary axes (and henceforth doesn’t intersect much) will still need to be an a node that covers [0,1] in all N dimensions. If your ellipsoids fall in [0,1]^n, then every ellipsoid will test for intersection with the aforementioned inconvenient ellipsoid. However, with real world data (and even most synthetic unless you’re really trying hard to make Kd-trees slow) the Kd-tree approach should be a win.

    If you expect Kd-tree to be a success for thousand-dimension ellipsoids, chances are you’re better off with a brute force search. (The aforementioned curse of dimensionality.) However…

    One million entries isn’t too bad if you’ve got an optimized implementation, but if you’re doing a lot of queries (millions) it’s going to be slow (on the order of 10 seconds or worse). I’ve seen some amazing numbers come out of well-optimized vectorized code, however. (Even shipped some products using this strategy.) With the right cache coherency, brute-forcing would take only milliseconds at most. This means either ASM or vector intrinsics in C/C++ — not sure which language you’re working in.

    For most data, O complexity (disregarding the curse of dimensionality) should be about amortized O(m log n) for queries (once the tree is built) where m is the number of ellipses in the query set and n is the number of ellipses in the data set. Building the data itself shouldn’t be worse than O(n log n). Multiply everything by Exp(d) where d is dimension — that’s the way it goes with this sort of thing.

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

Sidebar

Related Questions

Let's say I have window.open (without name parameter), scattered in my project and I
Let's say, I've got a XmlNode: <A>1</A> How to remove a text from it,
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Let's say I have a drive such as C:\ , and I want to
Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say I have a dataset in an ASP.NET website (.NET 3.5) with 5

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.