Abstract:Computing the diameter, and more generally, all eccentricities of an undirected graph is an important problem in algorithmic graph theory and the challenge is to identify graph classes for which their computation can be achieved in subquadratic time. Using a new recursive scheme based on the structural properties of median graphs, we provide a quasilinear-time algorithm to determine all eccentricities for this well-known family of graphs. Our recursive technique manages specifically balanced and unbalanced parts of the $\Theta$-class decomposition of median graphs. The exact running time of our algorithm is O(n log^4 n). This outcome not only answers a question asked by B{é}n{é}teau et al. (2020) but also greatly improves a recent result which presents a combinatorial algorithm running in time O(n^1.6408 log^{O(1)} n) for the same <a class="link-external link-http" href="http://problem.Furthermore" rel="external noopener nofollow">this http URL</a> we also propose a distance oracle for median graphs with both polylogarithmic size and query time. Speaking formally, we provide a combinatorial algorithm which computes for any median graph G, in quasilinear time O(n log^4 n), vertex-labels of size O(log^3 n) such that any distance of G can be retrieved in time O(log^4 n) thanks to these labels.
What problem does this paper attempt to address?
The main problems that this paper attempts to solve are calculating the eccentricities of all vertices on median graphs and constructing a distance oracle. Specifically:
1. **Eccentricity Calculation**:
- The paper proposes a combinatorial algorithm that can calculate all weighted eccentricities of median graphs in quasi - linear time \(O(n \log^4 n)\). Here, the weighted eccentricity means that for each vertex \(u\), its weighted eccentricity \(\text{ecc}(u|(G,\omega))\) is defined as \(\max\{d(u, v)+\omega(v):v\in V\}\), where \(d(u, v)\) is the length of the shortest path between \(u\) and \(v\), and \(\omega(v)\) is the weight of vertex \(v\).
- This result significantly improves the previous best algorithm, which has a time complexity of \(\tilde{O}(n^{1.6408})\).
2. **Distance Oracle**:
- The paper also proposes a distance oracle (DO) that can assign a label of size \(O(\log^3 n)\) to each vertex in quasi - linear time \(O(n\log^4 n)\), so that the distance between any two vertices can be quickly retrieved through these labels in \(O(\log^4 n)\) time.
### Main Contributions
1. **Eccentricity Calculation Algorithm**:
- This algorithm takes advantage of the structural characteristics of median graphs, especially the concept of \(\Theta\)-classes. By recursively processing balanced and unbalanced \(\Theta\)-classes, the algorithm can effectively reduce the scale of sub - problems in each recursive step.
- For balanced \(\Theta\)-classes, the algorithm recursively processes each part and finally restores the weighted eccentricity of the entire graph by looking up the maximum distance between different parts.
- For graphs without balanced \(\Theta\)-classes, the algorithm finds all weighted eccentricities through a breadth - first search (BFS) starting from the unique median vertex \(v_0\) and some recursive calls.
2. **Distance Oracle**:
- The distance oracle enables the distance between any two vertices to be quickly calculated by assigning a label to each vertex. The information included in the label includes the balanced \(\Theta\)-class to which the vertex belongs, the part where it is located, the gate, the distance to the gate, and the label in the induced subgraph.
- For unbalanced \(\Theta\)-classes, the algorithm divides the vertices through a breadth - first search (BFS) starting from the central vertex \(v_0\) and records the "direction" information of each vertex, thereby achieving rapid retrieval of distances.
### Potential Applications and Future Research Directions
- **Wider Applications**: The techniques in the paper are not only applicable to median graphs but can also be extended to other types of graphs, such as almost - median graphs, pseudo - median graphs, and partial cube graphs.
- **Calculation of Other Metric Parameters**: Future research can attempt to use these techniques to improve the calculation of other metric parameters, such as hyperbolicity, betweenness centrality, and reachability centrality.
- **Weighted Center Problem**: The paper proposes an unstudied problem - the weighted center problem (Weighted Center), that is, given a median graph \(G\) and vertex weights \(\omega\), find a vertex \(u\) such that \(\max_{v\in V(G)}\omega(v)d(u, v)\) is minimized. The author believes that existing techniques can be used to solve this problem in quasi - linear time.
Through these contributions, the paper not only solves key computational problems on median graphs but also provides new tools and methods for future algorithm design.