Segment a dataset by each row once, then compute vicinities of samples in the neighborhood.
Useful links