Labeling point objects

This is a Java application for labeling point objects. The objects are shown as black circles and the labels are just given by the object numbers. We use the Gradient Descent method for labels placement.

The label can be placed in 1 of 4 possible positions around the object, or can be hidden if the method won't find a way to display it without overlapping other labels. So, the labels must not overlap, but in this implementation they can overlap the objects.

The goal is to label as many objects as possible and for each object to use a preferrable label position, which is to the north-east of the object. The objects with no label placed are shown in red color.

Please enter the number of objects to generate and press the button on the Java Application Window.

Source code

Algorithm description