  size_type max_color = 0;
    const size_type V = num_vertices(G);
    std::vector&lt;size_type&gt;
      mark(V, numeric_limits_max(max_color));

    typename GraphTraits::vertex_iterator v, vend;
    for (boost::tie(v, vend) = vertices(G); v != vend; ++v)
      color[*v] = V - 1; // which means "not colored"

    for (size_type i = 0; i &lt; V; i++) {
      vertex_descriptor current = order[i];

      // mark all the colors of the adjacent vertices
      typename GraphTraits::adjacency_iterator ai, aend;