DBSCAN Core Points
Identify core points in the DBSCAN algorithm.
A point is a core point if it has at least min_pts neighbors (including itself) within distance epsilon.
Given data points, epsilon, and min_pts, return the indices of all core points (sorted).
Use Euclidean distance for proximity.
Example
X = [[0, 0], [1, 0], [0, 1], [10, 10]] epsilon = 1.5 min_pts = 3
[0, 1, 2]
Xholds 4 points in the plane, indexed 0 to 3.epsilon= 1.5 is the neighbourhood radius andmin_pts= 3 is the neighbourhood size needed, the point itself included.- Distances among the first three points: , and . All three are at most 1.5.
- So point 0's neighbourhood is , size 3, and the same set works for points 1 and 2. Each meets the threshold of 3 exactly, so all three are core points.
- Point 3 at is far from everything: to point 0 and to points 1 and 2. Its neighbourhood is just , size 1 < 3.
- The output
[0, 1, 2]lists core indices in increasing order. Notice the tight margin: withepsilon= 1.4 points 1 and 2 would each see only 2 neighbours and only point 0 would remain core.
Constraints
- X: 2D list of data points
- epsilon: maximum distance for neighborhood
- min_pts: minimum number of points in neighborhood (including self)
- Return sorted list of core point indices