AbstractThe p-median problem on a tree T is to find a set S of p vertices on T that minimizes the sum of distances from T’s vertices to S. In this paper, we study two generalizations of the 2-median problem, which are obtained by imposing constraints on the two vertices selected as a 2-median: one is to limit their distance while the other is to limit their eccentricity. Previously, both the best upper bounds of these two generalizations were O(n2) [A. Tamir, D. Perez-Brito, J.A. Moreno-Perez, A polynomial algorithm for the p-centdian problem on a tree, Networks 32 (1998) 255–262; B.-F. Wang, S.-C. Ku, K.-H. Shi, Cost-optimal parallel algorithms for the tree bisector problem and applications, IEEE Transactions on Parallel and Distributed Sy...