Commit aa7ec494 authored by Christopher Alfeld's avatar Christopher Alfeld

Fixed bug that caused endless loop when all nodes are fixed.

parent 7bf7645d
......@@ -203,6 +203,8 @@ int assign()
int bestviolated;
int absbestv;
int num_fixed=0;
float temp = init_temp;
#ifdef VERBOSE
......@@ -242,6 +244,7 @@ int assign()
}
unassigned_nodes.del(vn);
G[vn].fixed=true;
num_fixed++;
}
bestscore = get_score();
......@@ -255,6 +258,13 @@ int assign()
node n3;
forall_nodes(n3, G) {
absnodes[n3] = G[n3].posistion;
abstypes[n3] = G[n3].type;
}
if (num_fixed == nnodes) {
cout << "All nodes are fixed. No annealing." << endl;
goto DONE;
}
while (temp >= temp_stop) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment