algorithm to return all possible connections between two specific buses/nodes

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
Walter Roberson 2011 年 7 月 23 日
Please do not start a new Question for a topic you already have open.
Talaria
Talaria 2011 年 7 月 24 日
i apologize.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2011 年 7 月 12 日

0 投票

This is the all simple paths problem. For some algorithms, see here

5 件のコメント

Talaria
Talaria 2011 年 7 月 23 日
thanks. but isnt there any possible algorithm to solve this problem, in matlab??
Walter Roberson
Walter Roberson 2011 年 7 月 23 日
*Algorithms* are independent of computer language. At least two *algorithms* are described in the link I gave before.
There is no built-in routine to solve this problem in MATLAB, so you will need to start coding.
Talaria
Talaria 2011 年 7 月 23 日
thanks again, i really appreciate it, but could you recommend a quick tutorial for java that could give me a clue about the code you linked me to?
Walter Roberson
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
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 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by