#include "tsp.h" #include #include #ifndef PLAIN #include #include "mem-ref.h" #endif #ifdef VERIFY_AFFINITIES #include "affinity.h" CHECK2(Tree,left,right,tree) #endif int flag; int __NumNodes, __NDim; int mylog(int num) { int j=0,k=1; while(kx; y = t->y; chatting("x=%f,y=%f\n",x,y); left = t->left; right=t->right; print_tree(left); print_tree(right); } void print_list(Tree t) { Tree tmp; double x,y; if (!t) return; x = t->x; y = t->y; chatting("%f %f\n",x,y); for (tmp=t->next; tmp!=t; tmp=tmp->next) { x = tmp->x; y = tmp->y; chatting("%f %f\n",x,y); } } double wallclock; int main() { Tree t; int num; num = dealwithargs(); chatting("Building tree of size %d\n",num); t=build_tree(num,0,0,__NumNodes,0.0,1.0,0.0,1.0); #ifdef VERIFY_AFFINITIES Docheck_tree(t); #endif if (!flag) chatting("Past build\n"); if (flag) chatting("newgraph\n"); if (flag) chatting("newcurve pts\n"); timer_start(0); tsp(t,150,__NumNodes); timer_stop(0); if (flag) print_list(t); if (flag) chatting("linetype solid\n"); chatting("Time for TSP = %f\n", timer_elapsed(0)); #ifdef VERIFY_AFFINITIES Print_Accumulated_list(); #endif #ifdef FUTURES __ShutDown(0); #endif exit(0); }