最小生成树的方法完成室内布线问题.docVIP

  • 19
  • 0
  • 约5.01千字
  • 约 9页
  • 2016-08-23 发布于浙江
  • 举报

最小生成树的方法完成室内布线问题.doc

最小生成树的方法完成室内布线问题

《算法与数据结构》课程设计报告书 ? 最小生成树:室内布线 专 业:计算机科学与技术 成 绩: 烟台大学计算机与控制工程学院 四、#includeiostream #includemath.h using namespace std; typedef struct //存放节点数据 { float x; float y; float h; }outlet; typedef struct { int no;//存放节点编号 int info;//存放节点所处墙面 }VertexType; typedef struct { float edges[20][20];//存放邻接矩阵数据 int n,e; VertexType vexs[20];//节点变量 }MGraph; int Dplace(outlet d[4])//根据门四角坐标求门的位置 { if(d[1].x==d[2].xd[1].x==d[3].xd[1].x==d[4].x)//若门四角的横坐标相同 { if(d[1].x==0)//横坐标为0,则门在1号墙壁上 return 1; else return 3;//否则在三号墙壁上 } if(d[1].y==d[2].yd[1].y==d[3].y

文档评论(0)

1亿VIP精品文档

相关文档