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

  • Home
  • SEARCH
  • 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 661103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:13:52+00:00 2026-05-13T23:13:52+00:00

I have 2d-points (x,y) with float coordinates, when I draw them, I need to

  • 0

I have 2d-points (x,y) with float coordinates, when I draw them, I need to group points if they are close to each other, and they should be grouped iwith help of rectangle with fixed size. And the problem is that these rectangles should not intersect, and all points-neighbours should be grouped.
If you have a paper nearby, you can draw a big rectangle, for instance 4*5cm – area where all points are located. Now randomly put points, and let’s say, if there are points whose distance is 1 cm – they should be grouped in rectangle 2*3.

I can’t find algorithm how to make it, and performance matters too… I looked for nesting, clustering but what I need is a little bit different. And by the way, if some grouping rectangles have to be out of common area to fit conditions, let it be, it is not a problem. E.g. you have area 4*5, and points

(1,0), (2,1), (4,1), (4,3), (2,4) 

then result should like rectangles (0,0 - 3,2) & (3,1 - 6,3) and one point left (2,4) because all other point were grouped and this point does not have any neighbours now.
My points’ coordinates are not integer but float, and count of points can be few hundred (up to 500). And I don’t want to break area on the same rectangles and just calculate how many point are there, I mean for example above I could make reactangles (0,0 – 3,2), (3,0 – 6,2), (0,3 – 3,6), (3,3 – 6,6) and just summarize points 2 for first rect, 1(!) for second what means leave it as it is, 1 for third and 1 for 4th => one rect will be drawn and all other points => wrong result according to the task.
Any ideas? At least which algorithms can be helpful, where to look for…

P.S. for now number of groups/points in result does not matter, e.i. another allowed result for example above could be (1,0-4,2) and (2,2-5,4) rectangles, and no points left

  • 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-13T23:13:52+00:00Added an answer on May 13, 2026 at 11:13 pm

    The general problem is the “nearest neighbor” search. Solutions are computationally hard (time complexity). That which is a pretty easy task for humans isn’t so easy computationally.

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

Sidebar

Ask A Question

Stats

  • Questions 348k
  • Answers 348k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer HAP is not going to give you the results you… May 14, 2026 at 6:32 am
  • Editorial Team
    Editorial Team added an answer You can use cast or convert to convert the field… May 14, 2026 at 6:32 am
  • Editorial Team
    Editorial Team added an answer Here's the answer, as suggested by Alexandre: when you use… May 14, 2026 at 6:32 am

Related Questions

I'm working on an old-school image warp filter. Essentially, I have a 2D array
For some reason it seems that everyone writing webpages about Poincare discs is only
I have a set S of points (2D : defined by x and y)
I'm working on a roguelike style cellphone game that operates on a grid. Attacks/Items
We have a list of x,y pairs. Every pair represents a point on a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.