Quadratic p-Median Formulations with Connectivity Costs Between Facilities