数学与软件科学学院 实验报告
学期:__2011_至__2012__ 第___一__ 学期 20##年11月9日
课程名称:__运 筹 学 ________ 专业:_信息与计算科学___ 级_班
实验编号:5 实验项目______网络分析___________ 指导教师___黄娟___
姓名:_____ 学号: __ 实验成绩:_____
一、实验目的及要求
调用由Matlab软件编写的相关程序,求解一些网络分析问题。掌握相关程序的调用格式和参数的具体含义。
二、实验内容
调用由Matlab软件编写的程序MST_d.m
和 SP_d.m
, 求解最小树问题和最短有向路问题,并能正确读取结果。
三、实验步骤(该部分不够填写.请填写附页)
调用程序MST_d.m求解最小树问题<教材P233 习题7 >的步骤
<1>将程序MST_d.m放到当前目录中。
<2> 在MATLAB的命令窗口输入MST_d,按“Enter”键。
<3> 命令窗出现“ Enter the vertices number of the graph : n= ”时, 输入 5, 按“Enter”键。
<4> 命令窗出现“ Enter the weight adjacent matrix of the graph:[W(1,1)… W(n,n)]= ”时, 输入 [inf,1,7,3,inf;1,inf,6,inf,4;7,6,inf,8,5;3,inf,8,inf,2;inf,4,5,2,inf], 按“Enter”键。
<5> 命令窗出现“ The weight adjacent matrix of the Minimum Spanning Tree of the graph is: ”时, 按“Enter”键。实验结果参见附页。
调用程序SP_d.m求解最短有向路问题<教材P233 习题9 >的步骤
<1>将程序SP_d.m放到当前目录中。
<2> 在MATLAB的命令窗口输入SP_d,按“Enter”键。
<3> 命令窗出现“ Enter the vertices number of the graph : n= ”时, 输入 6, 按“Enter”键。
<4> 命令窗出现“ Enter the weight adjacent matrix of the graph:[W(1,1)… W(n,n)]= ”时, 输入 [inf, 5, inf, 3, inf, inf ; inf, inf, 3, inf, inf, inf ; inf, inf, inf, inf, inf, 2 ; inf, 1, 2, inf, 2, inf; inf, 1, inf, inf, inf, 4; inf, inf, inf, inf, inf, inf ], 按“Enter”键。
<5> 命令窗出现“The pre-vertix labelling of the Shortest Path (from 1 to the other) is:”时, 按“Enter”键。实验结果参见附页。
实 验 报 告 附 页
四、实验结果分析与评价 (该部分不够填写.请填写附页)
调用程序MST_d.m求解最小树问题<教材P233 习题7 >的结果为:
W =
Inf 1 7 3 Inf
1 Inf 6 Inf 4
7 6 Inf 8 5
3 Inf 8 Inf 2
Inf 4 5 2 Inf
The weight matrix of the Minimum Spanning Tree of the graph is:
MST =
Inf 1 Inf 3 Inf
1 Inf Inf Inf Inf
Inf Inf Inf Inf 5
3 Inf Inf Inf 2
Inf Inf 5 2 Inf
调用程序SP_d.m求解最短有向路问题<教材P233 习题9 >的结果为:
W =
Inf 1 3 Inf Inf Inf
Inf Inf Inf 4 Inf Inf
Inf 2 Inf Inf 5 Inf
Inf Inf 2 Inf Inf 3
Inf Inf Inf 4 Inf 2
Inf Inf Inf Inf Inf Inf
the pre-vertix labelling of the shortest path (from 1 to the other) is:
P =
0 1 1 2 3 4
注:实验成绩等级分为(90-100分)优,(80-89分)良,(70-79分)中,(60-69分)及格,(59分)不及格
第二篇:运筹学上机二实验报告
《图论与网络上机实验》
班级: 学号: 姓名: 成绩:
1、某物流公司欲从S城送货至T城,试从下图中找出最短路径。40%
18 21
12 16 14 17 15 13 8
11 19 20 22
9 11 15 14 21 24
12
16 15
最短路径:
最短路长:2、某会展馆从入口到出口有如下通道,弧上数字为客流上限。问一次最多可放进多少人?20%
188 211
152 116 214 117 151 131 89
211 129 200 223
99 113 156 146 218 245
124
136 165
一次放入人数:
3、如上图中数字改为工序时间(单位:分钟),求上述网络图的关键路线、总工期T。40%
总工期T:
关键路线: