


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



/* otherwise, update distance as req/ else { new_dist = point_distance(outpoint[i], vtx); if (new_dist < distance[i]){ distance[i] = new_dist; nearest_inpoint[i] = vtx;} } / update the min distance and pair representing it/ if (min_dist == -1 || distance[i] < min_dist){ pair = i; min_dist = distance[i]; } } / update graph, point set*/ graph_add_edge(edge_make(outpoint[pair], nearest_inpoint[pair]), mstree); graph_add_vertex(outpoint[pair], mstree); outpoint[pair] = outpoint[num_outpoints - 1]; nearest_inpoint[pair] = nearest_inpoint[num_outpoints - 1]; distance[pair] = distance[num_outpoints - 1]; ini_dist = FALSE; } free(outpoint); free(nearest_inpoint); free(distance); return(mstree); }