in this book The design and analysis of spatial data structures P.56 it is mentioned that
Once the set of candidate nodes is found, an attemp is made to find the "best" candidate, which becomes the replacement node. There are two criteria for choosing the best candidate. Criterion 1 stipulates the choice of the candidate that is closer to each of its bordering axes than any other candidate on the same side of theses axes, if such a candidate exists
I was trying to implement this, but cant really figure out how this algorithmn should work. I started very simple and created two sorted lists, one sorted by the difference in x and the other sorted by the difference in y, and if both objects are the same then this object/point will be my result. If not then i either have no candidate or maybe 2 and this is the point where i am stuck!
Another approch was some kind of strange but i will still show the pseudocode, maybe someone has an idea
function chooseCandidate(candidate)
clockwiseCandidate = candidate.cQuad(candidate.index) // Index is from 0-3 and cQuad returns (index-1)%4
counterClockwiseCandidate = candidate.ccQuad(candidate.index)
if candidate.x < ccCandidate.x:
possibleWinner = candidate
else if candidate.y < cCandidate.y:
possibleWinner = candidate
And so on, this is not really a solution just a mindgame from me... So my question would be, can someone explain what this problem is ? or how i could solve this problem? (Please note that a full description is given in the link above)