🤖 AI Summary
This paper studies the minimum isometric universal graph for two trees, each with at most $n$ vertices—the smallest graph admitting isometric embeddings of both trees. We first prove that the optimal solution is necessarily a tree, revealing its structural essence. Leveraging this insight, we devise an exact algorithm running in $O(n^{5/2}log n)$ time, extendable to forests in $O(n^{7/2}log n)$. In contrast, we show that the problem becomes NP-complete for three trees—or even three forests—and that the optimum need no longer be a tree, thereby refuting the universality of greedy approaches. Our methodology integrates combinatorial graph theory, distance-preserving embedding theory, dynamic programming on tree decompositions, and complexity-theoretic reductions. The core contributions are: (i) establishing the tree structure of the optimal isometric universal graph for two trees; (ii) providing efficient exact algorithms for the two-tree and two-forest cases; and (iii) characterizing the sharp computational phase transition from polynomial-time solvability to NP-completeness when generalizing to three or more trees.
📝 Abstract
We consider the problem of finding the smallest graph that contains two input trees each with at most $n$ vertices preserving their distances. In other words, we look for an isometric-universal graph with the minimum number of vertices for two given trees. We prove that this problem can be solved in time $O(n^{5/2}log{n})$. We extend this result to forests instead of trees, and propose an algorithm with running time $O(n^{7/2}log{n})$. As a key ingredient, we show that a smallest isometric-universal graph of two trees essentially is a tree. Furthermore, we prove that these results cannot be extended. Firstly, we show that deciding whether there exists an isometric-universal graph with $t$ vertices for three forests is NP-complete. Secondly, we show that any smallest isometric-universal graph cannot be a tree for some families of three trees. This latter result has implications for greedy strategies solving the smallest isometric-universal graph problem.