- bitset_set(cols_tried, col);
- INIT_LIST_HEAD(&changed);
- cloud->ticks++;
- ok = change_color_single(env, ci->irn, col, &changed, index);
- DB((env->dbg, LEVEL_2, "\t%2{firm:indent}-> %s\n", index, ok ? "ok" : "failed"));
-
- /* if we succeeded changing the color, we will figure out the next node. */
- if(ok) {
- int balance;
- int finish;
-
- /* Mark the time of the last color change */
- ci->last_color_change = cloud->ticks;
-
- /* materialize the coloring and fix the node's color. */
- ci->fixed = 1;
-
- /* process the next nodes. if the function returns one, we found an optimal coloring already, so get out. */
- finish = process_node(env, cloud, index + 1);
-
- /* if this is the last node in the coloring sequence, examine the coloring */
- if(index == cloud->n_memb - 1) {
- examine_cloud_coloring(env, cloud);
- DB((env->dbg, LEVEL_2, "\t%2{firm:indent}-> current best coloring %d\n", index, cloud->best_costs));
- if(cloud->best_costs == cloud->inevit)
- finish = 1;
- }
-
- /* Compute the recoloring balance for this solution. */
- balance = color_change_balance(env, ci, cols_tried, index);
- DBG((env->dbg, LEVEL_3, "\t%2{firm:indent}balance for further color changing: %d\n", index, balance));
-
- /* unfix the node. */
- reject_coloring(&changed);
- ci->fixed = 0;
-
- if(finish || balance <= 0) {
- res = finish;
- done = 1;
- }
- }