OPTICS algorithm
Machine learning and data mining 

Machine learning venues

Ordering points to identify the clustering structure (OPTICS) is an algorithm for finding densitybased clusters in spatial data. It was presented by Mihael Ankerst, Markus M. Breunig, HansPeter Kriegel and Jörg Sander.^{[1]} Its basic idea is similar to DBSCAN,^{[2]} but it addresses one of DBSCAN's major weaknesses: the problem of detecting meaningful clusters in data of varying density. In order to do so, the points of the database are (linearly) ordered such that points which are spatially closest become neighbors in the ordering. Additionally, a special distance is stored for each point that represents the density that needs to be accepted for a cluster in order to have both points belong to the same cluster. This is represented as a dendrogram.
Contents
Basic idea
Like DBSCAN, OPTICS requires two parameters: , which describes the maximum distance (radius) to consider, and , describing the number of points required to form a cluster. A point is a core point if at least points are found within its neighborhood . Contrary 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 th closest point:
The reachabilitydistance of another point from a point is either the distance between and , or the core distance of , whichever is bigger:
If and are nearest neighbors, this is the we need to assume in order to have and belong to the same cluster.
Both the coredistance and the reachabilitydistance are undefined if no sufficiently dense cluster (w.r.t. ) is available. Given a sufficiently large , this will never happen, but then every neighborhood query will return the entire database, resulting in runtime. Hence, the parameter is required to cut off the density of clusters that is no longer considered to be interesting and to speed up the algorithm this way.
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. It is often claimed^{[by whom?]} that OPTICS abstracts from DBSCAN by removing this parameter, at least to the extent of only having to give the maximum value.
Pseudocode
The basic approach of OPTICS is similar to DBSCAN, but instead of maintaining a set of known, but so far unprocessed cluster members, a priority queue (e.g. using an indexed heap) is used.
OPTICS(DB, eps, MinPts) for each point p of DB p.reachabilitydistance = UNDEFINED for each unprocessed point p of DB N = getNeighbors(p, eps) mark p as processed output p to the ordered list if (coredistance(p, eps, Minpts) != UNDEFINED) Seeds = empty priority queue update(N, p, Seeds, eps, Minpts) for each next q in Seeds N' = getNeighbors(q, eps) mark q as processed output q to the ordered list if (coredistance(q, eps, Minpts) != UNDEFINED) update(N', q, Seeds, eps, Minpts)
In update(), the priority queue Seeds is updated with the neighborhood of and , respectively:
update(N, p, Seeds, eps, Minpts) coredist = coredistance(p, eps, MinPts) for each o in N if (o is not processed) newreachdist = max(coredist, dist(p,o)) if (o.reachabilitydistance == UNDEFINED) // o is not in Seeds o.reachabilitydistance = newreachdist Seeds.insert(o, newreachdist) else // o in Seeds, check for improvement if (newreachdist < o.reachabilitydistance) o.reachabilitydistance = newreachdist Seeds.moveup(o, newreachdist)
OPTICS hence outputs the points in a particular ordering, annotated with their smallest reachability distance (in the original algorithm, the core distance is also exported, but this is not required for further processing).
Extracting the clusters
Using a reachabilityplot (a special kind of dendrogram), the hierarchical structure of the clusters can be obtained easily. It is a 2D plot, with the ordering of the points as processed by OPTICS on the xaxis and the reachability distance on the yaxis. Since points belonging to a cluster have a low reachability distance to their nearest neighbor, the clusters show up as valleys in the reachability plot. The deeper the valley, the denser the cluster.
The image above illustrates this concept. In its upper left area, a synthetic example data set is shown. The upper right part visualizes the spanning tree produced by OPTICS, and the lower part shows the reachability plot as computed by OPTICS. Colors in this plot are labels, and not computed by the algorithm; but it is well visible how the valleys in the plot correspond to the clusters in above data set. The yellow points in this image are considered noise, and no valley is found in their reachability plot. They will usually not be assigned to clusters except the omnipresent "all data" cluster in a hierarchical result.
Extracting clusters from this plot can be done manually by selecting a range on the xaxis after visual inspection, by selecting a threshold on the yaxis (the result will then be similar to a DBSCAN clustering result with the same and minPts parameters; here a value of 0.1 may yield good results), or by different algorithms that try to detect the valleys by steepness, knee detection, or local maxima. Clusterings obtained this way usually are hierarchical, and cannot be achieved by a single DBSCAN run.
Complexity
Like DBSCAN, OPTICS processes each point once, and performs one neighborhood query during this processing. Given a spatial index that grants a neighborhood query in runtime, an overall runtime of is obtained. The authors of the original OPTICS paper report an actual constant slowdown factor of 1.6 compared to DBSCAN. Note that the value of might heavily influence the cost of the algorithm, since a value too large might raise the cost of a neighborhood query to linear complexity.
In particular, choosing (larger than the maximum distance in the data set) is possible, but will obviously lead to quadratic complexity, since every neighborhood query will return the full data set. Even when no spatial index is available, this comes at additional cost in managing the heap. Therefore, should be chosen appropriately for the data set.
Extensions
OPTICSOF^{[3]} is an outlier detection algorithm based on OPTICS. The main use is the extraction of outliers from an existing run of OPTICS at low cost compared to using a different outlier detection method.
DeLiClu,^{[4]} DensityLinkClustering combines ideas from singlelinkage clustering and OPTICS, eliminating the parameter and offering performance improvements over OPTICS.
HiSC^{[5]} is a hierarchical subspace clustering (axisparallel) method based on OPTICS.
HiCO^{[6]} is a hierarchical correlation clustering algorithm based on OPTICS.
DiSH^{[7]} is an improvement over HiSC that can find more complex hierarchies.
FOPTICS^{[8]} is a faster implementation using random projections.
Availability
Java implementations of OPTICS, OPTICSOF, DeLiClu, HiSC, HiCO and DiSH are available in the ELKI data mining framework (with index acceleration for several distance functions, and with automatic cluster extraction using the ξ extraction method). Other Java implementations include SPMF and in the Weka extensions (no support for ξ cluster extraction). The Francis Crick Institute provides an implementation in C (MathBio server,GitHub) with R bindings, but without index support. The R package dbscan includes a C++ implementation of OPTICS using a kdtree for index acceleration for Euclidean distance only.
References
 ↑ Mihael Ankerst, Markus M. Breunig, HansPeter Kriegel, Jörg Sander (1999). OPTICS: Ordering Points To Identify the Clustering Structure. ACM SIGMOD international conference on Management of data. ACM Press. pp. 49–60.
 ↑ Martin Ester, HansPeter Kriegel, Jörg Sander, Xiaowei Xu (1996). Evangelos Simoudis, Jiawei Han, Usama M. Fayyad, eds. A densitybased algorithm for discovering clusters in large spatial databases with noise. Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD96). AAAI Press. pp. 226–231. ISBN 1577350049.
 ↑ Markus M. Breunig, HansPeter Kriegel, Raymond T. Ng and Jörg Sander (1999). "OPTICSOF: Identifying Local Outliers". Principles of Data Mining and Knowledge Discovery. SpringerVerlag. pp. 262–270. ISBN 9783540664901. doi:10.1007/b72280.
 ↑ Achtert, E.; Böhm, C.; Kröger, P. (2006). "DeLiClu: Boosting Robustness, Completeness, Usability, and Efficiency of Hierarchical Clustering by a Closest Pair Ranking". LNCS: Advances in Knowledge Discovery and Data Mining. Lecture Notes in Computer Science. 3918: 119–128. ISBN 9783540332060. doi:10.1007/11731139_16.
 ↑ Achtert, E.; Böhm, C.; Kriegel, H. P.; Kröger, P.; MüllerGorman, I.; Zimek, A. (2006). "Finding Hierarchies of Subspace Clusters". LNCS: Knowledge Discovery in Databases: PKDD 2006. Lecture Notes in Computer Science. 4213: 446–453. ISBN 9783540453741. doi:10.1007/11871637_42.
 ↑ Achtert, E.; Böhm, C.; Kröger, P.; Zimek, A. (2006). "Mining Hierarchies of Correlation Clusters". Proc. 18th International Conference on Scientific and Statistical Database Management (SSDBM): 119–128. ISBN 0769525903. doi:10.1109/SSDBM.2006.35.
 ↑ Achtert, E.; Böhm, C.; Kriegel, H. P.; Kröger, P.; MüllerGorman, I.; Zimek, A. (2007). "Detection and Visualization of Subspace Cluster Hierarchies". LNCS: Advances in Databases: Concepts, Systems and Applications. Lecture Notes in Computer Science. 4443: 152–163. ISBN 9783540717027. doi:10.1007/9783540717034_15.
 ↑ Schneider, Johannes; Vlachos, Michail (2013). "Fast parameterless densitybased clustering via random projections". 22nd ACM International Conference on Information and Knowledge Management(CIKM). ACM.