Nearest-neighbor algorithm with directions (left / right / top / bottom)
===

Having *n* random points in 2D geometry, for each point `p` I need to find 4 *(or less if not exists)* closest points *(*`qa`*,*`qb`*,*`qc`*,*`qd`*)*, where *qa* is the closest ***left-top*** point, *qb* is the closest ***right-top*** point, *qc* is the closest ***left-bottom*** point and *qd* is the closest ***right-bottom*** point to point *p*. Having same *x* coordinate is considered as left, having same *y* coordinate is considered as bottom.

What would be the best ***data structure*** to store point coordinates and their nearest-neighbor references? What ***algorithm*** would be the fastest or the most performed?

Note: This issue is far more then nearest-neighbor algorithm, as for each point 4 neighbor points are needed. 

Please advice. Thank you.