+ cloud->master->mst_parent = cloud->master;
+ cloud->mst_root = cloud->master;
+ q = new_pdeq1(cloud->master);
+ while(!pdeq_empty(q)) {
+ co2_cloud_irn_t *ci = pdeq_getl(q);
+ int ofs = ci->index * cloud->n_memb;
+ int end = ofs + cloud->n_memb;
+ int i;
+
+ ci->mst_n_childs = 0;
+ for(i = ofs; i < end; ++i) {
+ if(mst_edges[i] != 0) {
+ int other = i - ofs;
+ co2_cloud_irn_t *child = cloud->seq[i - ofs];
+
+ /* put the child to the worklist */
+ pdeq_putr(q, child);
+
+ /* make ci the parent of the child and add the child to the children array of the parent */
+ child->mst_parent = ci;
+ child->mst_costs = mst_edges[i];
+ ci->mst_n_childs++;
+ obstack_ptr_grow(&cloud->obst, child);
+
+ mst_edges[other * cloud->n_memb + ci->index] = 0;
+ mst_edges[i] = 0;
+ }
+ }
+
+ obstack_ptr_grow(&cloud->obst, NULL);
+ ci->mst_childs = obstack_finish(&cloud->obst);
+ }
+ del_pdeq(q);
+ free(mst_edges);
+
+
+ DBG((env->dbg, LEVEL_3, "mst:\n"));