Consistent recovery threshold of hidden nearest neighbor graphs