Lably
Skip to content

OPTICS algorithm

Algorithm for finding density based clusters in spatial data

  • 6 min read
  • 6 chapters
  • 6 labs on Lably

Learn it on Lably

Basic idea

Like DBSCAN, OPTICS requires two parameters: ε, which describes the maximum distance (radius) to consider, and MinPts, describing the number of points required to form a cluster. A point p is a core point if at least MinPts points are found within its ε-neighborhood Nε(p) (including point p itself). In contrast to DBSCAN, OPTICS also considers points that are part of a more densely packed cluster, so each point is assigned a core distance that describes the distance to the MinPtsth closest point:

core-distε,MinPts(p)={UNDEFINEDif |Nε(p)|<MinPtsMinPts-th smallest distance in Nε(p)otherwise

The reachability-distance of another point o from a point p is either the distance between o and p, or the core distance of p, whichever is bigger:

reachability-distε,MinPts(o,p)={UNDEFINEDif |Nε(p)|<MinPtsmax(core-distε,MinPts(p),dist(p,o))otherwise

If p and o are nearest neighbors, this is the ε′<ε we need to assume to have p and o belong to the same cluster.

Both core-distance and reachability-distance are undefined if no sufficiently dense cluster (w.r.t. ε) is available. Given a sufficiently large ε, this never happens, but then every ε-neighborhood query returns the entire database, resulting in O(n2) runtime. Hence, the ε parameter is required to cut off the density of clusters that are no longer interesting, and to speed up the algorithm.

The parameter ε is, strictly speaking, not necessary. It can simply be set to the maximum possible value. When a spatial index is available, however, it does play a practical role with regards to complexity. OPTICS abstracts from DBSCAN by removing this parameter, at least to the extent of only having to give the maximum value.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Computing and communication