Subsets of vertices of the same size and the same maximum distance

For a connected simple graph G = (V,E) and a subset X of its vertices, let d∗(X) = max{distG(x, y) : x, y ∈ X} and let h∗(G) be the largest k such that there are disjoint vertex subsets A and B of G, each of size k such that d∗(A) = d∗(B). Let h∗(n) = min{h∗(G) : |V (G)| = n}. We prove that h∗(n) = b(n + 1)/3c, for n ≥ 6. This solves the homometric set problem restricted to the largest distance exactly. In addition we compare h∗(G) with a respective function hdiam(G), where d ∗(A) is replaced with diam(G[A]).


Introduction
For a subset X of vertices of a graph G, let d * (X) = max{dist G (x, y) : x, y ∈ X}, where dist G is the distance in G. Two subsets of vertices A, B ⊆ V are weakly homometric if |A| = |B|, A ∩ B = ∅, and d * (A) = d * (B). Let h * (G) be the largest k such that G has weakly homometric sets of size k each. Let h * (n) be the smallest value of h * (G) over all connected n-vertex graphs. Informally, any connected graph G on n vertices has two disjoint subsets of vertices of the same size at least h * (n) that have the same largest distance (in G) between their vertices.
The notion of weakly homometric sets originates from the notion of homometric sets introduced by Albertson et al. [1]. For a subset of vertices X, let d(X) be a multiset of pairwise distances between the vertices of X. Two disjoint sets of vertices A and B are called homometric, if d(A) = d(B). Let h(G) be the largest k such that G has two homometric sets of size k each. Let h(n) be the largest value of h(G) among all connected n-vertex graphs. The best known bounds on h(n) are as follows: for positive contants c, c , where the lower bound is due to Alon [2], and the upper one is due to Axenovich andÖzkahya [3], both of the bounds are slight improvements of the original bounds by Albertson et al. [1]. There are much better bounds on h(G) known when G is a tree or when G has diameter 2, see Fulek and Mitrović [6] and Bollobás et al. [4], see also an earlier paper by Caro and Yuster [5]. Weakly homometric sets are concerned only with one, the largest, distance. In this note we find h * (n) exactly. Theorem 1. For any n ≥ 6, h * (n) = (n + 1)/3 .
Note that considering connected graphs in the definition of h * is not an essential restriction. Indeed, if a graph G is not connected and has at least two components of size at least two each, then by taking ∞ as a distance between any two vertices from different components, we see that h * (G) ≥ n/2 . Otherwise, G has two connected components, one of which is a single vertex. Thus by Theorem 1 applied to the larger component h * (G) ≥ n/3 .
When the distance is considered in a subgraph rather than in an original graph, we consider the following function that is of independent interest. For a graph G, h diam (G) is the largest integer k such that there are disjoint sets A, B ⊆ V (G), each of size k and so that diam(G[A]) = diam(G[B]).
In order to prove the main result, we consider an auxiliary coloring of the edges of a complete graph on the vertex set V = V (G) with colors 1, 2, . . . , diam(G) such that the color of xy is dist G (x, y), x, y ∈ V . The result follows from observations about the structure of the color classes. In fact, the proof allows for an algorithm determining large weakly homometric sets.

Proofs
Let, for a graph G and . We say that we split a set X of vertices if we form two disjoint subsets of X of size |X|/2 . We denote d(xy) = dist G (x, y), x, y ∈ V (G). We denote the edge set of a star with center x and leaves set X as S(x, X).
Proof. Assume first that xy, x y ∈ E i (X) are disjoint pairs of vertices and i = d * (X). Split X such that x, y are in one part and x , y in another part. The resulting sets are weakly homometric sets. If d * (X) = 2, then either E 2 (X) is good implying h * (G) ≥ |X|/2 or non-edges form a star or a triangle, so deleting one vertex allows to split the remaining vertices of X in two sets each inducing a clique. Thus h * (G) ≥ (|X| − 1)/2 in this case. If d * (X) = 1, then X induces a clique and h * (G) ≥ |X|/2 .
Proof of Theorem 1. First we shall show the lower bound on h * (n). Consider a connected graph G on n vertices. Let d = diam(G). If d = 2, the lower bound follows from the Lemma 3. So, we assume that d ≥ 3. If E d (V ) is good, then by Lemma 3 h * (G) ≥ (n − 1)/2 ≥ (n + 1)/3 . If E d (V ) is bad, it is either forms a triangle or a star.
Case 1 E d (V ) forms a triangle xyz. Let x and y be distinct vertices such that d(xx ) = d(yy ) = d − 1. Such x , y could be chosen on a shortest xy-path. Let A and B be disjoint subsets of V − z, each of size (n + 1)/3 , A containing x and x , B containing y and y . We see that A and B are weakly homometric with maximum distance d − 1.

SUBSETS OF VERTICES OF THE SAME SIZE AND THE SAME MAXIMUM DISTANCE 3
Case 2 E d (V ) forms a star. Let E d (V ) = S(x 0 , Y ), forming a star with center x 0 and leaves set Y . Let Case 2.1 |Y | ≤ n − (n + 1)/3 − 1. Let A and B be disjoint sets such that |A| = |B| = (n + 1)/3 , Then A and B are weakly homometric with largest distance d − 1.
Case 2.2 |Y | ≥ n − (n + 1)/3 . In particular d ≤ (n + 1)/3 . Let T be the breadth-first search tree with root x 0 . Let L i 's be the layers of T , i.e., sets of vertices at distance i from x 0 , i = 1, . . . , d.
If T is a broom, i.e., all vertices of Y have a common neighbor, If T is not a broom, then some layer L i , i < d, has more than one vertex and d ≤ (n+1)/3 −1. Let i be the smallest such index, i.e., L j = {x j } for j < i. Then we see that We . . in order and show that each of these sets E j (V j ) is either good, allowing to use Lemma 3, or is a star with center x j .
For the upper bound on h * (n), let k = (n + 1)/3 . Consider a graph G that is a union of a clique K on n − k vertices and a path P on k + 1 vertices such that K and P share exactly one vertex x that is an end-point of P . Consider two weakly homometric sets A and B in V (G) that have the largest possible size h * (G). If (A∪B) ⊆ V (K) then h * (G) ≤ (n−k)/2 . So, let's assume that x ∈ V (P )∩(A∪B) such that x has the largest distance from x among the vertices of A ∪ B. Assume further that x ∈ A and let i = d(x x). Then E i+1 (G) consists of all pairs x y, y ∈ V (K) − {x} and pairs containing vertices from P that are further from x as x (if any). Since there are no such vertices in A ∪ B, we see that E i+1 restricted to A ∪ B is a star, so i + 1 = d * (A). Thus A ⊆ V (P ). If d * (A) > 1 then d * (B) > 1 and B \ V (K) = ∅. Thus at least one vertex in P is from B, so |A| ≤ |V (P )| − 1 = k. If d * (A) = 1, then |A| = 2. Thus h * (G) ≤ max{ (n − k)/2 , k, 2} ≤ (n + 1)/3 , for n ≥ 6.
Proof of Theorem 2. Let G be a graph on n vertices and let k = (n + 1)/3 . Assign a color c(A) = diam(G[A]) to each k-element subset A of vertices of G. Then c(A) ∈ {1, 2, . . . , k − 1, ∞}. So, there are at most k colors used in this coloring. The coloring c corresponds to a coloring of vertices of the Kneser graph K(n, k). Since the chromatic number χ(K(n, k)) = n − 2k + 2, see Lovász [7], and the number k of colors used is less than the chromatic number n − 2k + 2, we see that c is not a proper coloring, so there are two disjoint sets A and B of the same color. Thus h diam (G) ≥ k. In particular, h diam (G) ≥ (n + 1)/3 .
If diam(G) = 1 then G is a complete graph and the conclusion follows trivially. If diam(G) ≥ 4, we consider a vertex v that is at distance at least 4 to some other vertex. Consider a breadth first search tree with a root v. Let V i , i = 0, 1, 2, . . . , q be the layers of that tree, i.e., V i is a set of vertices at distance i from v, V 0 = {v}, q ≥ 4. We see that there are no edges between any two non-consecutive layers. We shall build two disjoint sets A and B such that G[A] and G[B] are both disconnected, i.e., have diameter ∞.
If each layer has size less than n/2, put v and V 2 in A, put V 1 in B and split the remaining vertices (except maybe one) between A and B such that |A| = |B|. We see that v is not adjacent to any other vertex of A and we see that any vertex of V 2 is not adjacent to any vertex from B \ V 2 .
If there is a layer, L, of size at least n/2 then the total number of vertices in all other layers is less than n/2. Consider the layers other than L, in order, and assign all vertices of each layer to the same set, A or B, in an alternating fashion. Split the vertices of L between A and B such that |A| = |B| = n/2 . More precisely, let {V 0 , V 1 , . . .} \ L = {V i1 , V i2 , . . .}, where i 1 < i 2 < · · · . Put vertices of V i k in A if k is even, put vertices of V i k in B if k is odd. We see that there is always a full layer in A between some two vertices of B and there is a full layer of B between two vertices of A. So, G[A] and G[B] are disconnected.

Acknowledgements
The authors thank Torsten Ueckerdt for interesting discussions on the topic.