takes polynomial time.

To prove the above claim we will follow the same line of reasoning as in the proof of Theorem \[t-yy06\] However, our arguments are slightly different, as we need to prove a stronger statement.

Let $B=V\setminus A$ and let $F$ be the subgraph of $G$ induced by $B$. By definition, $F$ is a forest, so all of its connected components are trees.

We will first consider the case where $F$ has a connected component $T$ of diameter at least $3$. Let $P$ be a longest path in the tree $T$ on vertices $v_1,\ldots,v_p$ in that order. As $T$ has diameter $3$, we find that $p\geq 4$. If $p\leq 5$, then we let $X=\{v_1,\ldots,v_p\}$. If $p\geq 6$, then we let $X=\{v_1,v_2,v_{p-1},v_p\}$. We will show that $A=A_X$. Let $u\in A$. As $G$ has diameter $2$ and $A$ is an independent set, $u$ is adjacent to $v_1$ or to a neighbour $v^*$ of $v_1$ in $B$. In the latter case, if $v^*\neq v_2$ then $v^*$ must have a neighbour in $\{v_2,\ldots,v_p\}$, otherwise we have found a path that is longer than $P$, but in this case $B$ contains a cycle, a contradiction. Hence, $u$ has at least one neighbour in 