On-Line and First-Fit Coloring of Graphs That Do Not Induce P5

For a graph $H$, let $\Forb(H)$ be the class of graphs that do not induce $H$, and let $P_5$ be the path on five vertices. In this article, we answer two questions of Gyarfas and Lehel. First, we show that there exists a function $f(\omega)$ such that for any graph $G \in \Forb(P_{5})$, the on-line coloring algorithm First-Fit uses at most # f(\omega(G))$ colors on $G$, where $\omega(G)$ is the clique size of $G$. Second, we show that there exists an on-line algorithm $A$ that will color any graph $G \in \Forb(P_{5})$ with a number of colors exponential in $\omega(G)$. Finally, we extend some of our results to larger classes of graphs defined in terms of a list of forbidden subgraphs.