I'm struggling to prove the following elementary fact about graphs:
If $G$ is a graph which is not a forest, $g(G) \leq 2\cdot \operatorname{diam}(G) + 1$.
I've already tried induction on the size of the graph, and looking for a contradiction taking a minimal cycle, with no luck. Any hints?
Consider the smallest cycle in $G$. If it has length $k$, then there exist two vertices on this cycle such that the shortest path in this cycle between them has length $\ge \lfloor k/2 \rfloor \ge \frac{k-1}{2}$. Now use minimality of this cycle to show that in the full graph $G$, there can be no path between these two vertices of length $< \frac{k-1}{2}$.