need to know how to generate and list all the existing paths in a five node fully meshed network
Show older comments
sir i have a problem..suppose we have 5 nodes (A,B,C,D,E) fully meshed network. i want to find out all the possible paths that can exist in this network..like we will have n(n-1)/2 ie 10 direct paths for eg A to B, A to C, A to D and so on ..again there will n(n-1)(N-2)/2 , two - hops paths for eg A to B to C , A to B to D and so on ..i want to generate and list all possible paths through program.. Any sort of idea to do it will be highly appreciated..Plzz help
Answers (1)
Walter Roberson
on 1 Jun 2012
0 votes
Construct all the permutations of length 5. Then to get the permutations of length 4, remove the last letter from each of those and find the unique results. Continue trimming and uniquing until there is nothing left.
Question: is the assumption that no node can be repeated in a path?
4 Comments
m
on 4 Jun 2012
Walter Roberson
on 4 Jun 2012
The constrain the permutations so that the first node is less than the second node.
Walter Roberson
on 4 Jun 2012
Actually that's probably not sufficient.
Anyhow, you can always discard entries for which fliplr() of the entry is already in the list.
m
on 6 Jun 2012
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!