Check Presence of Specified Edges in Graph
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a digraph G. I also have another digraph H. I want to check whether the edges in H are present in G and highlight those edge that are in common. The command
> findedge(G, H.Edges.Endnodes(:, 1), H.Edges.Endnodes(:, 2))
does not work because it gives an error as soon as an edge in H is absent in G.
Thank you so much.
Kamal
2 Kommentare
Steven Lord
am 28 Okt. 2021
Are we allowed to assume that G and H have exactly the same set of nodes, and that the node named (for example) Alice in G is to be considered the same as the node named Alice in H? Or are you trying to do something more like identifying two subgraphs of those digraph objects that are isomorphic, where the node Alice in G could be "associated" with the node Bob in H?
Antworten (1)
Shanmukha Voggu
am 26 Okt. 2021
Hi Kamal,
There is an error in the command that you provided, please change "Endnodes" to "EndNodes", This will resolve the error hopefully.
The correct command is:
findedge(G, H.Edges.EndNodes(:, 1), H.Edges.EndNodes(:, 2));
Hope this helps!
Siehe auch
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!