The optimal location of facilities on a network