For a simple connected graph $G=(V,E)$ and a subset $X$ of its vertices, let $$d^*(X) = \max\{{\rm dist}_G(x,y): x,y\in 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) = \lfloor (n+1)/3 \rfloor,$ for $n\geq 6.$ This solves the homometric set problem restricted to the largest distance exactly. In addition we compare $h^*(G)$ with a respective function $h_{{\rm diam}}(G)$, where $d^*(A)$ is replaced with ${\rm diam}(G[A])$.