資源簡介
壓縮包里有Dijkstra算法的描述文檔、實現原理以及MATLAB代碼
代碼片段和文件信息
clear;
n=input(‘Please?input?the?number?of?the?notes:?k=‘);?%輸入節點數目
p=n*n;
disp(‘Note:?If?there?is?no?direct?link?between?notes?use?100?to?reprsent?infinite‘);
temp=input(‘Please?input?the?k*k?matrix?of?the?length?of?path:?M=‘);?%輸入路徑長度矩陣
while(prod(size(temp))~=p)?%驗證輸入矩陣維數是否正確?
????disp(‘please?input?the?correct?size?of?the?matrix‘);
????temp=input(‘Please?input?the?k*k?matrix?of?the?length?of?path:?M=‘);
end
w=temp;?%路徑矩陣初始化
i=input(‘Please?identify?the?initial?note:?s=‘);?%輸入指定節點
[sd]=minroute(inw)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????325670??2012-04-03?11:02??利用MATLAB實現Dijkstra算法.docx
?????文件????????561??2012-04-03?11:14??Dijkstra_main_function.m
?????文件????????874??2012-04-03?11:20??Dijkstra_sub_function.m
-----------?---------??----------?-----??----
???????????????327105????????????????????3
評論
共有 條評論