ClosestPairNaive

Closest Pair algorithm using the Divide and Conquer approach. This implementation sorts the points by x and y coordinates and recursively finds the closest pair.

Constructors

Link copied to clipboard
constructor(input: Collection<V>)

initializes the algorithm with a collection of points.

Functions

Link copied to clipboard
open override fun getGroup(): String

Returns the group to which the algorithm belongs. This is used for categorization and organization of algorithms.

Link copied to clipboard
open fun getId(): String

Returns a unique identifier for the algorithm, combining its group and name. The identifier is formatted as "group:name", with both group and name in lowercase and spaces replaced by hyphens.

Link copied to clipboard
open override fun getName(): String

Returns the name of the algorithm.

Link copied to clipboard
open override fun run(): Result<V>

Runs the algorithm and returns the output.