已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
数据结构实验报告-用C#实现关键路径using System;using System.Collections.Generic;using System.Text;namespace LJH.AOE/项目过程 public class ProjectItem/起始项目 private int begin;/终止项目 private int end;/所用的时间 private int buttom;/构造函数 public ProjectItem(int b,int e,int but) begin= b; end= e; buttom= but; /属性 public int Begingetreturn begin; set begin= value; public int Endgetreturn end; set end= value; public int Buttomgetreturn buttom; set buttom= value; /结点类 public class EdgeNodeprivate int adjvex;/* 邻接点域*/private int period;/* 时间域*/private EdgeNode next;public int Adjvexgetreturn adjvex; set adjvex= value; public int Periodgetreturn period; set period= value; public EdgeNode Nextgetreturn next; set next= value; /定义链接图的类型 public class Vexnodeprivate string vertex;private int id;private EdgeNode link;/属性 public string Vertexgetreturn vertex; set vertex= value; public int IDgetreturn id; set id= value; public EdgeNode Linkgetreturn link; set link= value; /AOE网 public class AlGraphprivate Vexnode graphic;private int projectnum;private int activenum;private int totaltime;int vl ;int ve ;int l ;int e ;/属性 public Vexnode Graphicgetreturn graphic; set graphic= value; public int TotalTimegetreturn totaltime; public int Vlgetreturn vl; public int Vegetreturn ve; public int Lgetreturn l; public int Egetreturn e; /构造函数 public AlGraph(int pnum,int anum) totaltime= 0; projectnum= pnum; activenum= anum; graphic= new Vexnodepnum;for (int i= 0; i projectnum; i+) graphici= new Vexnode(); /建立AOE网 private void CreateGraph(ProjectItem item)for (int i= 0; i projectnum; i+) graphici.Vertex= i.ToString(); graphici.ID= 0; graphici.Link= null; for (int k= 0; k activenum; k+) EdgeNode p= new EdgeNode(); p.Adjvex= itemk.End- 1; p.Period= itemk.Buttom; graphicitemk.End- 1.ID+; p.Next= graphicitemk.Begin- 1.Link; graphicitemk.Begin- 1.Link= p; /搜索关键路径 public bool SearchMap(ProjectItem item)int rear= -1, m= 0, front= -1, j, k; EdgeNode p; CreateGraph(item);int topstack= new intprojectnum; l= new intactivenum*2; e= new intactivenum*2; vl= new intprojectnum; ve= new intprojectnum;for (int i= 0; i projectnum; i+) vei= 0; for (int i= 0; i vek) vek= vej+ p.Period; if (graphick.ID= 0) topstack+rear= k; p= p.Next; if (m projectnum)return false; totaltime= veprojectnum- 1;for (int i= 0; i= 0; i-) j= topst
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年企业流动资金的借贷合同范文(二篇)
- 2024年个人借款合同模板(5篇)
- 2024年北京市劳动合同官方版(二篇)
- 2024年大学生实习协议参考范文(四篇)
- 2024年专利申请委托协议简单版(3篇)
- 2024年区域代理合同标准版本(四篇)
- 2024年工程施工合同标准版本(四篇)
- 2024年外销商品房买卖合同(二篇)
- 人教版数学四年级上册期末测试卷附参考答案(b卷)
- 人教版五年级下册数学期末测试卷含完整答案【夺冠系列】
- 2023年江苏省扬州市【中考】历史真题【无答案】
- 课程思政融入中小学体育课程教学途径的研究(开题报告)
- 教代会召开方案及流程
- 新教材人教版(2019)高中生物必修二教案(全册)
- 食品生产企业食品安全风险日管控、周排查、月调度工作制度
- 建立协调和平衡的工作与生活
- 创造性思维与创新方法智慧树知到期末考试答案2024年
- 刮板式花生脱壳机结构设计
- 高中政治2023高考传导式题型选择题练习(特色题型)(共17题,附参考答案和解析)
- 工厂毛利提升方案
- 2024年浙江省温州市铁投集团运营分公司招聘笔试参考题库含答案解析
评论
0/150
提交评论