資源簡介
標準的深度優先搜索算法,可實現節點遍歷、產生隨機路由、檢測圖中是否有回路等功能,-Standard depth-first search algorithm, the node traversal can be achieved, resulting in a random routing, testing whether there is any loop diagram functions

代碼片段和文件信息
function?cs?=?children(adj_mat?i?t)
%?CHILDREN?Return?the?indices?of?a?node‘s?children?in?sorted?order
%?c?=?children(adj_mat?i?t)
%
%?t?is?an?optional?argument:?if?present?dag?is?assumed?to?be?a?2-slice?DBN
if?nargin?3
??cs?=?find(adj_mat(i:));
else
??if?t==1
????cs?=?find(adj_mat(i:));
??else
????ss?=?length(adj_mat)/2;
????j?=?i+ss;
????cs?=?find(adj_mat(j:))?+?(t-2)*ss;
??end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????415??2011-01-11?09:09??dfs\children.m
?????文件???????3363??2011-01-11?09:07??dfs\dfs.asv
?????文件???????1761??2011-01-11?09:10??dfs\dfs.m
?????文件????????946??2011-01-11?09:10??dfs\dfs_visit.m
?????文件????????241??2011-01-11?09:08??dfs\neighbors.m
?????目錄??????????0??2011-01-11?09:10??dfs
-----------?---------??----------?-----??----
?????????????????6726????????????????????6
- 上一篇:多徑信道下 簡單OFDM matlab仿真
- 下一篇:手寫識別題個人樣本
評論
共有 條評論