I have a map, with some icon over it. Every icon has a label next to it. When icons overlaps, labels are overlapped too. In this case, I want to move labels so they don't overlap anymore, with a line linking them with respective icons. Obviously I know size and position of labels and icon, related to screen coordinates.
Which algorithm should I study in order to implement this (I can't use any GIS library)? I've searched for declutter on Internet (I don't speak English very well), but I've found only ideas for hiding/showing icons, not for label moving.