a b s t r a c tFinding a maximum matching in a graph is a classical problem. The on-line versions of the problem in which the vertices and/or edges of the graph are given one at a time and an algorithm has to calculate a matching incrementally have been studied for more than two decades. Many variants of the problem are considered in the literature. The pioneering work (Karp, 1990) considers a bipartite graph where the vertices of one part are revealed one at a time together with their incident edges. In this work we consider maximal d-colorable graphs which are exactly the complete d-partite graphs. The vertices arrive one at a time together with their incident edges, or equivalently with their corresponding colors in some given d-coloring of the graph. We present an optimal 2/3-competitive deterministic algorithm for this on-line problem.This problem is closely related to that of minimizing the cost of line terminals in star topology optical network. We consider lightpaths arriving in an on-line fashion on a given star network. Our result implies a tight 10/9-competitive algorithm for finding a wavelength assignment minimizing the cost of line terminals in such a network.