/**********************************************************************/ /* */ /* (c) Copyright, 1997 by Professor Gabriel Robins */ /* */ /* Department of Computer Science, University of Virginia */ /* Charlottesville, VA 22903-2442 (804) 982-2207 */ /* robins@cs.virginia.edu http://www.cs.virginia.edu/~robins/ */ /* */ /* This code may be freely used for all non-commercial purposes. */ /* All copies/portions of this code must contain this header. */ /* */ /**********************************************************************/ /**********************************************************************/ /* Steiner3.c */ /**********************************************************************/ #include "geometry.h" /**********************************************************************/ int generate_steiner3(void) { int current_MST_cost, original_MST_cost; int i, j, k, heuristic_num = 3, actual_number_of_points, nsp = 0; actual_number_of_points = number_of_points; generate_MST2(); original_MST_cost = current_MST_cost = mst_cost; number_of_points++; for(i=0;i 2) { pointset[ptr1] = pointset[ptr2]; ptr1++; } else if(h_num != 3) printf("H%d: Deleted a SP with deg %d!\n", h_num, vertices[ptr2].neighbor_count); number_of_points = ptr1; generate_MST(); if((old_mst_cost > mst_cost) && (h_num!=3)) { printf("H3: Deletion resulted in MST cost savings of %.0f!!!!\n", old_mst_cost - mst_cost); printf("Pointset is now: "); for(k=0;k