Neighborhood preferences in random matching problems