フィルターのクリア

How to find all edges indexes if node indexes are given?

2 ビュー (過去 30 日間)
Artur Iskhakov
Artur Iskhakov 2020 年 7 月 15 日
コメント済み: Artur Iskhakov 2020 年 7 月 15 日
Hi! How can I find all edges indexes in graph G that are made of nodes 4,5,6 (in this case according to G.Edges those edges are 5 and 6). Can anybody help me with that?

採用された回答

Christine Tobler
Christine Tobler 2020 年 7 月 15 日
So you're looking for all edges where both end nodes are part of the set 4, 5, 6? This will compute them:
>> [s, t] = findedge(g);
>> nodes = [4 5 6];
>> find(ismember(s, nodes) & ismember(t, nodes))
ans =
5
6
  1 件のコメント
Artur Iskhakov
Artur Iskhakov 2020 年 7 月 15 日
Oh thank you so much, it's working now))

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by