algorithm to return all possible connections between two specific buses/nodes
2 次查看(过去 30 天)
显示 更早的评论
We begin by having a matrix showing direct connections between different nodes, for example for five buses: [0 1 0 1 0;1 0 1 1 0;0 1 0 0 1; 1 1 0 0 1; 0 0 1 1 0]
so how do i implement an algorithm to provide from the above and chosen inputs: e.g. connections between: node-1 and node-4, the possible connections would be, i.e.:
1 1-4 2 1-2&2-4 4 1-2&2-3&3-5&5-4
i have tried alot but can't seem to find a solution, based on my limited matlab and programming experience. please help!
2 个评论
采纳的回答
Walter Roberson
2011-7-12
5 个评论
Walter Roberson
2011-7-24
You do not need to understand Java. Look further down. Robert Graves presented pseudo-code (a description of an algorithm) in his posting of Sep 12 '08 at 7:48.
Walter Roberson
2011-7-24
See also
http://en.wikipedia.org/wiki/Depth-first_search
http://en.wikipedia.org/wiki/Breadth-first_search
http://www.mathworks.com/help/toolbox/bioinfo/ref/graphtraverse.html
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!