- put(color, *v, V-1);
-
- //Determine the color for every vertex one by one
- for ( size_type i = 0; i < V; i++) {
- Vertex current = get(order,i);
- typename GraphTraits::adjacency_iterator v, vend;
-
- //Mark the colors of vertices adjacent to current.
- //i can be the value for marking since i increases successively
- for (boost::tie(v,vend) = adjacent_vertices(current, G); v != vend; ++v)
- mark[get(color,*v)] = i;
-
- //Next step is to assign the smallest un-marked color
- //to the current vertex.
- size_type j = 0;
-
- //Scan through all useable colors, find the smallest possible
- //color that is not used by neighbors. Note that if mark[j]
- //is equal to i, color j is used by one of the current vertex's
- //neighbors.
- while ( j < max_color && mark[j] == i )
- ++j;
-
- if ( j == max_color ) //All colors are used up. Add one more color
- ++max_color;
-
- //At this point, j is the smallest possible color
- put(color, current, j); //Save the color of vertex current
+ put(color, *v, V - 1);
+
+ // Determine the color for every vertex one by one
+ for (size_type i = 0; i < V; i++)
+ {
+ Vertex current = get(order, i);
+ typename GraphTraits::adjacency_iterator v, vend;
+
+ // Mark the colors of vertices adjacent to current.
+ // i can be the value for marking since i increases successively
+ for (boost::tie(v, vend) = adjacent_vertices(current, G); v != vend;
+ ++v)
+ mark[get(color, *v)] = i;
+
+ // Next step is to assign the smallest un-marked color
+ // to the current vertex.
+ size_type j = 0;
+
+ // Scan through all useable colors, find the smallest possible
+ // color that is not used by neighbors. Note that if mark[j]
+ // is equal to i, color j is used by one of the current vertex's
+ // neighbors.
+ while (j < max_color && mark[j] == i)
+ ++j;
+
+ if (j == max_color) // All colors are used up. Add one more color
+ ++max_color;
+
+ // At this point, j is the smallest possible color
+ put(color, current, j); // Save the color of vertex current