- 8
- 0
- 约 32页
- 2016-12-08 发布于江苏
- 举报
Gong Qu edge= [ 2,3,1,3,3,5,4, 4,1,7,6,6,5, 5,11, 1,8,6,9,10,8,9, 9,10;... 3,4,2,7,5,3,5,11,7,6,7,5,6,11, 5, 8,1,9,5,11,9,8,10,9;... 3,5,8,5,6,6,1,12,7,9,9,2,2,10,10,8,8,3,7, 2, 9,9, 2, 2]; n=11; weight=inf*ones(n, n); for i=1:n weight(i, i)=0; end for i=1:size(edge,2) weight(edge(1, i), edge(2, i))=edge(3, i); end [dis, path]=dijkstra(weight, 1, 11) 运行上页程序输出: dis = 21 path = 1 8 9 10 11 因此顶点1到顶点11的最短路径为1→8 →9 →10 →11, 其长度为21。 建立脚本m文件如下: a= [ 0,50,inf,40,25,10;50,0,15,20,inf,25;inf,15,0,10,20,inf;… 40,20,10,0,10,25;25,inf,20,10,0,5
您可能关注的文档
- 分类加法计数原理与分步乘法计数原理(二)课程.ppt
- effectivedecisionopinions有效的决策——见解彼得德鲁克课程.ppt
- 英语:Unit1SchoolandNumbersLesson3课件(冀教版七年级上)课程.ppt
- FIN48ApplicabilitytoInboundCompanies课程.ppt
- LinearProgramming(LP)(Chap29)课程.ppt
- 分类加法计数原理和分步乘法计数原理(三)课程.ppt
- 第24部分样本量估计课程.ppt
- TheDevelopmentofIntegrationMeasuresConditionsinthe课程.ppt
- ValuationSlidesFall2005课程.ppt
- 第3讲向量组的线性关系课程.ppt
- unidir -人工智能与国际安全:理解风险并为建立信任措施铺平道路 AI and International Security - Understanding the Risks and Paving the Path for Confidence-Building Measures.pdf
- unidir -通过负责任行为的规范、规则和原则推进空间安全的非洲视角 African Perspectives for Advancing Space Security Through Norms, Rules and Principles of Responsible Behaviours - Workshop Summary Report.pdf
- wfp -约旦学校供餐计划影响评估 Jordan, School Meal Programme Impact Evaluation.pdf
- wfp -注意差距 莱索托案例研究 Mind the Gap -Lesotho Case Study.pdf
- unesco -数字公共产品与新兴技术促进公平和包容的知识获取 Dubai Declaration on Open Educational Resources (OER) digital public goods and emerging technologies for equitable and inclusive access to knowledge.pdf
- unidir -致命自主武器系统领域新兴技术相关提案 Proposals Related to Emerging Technologies in the Area of Lethal Autonomous Weapons Systems- A Resource Paper (updated).pdf
- who -脊髓灰质炎过渡战略框架:监测与评估 Polio transition strategic framework - Monitoring and evaluation.pdf
- who -高效实用的结核病治疗试验平台会议报告 Platform for efficient and practical tuberculosis treatment trials.pdf
- unesco -国际性教育技术指导纲要:循证方法 International technical guidance on sexuality education - an evidence-informed approach.pdf
- UNIDIR_unidir -涉足浑浊之水:海底通信电缆与负责任的国家行为 Wading Murky Waters - Subsea Communications Cables and Responsible State Behaviour.pdf
原创力文档

文档评论(0)