Abstract :
We consider a variant of the classical two median facility location problem on a tree in which vertices are allowed to have positive or negative weights. This problem was proposed by Burkard et al. in 2000 (R.E. Burkard, E. Çela, H. Dollani, 2-medians in trees with pos/neg-weights, Discrete Appl. Math. 105 (2000) 51–71). who looked at two objectives, finding the total minimum weighted distance (MWD) and the total weighted minimum distance (WMD). Their approach finds an optimal solution in O(n2)O(n2) time and O(n3)O(n3) time, respectively, with better performance for special trees such as paths and stars. We propose here an O(nlogn)O(nlogn) algorithm for the MWD problem on trees of arbitrary shape. We also briefly discuss the WMD case and argue that it can be solved in View the MathML sourceO(nhlog2n) time. However, a systematic exposition of the later case cannot be contained in this paper.