Questions tagged [closest-points]
107 questions
0
votes
2 answers
Determining Multiple of the Closest Pairs in Plane
When determining the closest pair of vertices in a plane with the sweep algorithm outlined below, is it possible to determine multiple pairs without additional runs?
Sort points according to their x-coordinates.
Split the set of points into two…

jbenett
- 1
0
votes
0 answers
Closest points algorithm - clarification on checking points in the center strip
I would like some clarification on this algorithm to find the closest pair of points in a set of points.
So one way to solve this is to recursively divide the points in half, finding the closest pair of points in each half. Then we have to check the…

LVNGD
- 169
- 3
- 12
0
votes
0 answers
Nearest line to points using R
I'm trying to do some GIS work using R. Specifically, I have a spatialpointsdataframe (called 'points') and a spatiallinesdataframe (called 'lines). I want to know the closest line to each point. I do this:
# make a new field to hold the line…

TheRealJimShady
- 777
- 3
- 9
- 24
0
votes
1 answer
Sweepline algorithm
I am trying to solve problem CLOPPAIR on spoj in which i have to find the minimum euclidian distance between two points and print the indices of these two points also. I tried to do this using sweepline but still i am getting T.L.E .Can please…

Vinayak Singla
- 142
- 1
- 12
0
votes
4 answers
Closest pair of points brute-force; Why O(n^2)?
I feel stupid for asking this question, but...
For the "closest pair of points" problem (see this if unfamiliar with it), why is the worst-case running time of the brute-force algorithm O(n^2)?
If say n = 4, then there would only be 12 possible pair…

user3407764
- 463
- 1
- 5
- 15
0
votes
1 answer
closest pair of points, recursion not stopping at the correct area
Working on a closest point algorithm here. I am taking a 2d array of ints in. For some reason I am not getting the right answer. What is wrong with my recursion in conquer? I think that is the problem.
package ClosestPair;
import…

bobbyD
- 11
- 2
0
votes
5 answers
List of points and find the closest points trouble
So I am running into some trouble trying to debug this piece of code. I have a list of numbers, say [4,5,7,3,5,2,3] and I am required to find the two points who are closest together, so in this case, 3 and 3 since their difference is zero. However,…

PythonSOS
- 339
- 5
- 16
0
votes
3 answers
Finding the two closest numbers in a list using sorting
If I am given a list of integers/floats, how would I find the two closest numbers using sorting?

PythonSOS
- 339
- 5
- 16
0
votes
1 answer
Finding the Closest Pair of Points Using basic functions
I'm tryin' to find the closest pair of points, but my code just won't work. I'm not expert in this field, please help me out. This is for my project T_T
my code goes like this:
import java.util.Scanner;
public class FindingClosestPair {
public…

vallerie
- 1
- 1
0
votes
1 answer
Finding the closest pair using Divide and Conquer
I am currently assigned to create a c++ program to find the closest pair of points in a (x,y) coordinate system. However, I am having a lot of trouble trying to understand one thing.
Every tutorial/guide that I have read about the closest pair…

user3720526
- 123
- 1
- 1
- 7
0
votes
2 answers
Getting the best combination of closest pairs between 2 sets of points
I have to sets of points, lets say set A and B
A and B are equal in size
Every element of A is coupled to an element of B
All the points of A have to 'move' to an point of B, but an point of B cannot be coupled to multiple points of A.
I need to…

Bram
- 127
- 1
- 2
- 7
0
votes
1 answer
Understanding specific implementation of sweep line closest pair
First off, I was reading about the sweep-line algorithm to find closest pair of points in O(N lgN) time over at topcoder. I mostly understood the algorithm, however when I look at the implementation provided here (copied and made more readable…

1110101001
- 4,662
- 7
- 26
- 48
0
votes
1 answer
Usage of the closest and the farthest pair of points
Could you think of any usages of the closest pair of points and the farthest pair of points in any dimension and any metric?
Here are my ideas.
The closest pair of points:
testing - we have a set of points which are e.g. some laboratories owned by…

user1
- 945
- 2
- 13
- 37
0
votes
0 answers
Link closest points accross altitudes in Matlab and form chains
I have a 3d matrix with scattered points (Nx4 matrix, x-y-z-data). My aim is to link the closest points together and register each chain in an Kx4 array (x, y, z, data), K being the chain length. The total number of chains depends on the points...
A…

pcpc
- 3
- 2
0
votes
1 answer
Closest pair of points using mouse clicks
The assignment is to to a closest pair of points using brute force.
I seem to have most everything I need - the frame appears, circles appear where I click, and the closest pairs seem to highlight properly, I say "seems" because this is where my…

enigmahfc
- 69
- 10