- /*
- if all affinity neighbors fixed,
- try only color changes to affinity colors.
- all other colors do no good.
- */
-
- DB((env->dbg, LEVEL_2, "\t%2{firm:indent}trying %+F index %d for color %d\n", index, ci->irn, index, col));
- if(INFEASIBLE(costs)) {
- DBG((env->dbg, LEVEL_2, "\t%2{firm:indent}-> color is infeasible due to %s\n", index, flag_str(seq[i].flags)));
- break;
- }
-
- bitset_set(cols_tried, col);
- INIT_LIST_HEAD(&changed);
- ok = change_color_single(env, ci->irn, col, &changed, 0);
- 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 finish;
-
- /* 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) {
- done = 1;
- res = 1;
- }
- }
-
- /* unfix the node. */
- reject_coloring(&changed);
- ci->fixed = 0;
-
- if(finish || color_change_balance(env, ci, cols_tried) <= 0) {
- res = finish;
- done = 1;
- }
- }
+ subtree_costs = examine_subtree_coloring(ci, col);
+ sum_costs = subtree_costs + add_cost;
+ DBG((env->dbg, LEVEL_2, "\t%2{firm:indent}-> %+F costing %d + %d is ok.\n", depth, ci->inh.irn, subtree_costs, add_cost));