Node Pair list from a graph

2 次查看(过去 30 天)
Hari
Hari 2020-10-4
评论: Hari 2020-10-4
How can I get a matrix of node pairs from a graph? That is, if there are 4 nodes 1,2,3,4, then the node pair matrix would be :
1 2
1 3
1 4
2 3
2 4
3 4
I could do this using 2 for loops, but is there any quick way of doing it?

采纳的回答

Bruno Luong
Bruno Luong 2020-10-4
nchoosek(1:4,2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by