TITLE: Upper bound on $\chi(G)$ for a triangle-free graph
QUESTION [11 upvotes]: I'm struggling with the following question;

For every graph $G$ such that $K_3 \not\subseteq G$ (i.e. $G$ does not contain a triangle), prove that $\chi(G) \leq 2\sqrt{n} +1$ (where $\chi(G)$ denotes the chromatic number).

Any hints? I really cannot see the connection between the triangle-free nature of $G$ and a chromatic number being bounded above by $O(\sqrt{n})$.

REPLY [3 votes]: Here's a sketch:
Start with a lemma: Every triangle-free graph contains an independent set of size $\sqrt{n}$. This can be proven by degree considerations: If there exists a vertex of degree $\geq \sqrt{n}$, consider it's neighbors. Otherwise the maximum degree is at most $\sqrt{n}-1$ and apply the greedy algorithm.
To prove the result, apply induction. Let $S$ be an independent set of size $\sqrt{n}$, and let $H=G\setminus S$. Then $H$ is triangle free and has at most $n-\sqrt{n}$ vertices, and so can be properly colored using at most $2\sqrt{n-\sqrt{n}}+1$ colors. Conclude that $G$ can be properly colored using $2\sqrt{n}+1$ colors.