NonHierarchicalDistanceBasedAlgorithm

A simple clustering algorithm with O(nlog n) performance. Resulting clusters are not hierarchical.

High level algorithm: 1. Iterate over items in the order they were added (candidate clusters). 2. Create a cluster with the center of the item. 3. Add all items that are within a certain distance to the cluster. 4. Move any items out of an existing cluster if they are closer to another cluster. 5. Remove those items from the list of candidate clusters.

Clusters have the center of the first element (not the centroid of the items within it).

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun addItem(item: T): Boolean
Adds an item to the algorithm
Link copied to clipboard
open fun addItems(items: Collection<T>): Boolean
Adds a collection of items to the algorithm
Link copied to clipboard
open fun clearItems()
Link copied to clipboard
open fun getClusters(zoom: Float): Set<out Cluster<T>>
Link copied to clipboard
open fun getItems(): Collection<T>
Link copied to clipboard
open fun lock()
Link copied to clipboard
open fun removeItem(item: T): Boolean
Removes an item from the algorithm
Link copied to clipboard
open fun removeItems(items: Collection<T>): Boolean
Removes a collection of items from the algorithm
Link copied to clipboard
Link copied to clipboard
open fun unlock()
Link copied to clipboard
open fun updateItem(item: T): Boolean
Updates the provided item in the algorithm