How to find all edges indexes if node indexes are given?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Artur Iskhakov
el 15 de Jul. de 2020
Comentada: Artur Iskhakov
el 15 de Jul. de 2020
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?
0 comentarios
Respuesta aceptada
Christine Tobler
el 15 de Jul. de 2020
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Graph and Network Algorithms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!