Kennedy, Kurasov, Malenová and Mugnolo proved that the spectral gap μ₂ of the Kirchhoff Laplacian on a compact metric graph with diameter D and E edges satisfies μ₂D² ≤ 4π²E², and asked for the optimal constants for each E. The heat-kernel method of Chung, Grigor'yan and Yau gives the order log²E with factor 4. We prove that the optimal constant is (1+o(1))log²E: every compact metric graph satisfies √μ₂·D ≤ log(8e²(E+1)), and chains of bundles of parallel edges whose sizes decay exponentially from the middle show that the coefficient 1 is optimal. The same holds with the first Betti number, or the ratio L/D of total length to diameter, in place of E. For the mean distance ρ, the product μ₂ρ² is at most of order log²E, and Ramanujan graphs attain this order. For the first eigenvalue λ₁ with Dirichlet conditions on a nonempty vertex set, λ₁R² ≤ ¼log²(8e²E) for the inradius R, with sharp coefficient ¼, and similarly in L/R; a Betti-number bound holds once the number of Dirichlet vertices is added, which trees with Dirichlet leaves require. The optimal lower constant is of order 1/E. These results quantify Mugnolo's examples showing that diameter, mean-distance and inradius bounds fail. The proofs combine the coarea formula for distance functions, the fact that each edge meets each level set at most twice, and a Riccati inequality for weighted Sturm–Liouville problems.
