Docsity

Homework #4 - Statistical Computing | STAT 534, Assignments of Statistics

Toggle sidebar
bg1
Hil Lyons
STAT 534
HW 4 redo
1) Original output
Below is the output from the test-mst.c program, which created the minimal spanning
tree.
Set: 3493064
Elements:
Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1
Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2
Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3
Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4
Graph: 3485400
Vertex set:
Set: 3485472
Elements:
Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1
Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2
Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3
Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4
Edge set:
Set: 3485616
Elements:
Edge 3486216
Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2
Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1
Edge 3486432
Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3
Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1
Edge 3498192
Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4
Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3
2) Minimal spanning tree for the set of 249 points
Shown (next page) is a plot of the points and minimal spanning tree for the points. The
list of vertices and edges are not shown but can be provided upon request.
Hil Lyons Page 1 5/1/2006
pf3
pf4

Partial preview of the text

Download Homework #4 - Statistical Computing | STAT 534 and more Assignments Statistics in PDF only on Docsity!

Hil Lyons

STAT 534

HW 4 redo

1) Original output

Below is the output from the test-mst.c program, which created the minimal spanning

tree.

Set: 3493064

Elements:

Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1

Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2

Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3

Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4

Graph: 3485400

Vertex set:

Set: 3485472

Elements:

Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1

Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2

Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3

Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4

Edge set:

Set: 3485616

Elements:

Edge 3486216

Point 3493528, x1 = 0.000000, x2 = 1.000000, id = 2

Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1

Edge 3486432

Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3

Point 3493384, x1 = 0.000000, x2 = 0.000000, id = 1

Edge 3498192

Point 3493816, x1 = 3.000000, x2 = 0.000000, id = 4

Point 3493672, x1 = 2.000000, x2 = 0.000000, id = 3

2) Minimal spanning tree for the set of 249 points

Shown ( next page ) is a plot of the points and minimal spanning tree for the points. The

list of vertices and edges are not shown but can be provided upon request.

Minimal Spanning Tree HW4 redo

x

x

/* 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); }