Abstract
The median of a set of vertices P of a graph G is the set of all vertices x of G minimizing the sum of distances from x to all vertices of P. In this paper, we present a linear time algorithm to compute medians in median graphs. We also present a linear time algorithm to compute medians in the associated ℓ1-cube complexes. Our algorithm is based on the majority rule characterization of medians in median graphs and on a fast computation of parallelism classes of edges (Θ-classes) via Lexicographic Breadth First Search (LexBFS). We show that any LexBFS ordering of the vertices of a median graph satisfies the following fellow traveler property: the parents of any two adjacent vertices are also adjacent. Using the fast computation of the Θ-classes, we also compute the Wiener index (total distance) in linear time and the distance matrix in optimal quadratic time.
Highlights
The median problem is one of the oldest optimization problems in Euclidean geometry [49]
We show that the medians in median graphs can be computed in optimal O(m) time
We present a linear time algorithm to compute medians in median graphs and in associated 1-cube complexes
Summary
The median problem ( called the Fermat-Torricelli problem or the Weber problem) is one of the oldest optimization problems in Euclidean geometry [49]. We present a linear time algorithm to compute medians in median graphs and in associated 1-cube complexes. With the Θ-classes of G at hand and the majority rule for halfspaces, we can compute the weights of halfspaces of G in optimal time O(m), leading to an algorithm of the same complexity for computing the median set. The best algorithm to compute the Θ-classes of a median graph G has complexity O(m log n) [39] It was used in [39] to recognize median graphs in subquadratic time. A polynomial-time algorithm to compute the 2-distance between two points in this space was proposed in [60] This result was recently extended in [42] to all CAT(0) cube complexes. In a recent breakthrough [20], a subquadratic algorithm for the Wiener index and the diameter of planar graphs was presented
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.