is either adjacent to $w_1$ or to a neighbour of $w_1$ in $B$. If this neighbour is not $v_1$, then $D_1$ is not a star-component, a contradiction. Hence, $u$ has at least one neighbour in $\{v_1,w_1\}$, and similarly, $u$ has at least one neighbour in $\{v_2,w_2\}$. So $A\subseteq A_X$. Now suppose $u\in A_X$. Then $X\cup \{u\}$ induces either a connected subgraph of $G$ that contains both $D_1$ and $D_2$ (and is therefore not a star-component) or a subgraph with a cycle. Hence $u$ must belong to $A$. So $A_X\subseteq A$. We conclude that $A=A_X$. This completes the proof of our claim and thus the proof of the lemma.

We are now ready to prove the main result of this section.

\[t-p\] The problem of finding a minimum independent feedback vertex set of a graph of diameter $2$ can be solved in polynomial time.

Let $G$ be an $n$-vertex graph of diameter $2$. We first check in polynomial time whether $G$ contains a vertex $u$ such that $G-u$ is bipartite. If so, then we apply Lemma \[l-1\]. If not, then we check in polynomial time whether $G$ contains a set $X$ of size $4\leq |X|\leq 5$ such that $(A_X,V\setminus A_X)$ is 