Randomized near-neighbor graphs, giant components and applications in data science