static pbqp_node **reduced_bucket = NULL;
static int buckets_filled = 0;
+static int dump = 0;
+
/* Forward declarations. */
static void apply_Brute_Force(pbqp *pbqp);
/* ... and put node into bucket representing their degree. */
fill_node_buckets(pbqp);
+ FILE *fh = fopen("solutions.pb", "a");
+ fprintf(fh, "Solution");
+ fclose(fh);
+
apply_heuristic_reductions(pbqp);
pbqp->solution = determine_solution(pbqp->dump_file);
- //printf("solution: %lld\n", pbqp->solution);
+ fh = fopen("solutions.pb", "a");
+ fprintf(fh, ": %lld\n", pbqp->solution);
+ fclose(fh);
/* Solve reduced nodes. */
back_propagate(pbqp);
node->index, min_index);
}
+ FILE *fh = fopen("solutions.pb", "a");
+ fprintf(fh, "[%u]", min_index);
+ fclose(fh);
+
/* Now that we found the local minimum set all other costs to infinity. */
select_alternative(node, min_index);
}
pbqp_dump_graph(pbqp);
}
+ dump++;
min_index = get_minimal_alternative(pbqp, node);
node = pbqp->nodes[node->index];
node->index, min_index);
}
+ dump--;
+ if (dump == 0) {
+ FILE *fh = fopen("solutions.pb", "a");
+ fprintf(fh, "[%u]", min_index);
+ fclose(fh);
+ }
+
/* Now that we found the minimum set all other costs to infinity. */
select_alternative(node, min_index);
}
/* ... and put node into bucket representing their degree. */
fill_node_buckets(pbqp);
+ FILE *fh = fopen("solutions.pb", "a");
+ fprintf(fh, "Solution");
+ fclose(fh);
+
apply_brute_force_reductions(pbqp);
pbqp->solution = determine_solution(pbqp->dump_file);
- //printf("solution: %lld\n", pbqp->solution);
+ fh = fopen("solutions.pb", "a");
+ fprintf(fh, ": %lld\n", pbqp->solution);
+ fclose(fh);
/* Solve reduced nodes. */
back_propagate(pbqp);