
      for (boost::tie(ai, aend) = adjacent_vertices(current, G); ai != aend; ++ai)
        mark[color[*ai]] = i;

      // find the smallest color unused by the adjacent vertices
      size_type smallest_color = 0;
      while (smallest_color &lt; max_color &amp;&amp; mark[smallest_color] == i)
        ++smallest_color;

      // if all the colors are used up, increase the number of colors
      if (smallest_color == max_color)
        ++max_color;

      color[current] = smallest_color;
    }
    return m